Skip to content

Commit b15bd89

Browse files
author
Kevin Liu
committed
refrush and load list view improve
1 parent 1778292 commit b15bd89

File tree

66 files changed

+6381
-405
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+6381
-405
lines changed

gen/com/kevinjava/ngaclient/R.java

Lines changed: 782 additions & 281 deletions
Large diffs are not rendered by default.

res/anim/slide_in_from_bottom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (C) 2009 The Android Open Source Project
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<translate xmlns:android="http://schemas.android.com/apk/res/android"
19+
android:duration="@android:integer/config_longAnimTime"
20+
android:fromYDelta="100%p"
21+
android:toYDelta="0" />

res/anim/slide_in_from_top.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (C) 2009 The Android Open Source Project
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<translate xmlns:android="http://schemas.android.com/apk/res/android"
19+
android:duration="@android:integer/config_longAnimTime"
20+
android:fromYDelta="-100%p"
21+
android:toYDelta="0" />

res/anim/slide_out_to_bottom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (C) 2009 The Android Open Source Project
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<translate xmlns:android="http://schemas.android.com/apk/res/android"
19+
android:duration="@android:integer/config_longAnimTime"
20+
android:fromYDelta="0"
21+
android:toYDelta="100%p" />

res/anim/slide_out_to_top.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (C) 2009 The Android Open Source Project
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<translate xmlns:android="http://schemas.android.com/apk/res/android"
19+
android:duration="@android:integer/config_longAnimTime"
20+
android:fromYDelta="0"
21+
android:toYDelta="-100%p" />
1.79 KB
Loading
47.8 KB
Loading

res/drawable-hdpi/indicator_arrow.png

390 Bytes
Loading
1.57 KB
Loading
48.5 KB
Loading

res/drawable-mdpi/indicator_arrow.png

445 Bytes
Loading
1.94 KB
Loading
48.8 KB
Loading
429 Bytes
Loading

res/drawable/indicator_bg_bottom.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="rectangle" >
4+
5+
<solid android:color="#40000000" />
6+
7+
<!--
8+
I know the android:radius is useless here but it's needed to fix an old bug:
9+
http://code.google.com/p/android/issues/detail?id=939
10+
-->
11+
<corners
12+
android:bottomLeftRadius="0dp"
13+
android:bottomRightRadius="0dp"
14+
android:radius="1dp"
15+
android:topLeftRadius="@dimen/indicator_corner_radius"
16+
android:topRightRadius="@dimen/indicator_corner_radius" />
17+
18+
</shape>

res/drawable/indicator_bg_top.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="rectangle" >
4+
5+
<solid android:color="#40000000" />
6+
7+
<!--
8+
I know the android:radius is useless here but it's needed to fix an old bug:
9+
http://code.google.com/p/android/issues/detail?id=939
10+
-->
11+
<corners
12+
android:bottomLeftRadius="@dimen/indicator_corner_radius"
13+
android:bottomRightRadius="@dimen/indicator_corner_radius"
14+
android:radius="1dp"
15+
android:topLeftRadius="0dp"
16+
android:topRightRadius="0dp" />
17+
18+
</shape>

res/layout/activity_ptr_list.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="fill_parent"
4+
android:layout_height="fill_parent"
5+
android:orientation="vertical" >
6+
7+
<!-- The PullToRefreshListView replaces a standard ListView widget. -->
8+
9+
<com.handmark.pulltorefresh.library.PullToRefreshListView
10+
xmlns:ptr="http://schemas.android.com/apk/res-auto"
11+
android:id="@+id/pull_refresh_list"
12+
android:layout_width="fill_parent"
13+
android:layout_height="fill_parent"
14+
android:cacheColorHint="#00000000"
15+
android:divider="#19000000"
16+
android:dividerHeight="1dp"
17+
android:fadingEdge="none"
18+
android:fastScrollEnabled="false"
19+
android:footerDividersEnabled="false"
20+
android:headerDividersEnabled="false"
21+
android:smoothScrollbar="true"
22+
ptr:ptrMode="both"/>
23+
24+
</LinearLayout>

res/layout/main_list_item.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,13 @@
3434

3535
<TextView
3636
android:id="@+id/forum_subject"
37-
style="@style/subjectTextView"
37+
style="@style/bodyTextView"
3838
android:layout_width="wrap_content"
3939
android:layout_height="wrap_content"
4040
android:layout_alignLeft="@id/user_name"
4141
android:layout_alignRight="@id/pushlish_time"
4242
android:layout_below="@id/user_name"
43-
android:layout_marginTop="5dp"
44-
android:textSize="14sp" />
43+
android:layout_marginTop="5dp" />
4544

4645
<ImageView
4746
android:id="@+id/reply_icon"
@@ -61,7 +60,6 @@
6160
android:layout_height="wrap_content"
6261
android:layout_alignTop="@id/reply_icon"
6362
android:layout_centerInParent="true"
64-
android:layout_marginLeft="5dp"
6563
android:layout_toRightOf="@id/reply_icon" />
6664

