Skip to content

Commit 279ed15

Browse files
Mindy PereiraAndroid Git Automerger
authored andcommitted
am fd2db1b: Merge "Swiperefresh sample" into klp-ub-dev
* commit 'fd2db1bef161e8bc7eda014f3924009330a9ab44': Swiperefresh sample
2 parents 54ec4ff + fd2db1b commit 279ed15

File tree

11 files changed

+215
-2
lines changed

11 files changed

+215
-2
lines changed

samples/Support4Demos/AndroidManifest.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,15 @@
305305
</intent-filter>
306306
</activity>
307307

308+
<activity android:name=".widget.SwipeRefreshLayoutActivity"
309+
android:label="@string/swipe"
310+
android:theme="@style/ThemeHoloLight">
311+
<intent-filter>
312+
<action android:name="android.intent.action.MAIN" />
313+
<category android:name="com.example.android.supportv4.SUPPORT4_SAMPLE_CODE" />
314+
</intent-filter>
315+
</activity>
316+
308317
<activity android:name=".widget.ContentLoadingProgressBarActivity"
309318
android:label="@string/content_loading_progress_bar">
310319
<intent-filter>
1.7 KB
Loading
1.14 KB
Loading
2.23 KB
Loading
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (C) 2013 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
18+
android:id="@+id/swipe_refresh_widget"
19+
android:layout_width="match_parent"
20+
android:layout_height="match_parent">
21+
<!-- some full screen pullable view that will be the offsetable content -->
22+
<ListView
23+
android:layout_width="match_parent"
24+
android:layout_height="match_parent"
25+
android:id="@+id/content"/>
26+
</android.support.v4.widget.SwipeRefreshLayout>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (C) 2013 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
<menu xmlns:android="http://schemas.android.com/apk/res/android">
18+
<item android:id="@+id/force_refresh"
19+
android:showAsAction="ifRoom"
20+
android:icon="@drawable/refresh"
21+
android:title="Refresh" />
22+
</menu>

samples/Support4Demos/res/values-v11/styles.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
<style name="ThemeHolo" parent="android:Theme.Holo">
2020
</style>
2121

22+
<!-- For API level 11 or later, the Holo theme is available and we prefer that. -->
23+
<style name="ThemeHoloLight" parent="android:Theme.Holo.Light">
24+
</style>
25+
2226
<!-- For API level 11 or later, we can use the magical DialogWhenLarge theme. -->
2327
<style name="ThemeDialogWhenLarge" parent="android:style/Theme.Holo.DialogWhenLarge">
2428
</style>

samples/Support4Demos/res/values/colors.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,9 @@
1818
<drawable name="red">#7f00</drawable>
1919
<drawable name="blue">#770000ff</drawable>
2020
<drawable name="green">#7700ff00</drawable>
21-
<drawable name="yellow">#77ffff00</drawable>
21+
<drawable name="yellow">#77ffff00</drawable>
22+
<color name="color1">#ff0f9d58</color>
23+
<color name="color2">#ffdb4437</color>
24+
<color name="color3">#ff4285f4</color>
25+
<color name="color4">#fff4b400</color>
2226
</resources>

samples/Support4Demos/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,6 @@
176176
<!-- ContentLoadingProgressBar -->
177177
<string name="content_loading_progress_bar">Widget/Content Loading Progress Bar</string>
178178

179+
<!-- Swipe refresh -->
180+
<string name="swipe">Widget/SwipeRefreshLayout</string>
179181
</resources>

samples/Support4Demos/res/values/styles.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
2121
selected when the holographic theme is available. -->
2222
<style name="ThemeHolo" parent="android:Theme">
2323
</style>
24-
24+
25+
<!-- This is a theme that will adjust itself depending on the API version.
26+
The default definition is the safe one, using a theme that has always
27+
been defined. Look at values-11/styles.xml for a variation that is
28+
selected when the holographic theme is available. -->
29+
<style name="ThemeHoloLight" parent="android:Theme.Light">
30+
</style>
31+
2532
<!-- Older platforms don't have Theme.Holo.DialogWhenLarge; we will define
2633
our own wrapper theme that uses it only when running on the appropriate
2734
platform version. On older platforms, we always use the generic

0 commit comments

Comments
 (0)