am 193d98ec: Add new API demo for -swNNNdp resource qualifier.
* commit '193d98ec183f4a3e137b8d0c5e20529819e1eef2': Add new API demo for -swNNNdp resource qualifier.
This commit is contained in:
@@ -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" />
|
||||
|
||||
@@ -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>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?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>
|
||||
</LinearLayout>
|
||||
</merge>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?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>
|
||||
</LinearLayout>
|
||||
</merge>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?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="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="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="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="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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
53
samples/ApiDemos/res/layout-w600dp/resources_width.xml
Normal file
53
samples/ApiDemos/res/layout-w600dp/resources_width.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?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="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="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="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="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>
|
||||
35
samples/ApiDemos/res/layout/resources_smallest_width.xml
Normal file
35
samples/ApiDemos/res/layout/resources_smallest_width.xml
Normal file
@@ -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>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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>
|
||||
</LinearLayout>
|
||||
</merge>
|
||||
33
samples/ApiDemos/res/layout/resources_smallest_width_row.xml
Normal file
33
samples/ApiDemos/res/layout/resources_smallest_width_row.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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="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="Default Width\n#2">
|
||||
</TextView>
|
||||
</LinearLayout>
|
||||
</merge>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,6 @@ import com.example.android.apis.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class ResourcesWidthAndHeight extends Activity {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user