Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Commit

Permalink
Merge pull request #11 from richsage/pull-refresh
Browse files Browse the repository at this point in the history
Add pull-to-refresh
  • Loading branch information
Tocacar committed Mar 5, 2014
2 parents 59b3e4b + 1691146 commit a0b8e37
Show file tree
Hide file tree
Showing 12 changed files with 574 additions and 12 deletions.
Binary file added source/res/drawable-hdpi/ic_pulltorefresh_arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/res/drawable-ldpi/ic_pulltorefresh_arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/res/drawable-mdpi/ic_pulltorefresh_arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions source/res/layout/comments.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
android:orientation="vertical"
android:layout_weight="1">

<ListView
<com.markupartist.android.widget.PullToRefreshListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical"
android:id="@+id/EventDetailComments"
android:clickable="false"></ListView>
android:clickable="false" />

</LinearLayout>

<Button
Expand Down
4 changes: 2 additions & 2 deletions source/res/layout/eventtalks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
android:layout_height="fill_parent"
android:layout_width="fill_parent">

<ListView
<com.markupartist.android.widget.PullToRefreshListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical"
android:id="@+id/ListViewEventTalks"></ListView>
android:id="@+id/ListViewEventTalks"/>
</LinearLayout>
69 changes: 69 additions & 0 deletions source/res/layout/pull_to_refresh_header.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 Johan Nilsson <http://markupartist.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingTop="10dip"
android:paddingBottom="15dip"
android:gravity="center"
android:id="@+id/pull_to_refresh_header"
>
<ProgressBar
android:id="@+id/pull_to_refresh_progress"
android:indeterminate="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dip"
android:layout_marginRight="20dip"
android:layout_marginTop="10dip"
android:visibility="gone"
android:layout_centerVertical="true"
style="?android:attr/progressBarStyleSmall"
/>
<ImageView
android:id="@+id/pull_to_refresh_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dip"
android:layout_marginRight="20dip"
android:visibility="gone"
android:layout_gravity="center"
android:gravity="center"
android:src="@drawable/ic_pulltorefresh_arrow"
/>
<TextView
android:id="@+id/pull_to_refresh_text"
android:text="@string/pull_to_refresh_tap_label"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
android:paddingTop="5dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
/>
<TextView
android:id="@+id/pull_to_refresh_updated_at"
android:layout_below="@+id/pull_to_refresh_text"
android:visibility="gone"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
/>
</RelativeLayout>
6 changes: 6 additions & 0 deletions source/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,10 @@
<string name="activityEventDetailFailedJSON">Couldn\'t retrieve event details</string>
<string name="activityTalkCommentsFailedJSON">Couldn\'t retrieve talk details</string>

<!-- Pull-to-refresh copy -->
<string name="pull_to_refresh_pull_label">Pull to refresh…</string>
<string name="pull_to_refresh_release_label">Release to refresh…</string>
<string name="pull_to_refresh_refreshing_label">Loading…</string>
<string name="pull_to_refresh_tap_label">Tap to refresh…</string>

</resources>
Loading

0 comments on commit a0b8e37

Please sign in to comment.