Add new API demo for -swNNNdp resource qualifier.
Also clean up the demo for the w/h qualifiers to use numbers
that are the same as what we will be recommending.
Change-Id: I87ed35d8dfcb41985e19f450f7853f883effd207
diff --git a/samples/ApiDemos/AndroidManifest.xml b/samples/ApiDemos/AndroidManifest.xml
index c570322..8d12d84 100644
--- a/samples/ApiDemos/AndroidManifest.xml
+++ b/samples/ApiDemos/AndroidManifest.xml
@@ -1029,7 +1029,17 @@
<activity android:name=".content.ResourcesWidthAndHeight"
android:label="@string/activity_resources_width_and_height"
- android:enabled="@bool/atLeastIceCreamSandwich">
+ android:enabled="@bool/atLeastHoneycombMR2">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.SAMPLE_CODE" />
+ <category android:name="android.intent.category.EMBED" />
+ </intent-filter>
+ </activity>
+
+ <activity android:name=".content.ResourcesSmallestWidth"
+ android:label="@string/activity_resources_smallest_width"
+ android:enabled="@bool/atLeastHoneycombMR2">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
diff --git a/samples/ApiDemos/res/layout-h420dp/resources_height.xml b/samples/ApiDemos/res/layout-h550dp/resources_height.xml
similarity index 78%
copy from samples/ApiDemos/res/layout-h420dp/resources_height.xml
copy to samples/ApiDemos/res/layout-h550dp/resources_height.xml
index 115a731..687c39a 100644
--- a/samples/ApiDemos/res/layout-h420dp/resources_height.xml
+++ b/samples/ApiDemos/res/layout-h550dp/resources_height.xml
@@ -39,5 +39,15 @@
android:background="#80ff0000">
<include layout="@layout/resources_width" />
</FrameLayout>
+ <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
+ android:layout_weight="1" android:padding="4dp"
+ android:background="#8000ff00">
+ <include layout="@layout/resources_width" />
+ </FrameLayout>
+ <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
+ android:layout_weight="1" android:padding="4dp"
+ android:background="#80ff0000">
+ <include layout="@layout/resources_width" />
+ </FrameLayout>
</LinearLayout>
</merge>
diff --git a/samples/ApiDemos/res/layout-h420dp/resources_height.xml b/samples/ApiDemos/res/layout-sw480dp/resources_smallest_width_inner.xml
similarity index 86%
rename from samples/ApiDemos/res/layout-h420dp/resources_height.xml
rename to samples/ApiDemos/res/layout-sw480dp/resources_smallest_width_inner.xml
index 115a731..7d0c438 100644
--- a/samples/ApiDemos/res/layout-h420dp/resources_height.xml
+++ b/samples/ApiDemos/res/layout-sw480dp/resources_smallest_width_inner.xml
@@ -22,22 +22,22 @@
<FrameLayout android:layout_width="match_parent" android:layout_height="0px"
android:layout_weight="1" android:padding="4dp"
android:background="#8000ff00">
- <include layout="@layout/resources_width" />
+ <include layout="@layout/resources_smallest_width_row" />
</FrameLayout>
<FrameLayout android:layout_width="match_parent" android:layout_height="0px"
android:layout_weight="1" android:padding="4dp"
android:background="#80ff0000">
- <include layout="@layout/resources_width" />
+ <include layout="@layout/resources_smallest_width_row" />
</FrameLayout>
<FrameLayout android:layout_width="match_parent" android:layout_height="0px"
android:layout_weight="1" android:padding="4dp"
android:background="#8000ff00">
- <include layout="@layout/resources_width" />
+ <include layout="@layout/resources_smallest_width_row" />
</FrameLayout>
<FrameLayout android:layout_width="match_parent" android:layout_height="0px"
android:layout_weight="1" android:padding="4dp"
android:background="#80ff0000">
- <include layout="@layout/resources_width" />
+ <include layout="@layout/resources_smallest_width_row" />
</FrameLayout>
</LinearLayout>
</merge>
diff --git a/samples/ApiDemos/res/layout-w420dp/resources_width.xml b/samples/ApiDemos/res/layout-sw480dp/resources_smallest_width_row.xml
similarity index 85%
rename from samples/ApiDemos/res/layout-w420dp/resources_width.xml
rename to samples/ApiDemos/res/layout-sw480dp/resources_smallest_width_row.xml
index 1edffe3..a222eab 100644
--- a/samples/ApiDemos/res/layout-w420dp/resources_width.xml
+++ b/samples/ApiDemos/res/layout-sw480dp/resources_smallest_width_row.xml
@@ -22,22 +22,22 @@
<TextView android:layout_width="0px" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#1">
+ android:background="#800000ff" android:text="sw480dp #1">
</TextView>
<TextView android:layout_width="0px" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#2">
+ android:background="#800000ff" android:text="sw480dp #2">
</TextView>
<TextView android:layout_width="0px" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#3">
+ android:background="#800000ff" android:text="sw480dp #3">
</TextView>
<TextView android:layout_width="0px" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#4">
+ android:background="#800000ff" android:text="sw480dp #4">
</TextView>
</LinearLayout>
</merge>
diff --git a/samples/ApiDemos/res/layout-h420dp/resources_height.xml b/samples/ApiDemos/res/layout-sw600dp/resources_smallest_width_inner.xml
similarity index 67%
copy from samples/ApiDemos/res/layout-h420dp/resources_height.xml
copy to samples/ApiDemos/res/layout-sw600dp/resources_smallest_width_inner.xml
index 115a731..3a844a0 100644
--- a/samples/ApiDemos/res/layout-h420dp/resources_height.xml
+++ b/samples/ApiDemos/res/layout-sw600dp/resources_smallest_width_inner.xml
@@ -22,22 +22,32 @@
<FrameLayout android:layout_width="match_parent" android:layout_height="0px"
android:layout_weight="1" android:padding="4dp"
android:background="#8000ff00">
- <include layout="@layout/resources_width" />
+ <include layout="@layout/resources_smallest_width_row" />
</FrameLayout>
<FrameLayout android:layout_width="match_parent" android:layout_height="0px"
android:layout_weight="1" android:padding="4dp"
android:background="#80ff0000">
- <include layout="@layout/resources_width" />
+ <include layout="@layout/resources_smallest_width_row" />
</FrameLayout>
<FrameLayout android:layout_width="match_parent" android:layout_height="0px"
android:layout_weight="1" android:padding="4dp"
android:background="#8000ff00">
- <include layout="@layout/resources_width" />
+ <include layout="@layout/resources_smallest_width_row" />
</FrameLayout>
<FrameLayout android:layout_width="match_parent" android:layout_height="0px"
android:layout_weight="1" android:padding="4dp"
android:background="#80ff0000">
- <include layout="@layout/resources_width" />
+ <include layout="@layout/resources_smallest_width_row" />
+ </FrameLayout>
+ <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
+ android:layout_weight="1" android:padding="4dp"
+ android:background="#8000ff00">
+ <include layout="@layout/resources_smallest_width_row" />
+ </FrameLayout>
+ <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
+ android:layout_weight="1" android:padding="4dp"
+ android:background="#80ff0000">
+ <include layout="@layout/resources_smallest_width_row" />
</FrameLayout>
</LinearLayout>
</merge>
diff --git a/samples/ApiDemos/res/layout-w420dp/resources_width.xml b/samples/ApiDemos/res/layout-sw600dp/resources_smallest_width_row.xml
similarity index 67%
copy from samples/ApiDemos/res/layout-w420dp/resources_width.xml
copy to samples/ApiDemos/res/layout-sw600dp/resources_smallest_width_row.xml
index 1edffe3..ba79e3e 100644
--- a/samples/ApiDemos/res/layout-w420dp/resources_width.xml
+++ b/samples/ApiDemos/res/layout-sw600dp/resources_smallest_width_row.xml
@@ -22,22 +22,32 @@
<TextView android:layout_width="0px" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#1">
+ android:background="#800000ff" android:text="sw600dp #1">
</TextView>
<TextView android:layout_width="0px" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#2">
+ android:background="#800000ff" android:text="sw600dp #2">
</TextView>
<TextView android:layout_width="0px" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#3">
+ android:background="#800000ff" android:text="sw600dp #3">
</TextView>
<TextView android:layout_width="0px" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#4">
+ android:background="#800000ff" android:text="sw600dp #4">
+ </TextView>
+ <TextView android:layout_width="0px" android:layout_height="match_parent"
+ android:layout_weight="1" android:gravity="center_horizontal"
+ android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
+ android:background="#800000ff" android:text="sw600dp #5">
+ </TextView>
+ <TextView android:layout_width="0px" android:layout_height="match_parent"
+ android:layout_weight="1" android:gravity="center_horizontal"
+ android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
+ android:background="#800000ff" android:text="sw600dp #6">
</TextView>
</LinearLayout>
</merge>
diff --git a/samples/ApiDemos/res/layout-sw720dp/resources_smallest_width_inner.xml b/samples/ApiDemos/res/layout-sw720dp/resources_smallest_width_inner.xml
new file mode 100644
index 0000000..63977a3
--- /dev/null
+++ b/samples/ApiDemos/res/layout-sw720dp/resources_smallest_width_inner.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+ 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.
+-->
+
+<!-- Part of resources_width_and_height that varies based on height. -->
+
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"
+ android:orientation="vertical">
+ <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
+ android:layout_weight="1" android:padding="4dp"
+ android:background="#8000ff00">
+ <include layout="@layout/resources_smallest_width_row" />
+ </FrameLayout>
+ <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
+ android:layout_weight="1" android:padding="4dp"
+ android:background="#80ff0000">
+ <include layout="@layout/resources_smallest_width_row" />
+ </FrameLayout>
+ <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
+ android:layout_weight="1" android:padding="4dp"
+ android:background="#8000ff00">
+ <include layout="@layout/resources_smallest_width_row" />
+ </FrameLayout>
+ <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
+ android:layout_weight="1" android:padding="4dp"
+ android:background="#80ff0000">
+ <include layout="@layout/resources_smallest_width_row" />
+ </FrameLayout>
+ <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
+ android:layout_weight="1" android:padding="4dp"
+ android:background="#8000ff00">
+ <include layout="@layout/resources_smallest_width_row" />
+ </FrameLayout>
+ <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
+ android:layout_weight="1" android:padding="4dp"
+ android:background="#80ff0000">
+ <include layout="@layout/resources_smallest_width_row" />
+ </FrameLayout>
+ <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
+ android:layout_weight="1" android:padding="4dp"
+ android:background="#8000ff00">
+ <include layout="@layout/resources_smallest_width_row" />
+ </FrameLayout>
+ <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
+ android:layout_weight="1" android:padding="4dp"
+ android:background="#80ff0000">
+ <include layout="@layout/resources_smallest_width_row" />
+ </FrameLayout>
+ </LinearLayout>
+</merge>
diff --git a/samples/ApiDemos/res/layout-sw720dp/resources_smallest_width_row.xml b/samples/ApiDemos/res/layout-sw720dp/resources_smallest_width_row.xml
new file mode 100644
index 0000000..948eefb
--- /dev/null
+++ b/samples/ApiDemos/res/layout-sw720dp/resources_smallest_width_row.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+ 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.
+-->
+
+<!-- Part of resources_width_and_height that varies based on width. -->
+
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"
+ android:orientation="horizontal">
+ <TextView android:layout_width="0px" android:layout_height="match_parent"
+ android:layout_weight="1" android:gravity="center_horizontal"
+ android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
+ android:background="#800000ff" android:text="sw720dp #1">
+ </TextView>
+ <TextView android:layout_width="0px" android:layout_height="match_parent"
+ android:layout_weight="1" android:gravity="center_horizontal"
+ android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
+ android:background="#800000ff" android:text="sw720dp #2">
+ </TextView>
+ <TextView android:layout_width="0px" android:layout_height="match_parent"
+ android:layout_weight="1" android:gravity="center_horizontal"
+ android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
+ android:background="#800000ff" android:text="sw720dp #3">
+ </TextView>
+ <TextView android:layout_width="0px" android:layout_height="match_parent"
+ android:layout_weight="1" android:gravity="center_horizontal"
+ android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
+ android:background="#800000ff" android:text="sw720dp #4">
+ </TextView>
+ <TextView android:layout_width="0px" android:layout_height="match_parent"
+ android:layout_weight="1" android:gravity="center_horizontal"
+ android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
+ android:background="#800000ff" android:text="sw720dp #5">
+ </TextView>
+ <TextView android:layout_width="0px" android:layout_height="match_parent"
+ android:layout_weight="1" android:gravity="center_horizontal"
+ android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
+ android:background="#800000ff" android:text="sw720dp #6">
+ </TextView>
+ <TextView android:layout_width="0px" android:layout_height="match_parent"
+ android:layout_weight="1" android:gravity="center_horizontal"
+ android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
+ android:background="#800000ff" android:text="sw720dp #7">
+ </TextView>
+ <TextView android:layout_width="0px" android:layout_height="match_parent"
+ android:layout_weight="1" android:gravity="center_horizontal"
+ android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
+ android:background="#800000ff" android:text="sw720dp #8">
+ </TextView>
+ </LinearLayout>
+</merge>
diff --git a/samples/ApiDemos/res/layout-w420dp/resources_width.xml b/samples/ApiDemos/res/layout-w600dp/resources_width.xml
similarity index 69%
copy from samples/ApiDemos/res/layout-w420dp/resources_width.xml
copy to samples/ApiDemos/res/layout-w600dp/resources_width.xml
index 1edffe3..ee7b0bd 100644
--- a/samples/ApiDemos/res/layout-w420dp/resources_width.xml
+++ b/samples/ApiDemos/res/layout-w600dp/resources_width.xml
@@ -22,22 +22,32 @@
<TextView android:layout_width="0px" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#1">
+ android:background="#800000ff" android:text="w600dp Width\n#1">
</TextView>
<TextView android:layout_width="0px" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#2">
+ android:background="#800000ff" android:text="w600dp Width\n#2">
</TextView>
<TextView android:layout_width="0px" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#3">
+ android:background="#800000ff" android:text="w600dp Width\n#3">
</TextView>
<TextView android:layout_width="0px" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#4">
+ android:background="#800000ff" android:text="w600dp Width\n#4">
+ </TextView>
+ <TextView android:layout_width="0px" android:layout_height="match_parent"
+ android:layout_weight="1" android:gravity="center_horizontal"
+ android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
+ android:background="#800000ff" android:text="w600dp Width\n#5">
+ </TextView>
+ <TextView android:layout_width="0px" android:layout_height="match_parent"
+ android:layout_weight="1" android:gravity="center_horizontal"
+ android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
+ android:background="#800000ff" android:text="w600dp Width\n#6">
</TextView>
</LinearLayout>
</merge>
diff --git a/samples/ApiDemos/res/layout/resources_smallest_width.xml b/samples/ApiDemos/res/layout/resources_smallest_width.xml
new file mode 100644
index 0000000..c462292
--- /dev/null
+++ b/samples/ApiDemos/res/layout/resources_smallest_width.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+ 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.
+-->
+
+<!-- Demonstrates using -wNNNdp and -hNNNdp resource configs. -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent" android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <TextView android:layout_width="match_parent" android:layout_height="wrap_content"
+ android:layout_weight="0" android:gravity="center_horizontal"
+ android:paddingTop="8dp" android:paddingBottom="8dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/resources_smallest_width_description"/>
+
+ <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
+ android:layout_weight="1"
+ android:background="@android:drawable/gallery_thumb">
+ <include layout="@layout/resources_smallest_width_inner" />
+ </FrameLayout>
+
+</LinearLayout>
diff --git a/samples/ApiDemos/res/layout-h420dp/resources_height.xml b/samples/ApiDemos/res/layout/resources_smallest_width_inner.xml
similarity index 67%
copy from samples/ApiDemos/res/layout-h420dp/resources_height.xml
copy to samples/ApiDemos/res/layout/resources_smallest_width_inner.xml
index 115a731..d956c45 100644
--- a/samples/ApiDemos/res/layout-h420dp/resources_height.xml
+++ b/samples/ApiDemos/res/layout/resources_smallest_width_inner.xml
@@ -22,22 +22,12 @@
<FrameLayout android:layout_width="match_parent" android:layout_height="0px"
android:layout_weight="1" android:padding="4dp"
android:background="#8000ff00">
- <include layout="@layout/resources_width" />
+ <include layout="@layout/resources_smallest_width_row" />
</FrameLayout>
<FrameLayout android:layout_width="match_parent" android:layout_height="0px"
android:layout_weight="1" android:padding="4dp"
android:background="#80ff0000">
- <include layout="@layout/resources_width" />
- </FrameLayout>
- <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
- android:layout_weight="1" android:padding="4dp"
- android:background="#8000ff00">
- <include layout="@layout/resources_width" />
- </FrameLayout>
- <FrameLayout android:layout_width="match_parent" android:layout_height="0px"
- android:layout_weight="1" android:padding="4dp"
- android:background="#80ff0000">
- <include layout="@layout/resources_width" />
+ <include layout="@layout/resources_smallest_width_row" />
</FrameLayout>
</LinearLayout>
</merge>
diff --git a/samples/ApiDemos/res/layout-w420dp/resources_width.xml b/samples/ApiDemos/res/layout/resources_smallest_width_row.xml
similarity index 63%
copy from samples/ApiDemos/res/layout-w420dp/resources_width.xml
copy to samples/ApiDemos/res/layout/resources_smallest_width_row.xml
index 1edffe3..a05a6e8 100644
--- a/samples/ApiDemos/res/layout-w420dp/resources_width.xml
+++ b/samples/ApiDemos/res/layout/resources_smallest_width_row.xml
@@ -22,22 +22,12 @@
<TextView android:layout_width="0px" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#1">
+ android:background="#800000ff" android:text="Default Width\n#1">
</TextView>
<TextView android:layout_width="0px" android:layout_height="match_parent"
android:layout_weight="1" android:gravity="center_horizontal"
android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#2">
- </TextView>
- <TextView android:layout_width="0px" android:layout_height="match_parent"
- android:layout_weight="1" android:gravity="center_horizontal"
- android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#3">
- </TextView>
- <TextView android:layout_width="0px" android:layout_height="match_parent"
- android:layout_weight="1" android:gravity="center_horizontal"
- android:layout_marginLeft="4dp" android:layout_marginRight="4dp"
- android:background="#800000ff" android:text="w420dp Width\n#4">
+ android:background="#800000ff" android:text="Default Width\n#2">
</TextView>
</LinearLayout>
</merge>
diff --git a/samples/ApiDemos/res/values-v13/bools.xml b/samples/ApiDemos/res/values-v13/bools.xml
index 1b8909f..0551c96 100644
--- a/samples/ApiDemos/res/values-v13/bools.xml
+++ b/samples/ApiDemos/res/values-v13/bools.xml
@@ -15,6 +15,6 @@
-->
<resources>
- <!-- True if running under Ice Cream Sandwich or later. -->
- <bool name="atLeastIceCreamSandwich">true</bool>
+ <!-- True if running under Honeycomb MR2 or later. -->
+ <bool name="atLeastHoneycombMR2">true</bool>
</resources>
diff --git a/samples/ApiDemos/res/values/bools.xml b/samples/ApiDemos/res/values/bools.xml
index cf85197..266c8ca 100644
--- a/samples/ApiDemos/res/values/bools.xml
+++ b/samples/ApiDemos/res/values/bools.xml
@@ -19,8 +19,8 @@
API level. The default value is false; an alternative value
for Honeycomb is true. -->
<bool name="atLeastHoneycomb">false</bool>
- <!-- This resource is true if running under at least Ice Cream Sandwich's
+ <!-- This resource is true if running under at least Honeycomb MR2's
API level. The default value is false; an alternative value
- for Ice Cream Sandwich is true. -->
- <bool name="atLeastIceCreamSandwich">false</bool>
+ for Honeycomb MR2 is true. -->
+ <bool name="atLeastHoneycombMR2">false</bool>
</resources>
diff --git a/samples/ApiDemos/res/values/strings.xml b/samples/ApiDemos/res/values/strings.xml
index d7858f0..10dd78d 100644
--- a/samples/ApiDemos/res/values/strings.xml
+++ b/samples/ApiDemos/res/values/strings.xml
@@ -356,6 +356,10 @@
<string name="resources_width_and_height_description">The layouts below use -wNNNdp and
-hNNNdp to select between different versions based on the size of the screen.</string>
+ <string name="activity_resources_smallest_width">Content/Resources/Smallest Width</string>
+ <string name="resources_smallest_width_description">The layouts below use -swNNNdp
+ to select between different versions based on the size of the screen.</string>
+
<string name="activity_read_asset">Content/Assets/Read Asset</string>
<string name="activity_themes">Content/Resources/Themes</string>
diff --git a/samples/ApiDemos/src/com/example/android/apis/content/ResourcesSmallestWidth.java b/samples/ApiDemos/src/com/example/android/apis/content/ResourcesSmallestWidth.java
new file mode 100644
index 0000000..9e2eeb9
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/content/ResourcesSmallestWidth.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * 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.
+ */
+
+package com.example.android.apis.content;
+
+import com.example.android.apis.R;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+public class ResourcesSmallestWidth extends Activity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ // This layout uses different configurations to adjust
+ // what is shown based on the smallest width that will occur.
+ setContentView(R.layout.resources_smallest_width);
+ }
+}
diff --git a/samples/ApiDemos/src/com/example/android/apis/content/ResourcesWidthAndHeight.java b/samples/ApiDemos/src/com/example/android/apis/content/ResourcesWidthAndHeight.java
index 6c64e95..c35d738 100644
--- a/samples/ApiDemos/src/com/example/android/apis/content/ResourcesWidthAndHeight.java
+++ b/samples/ApiDemos/src/com/example/android/apis/content/ResourcesWidthAndHeight.java
@@ -20,7 +20,6 @@
import android.app.Activity;
import android.os.Bundle;
-import android.widget.TextView;
public class ResourcesWidthAndHeight extends Activity {
@Override