6765
<TextView
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
3+
4+
<FrameLayout
5+
android:id="@+id/fl_inner"
6+
android:layout_width="wrap_content"
7+
android:layout_height="fill_parent"
8+
android:paddingBottom="@dimen/header_footer_top_bottom_padding"
9+
android:paddingLeft="@dimen/header_footer_left_right_padding"
10+
android:paddingRight="@dimen/header_footer_left_right_padding"
11+
android:paddingTop="@dimen/header_footer_top_bottom_padding" >
12+
13+
<ImageView
14+
android:id="@+id/pull_to_refresh_image"
15+
android:layout_width="wrap_content"
16+
android:layout_height="wrap_content"
17+
android:layout_gravity="center" />
18+
19+
<ProgressBar
20+
android:id="@+id/pull_to_refresh_progress"
21+
style="?android:attr/progressBarStyleSmall"
22+
android:layout_width="wrap_content"
23+
android:layout_height="wrap_content"
24+
android:layout_gravity="center"
25+
android:indeterminate="true"
26+
android:visibility="gone" />
27+
</FrameLayout>
28+
29+
</merge>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
3+
4+
<FrameLayout
5+
android:id="@+id/fl_inner"
6+
android:layout_width="fill_parent"
7+
android:layout_height="wrap_content"
8+
android:paddingBottom="@dimen/header_footer_top_bottom_padding"
9+
android:paddingLeft="@dimen/header_footer_left_right_padding"
10+
android:paddingRight="@dimen/header_footer_left_right_padding"
11+
android:paddingTop="@dimen/header_footer_top_bottom_padding"
12+
android:background="@color/black">
13+
14+
<FrameLayout
15+
android:layout_width="wrap_content"
16+
android:layout_height="wrap_content"
17+
android:layout_gravity="left|center_vertical"
18+
android:layout_marginLeft="50.0dip" >
19+
20+
<ImageView
21+
android:id="@+id/pull_to_refresh_image"
22+
android:layout_width="wrap_content"
23+
android:layout_height="wrap_content"
24+
android:layout_gravity="center" />
25+
26+
<ProgressBar
27+
android:id="@+id/pull_to_refresh_progress"
28+
style="?android:attr/progressBarStyleSmall"
29+
android:layout_width="wrap_content"
30+
android:layout_height="wrap_content"
31+
android:layout_gravity="center"
32+
android:indeterminate="true"
33+
android:visibility="gone" />
34+
</FrameLayout>
35+
36+
<LinearLayout
37+
android:layout_width="wrap_content"
38+
android:layout_height="wrap_content"
39+
android:layout_gravity="center"
40+
android:gravity="center_horizontal"
41+
android:orientation="vertical" >
42+
43+
<TextView
44+
android:id="@+id/pull_to_refresh_text"
45+
android:layout_width="wrap_content"
46+
android:layout_height="wrap_content"
47+
android:singleLine="true"
48+
android:textAppearance="?android:attr/textAppearance"
49+
android:textStyle="bold" />
50+
51+
<TextView
52+
android:id="@+id/pull_to_refresh_sub_text"
53+
android:layout_width="wrap_content"
54+
android:layout_height="wrap_content"
55+
android:singleLine="true"
56+
android:textAppearance="?android:attr/textAppearanceSmall"
57+
android:visibility="gone" />
58+
</LinearLayout>
59+
</FrameLayout>
60+
61+
</merge>

res/layout/pulldown_header_two.xml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="fill_parent"
4+
android:layout_height="fill_parent"
5+
android:orientation="vertical"
6+
android:background="@color/black" >
7+
8+
<FrameLayout
9+
android:id="@+id/fl_inner"
10+
android:layout_width="fill_parent"
11+
android:layout_height="wrap_content"
12+
android:gravity="bottom" >
13+
14+
<ImageView
15+
android:id="@+id/img_bkg"
16+
android:layout_width="fill_parent"
17+
android:layout_height="wrap_content"
18+
android:layout_gravity="top"
19+
android:scaleType="centerCrop" />
20+
21+
<LinearLayout
22+
android:id="@+id/pull_header_container"
23+
android:layout_width="fill_parent"
24+
android:layout_height="wrap_content"
25+
android:layout_gravity="bottom|left|center"
26+
android:orientation="vertical" >
27+
28+
<FrameLayout
29+
android:layout_width="fill_parent"
30+
android:layout_height="wrap_content" >
31+
32+
<FrameLayout
33+
android:id="@+id/layout_indicator"
34+
android:layout_width="wrap_content"
35+
android:layout_height="50dp"
36+
android:layout_gravity="bottom|left|center"
37+
android:layout_marginLeft="50.0dip" >
38+
39+
<ProgressBar
40+
android:id="@+id/pull_to_refresh_progress"
41+
android:layout_width="22.0dip"
42+
android:layout_height="22.0dip"
43+
android:layout_gravity="center"
44+
android:visibility="gone" />
45+
46+
<ImageView
47+
android:id="@+id/pull_to_refresh_image"
48+
android:layout_width="wrap_content"
49+
android:layout_height="wrap_content"
50+
android:layout_gravity="center"
51+
android:scaleType="center"
52+
android:src="@drawable/pullheader_indicator" />
53+
</FrameLayout>
54+
55+
<LinearLayout
56+
android:layout_width="fill_parent"
57+
android:layout_height="50dp"
58+
android:layout_gravity="bottom|center"
59+
android:gravity="center"
60+
android:orientation="vertical" >
61+
62+
<TextView
63+
android:id="@+id/pull_to_refresh_text"
64+
android:layout_width="wrap_content"
65+
android:layout_height="wrap_content"
66+
android:textColor="@color/white"
67+
android:textSize="15.0sp" />
68+
69+
<TextView
70+
android:id="@+id/pull_to_refresh_sub_text"
71+
android:layout_width="wrap_content"
72+
android:layout_height="wrap_content"
73+
android:textColor="@color/white"
74+
android:textSize="14.0sp"
75+
android:visibility="gone" />
76+
</LinearLayout>
77+
</FrameLayout>
78+
</LinearLayout>
79+
</FrameLayout>
80+
81+
</LinearLayout>

res/raw/pop.ogg

4.17 KB
Binary file not shown.

res/raw/psst1.ogg

4.6 KB
Binary file not shown.

res/raw/psst2.ogg

4.67 KB
Binary file not shown.

0 commit comments

Comments
 (0)