OSDN Git Service

Merge "Import revised translations. DO NOT MERGE" into honeycomb-mr2
authorEric Fischer <enf@google.com>
Thu, 26 May 2011 18:37:50 +0000 (11:37 -0700)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Thu, 26 May 2011 18:37:50 +0000 (11:37 -0700)
19 files changed:
AndroidManifest.xml
res/layout-sw600dp-land/date_time_settings_setupwizard.xml [moved from res/layout-xlarge/date_time_settings_setupwizard.xml with 96% similarity]
res/layout-sw600dp-land/wifi_settings_for_setup_wizard_xl.xml [moved from res/layout-xlarge/wifi_settings_for_setup_wizard_xl.xml with 98% similarity]
res/layout-sw600dp/access_point_category_for_setup_wizard_xl.xml [moved from res/layout-xlarge/access_point_category_for_setup_wizard_xl.xml with 100% similarity]
res/layout-sw600dp/date_time_settings_setupwizard.xml [new file with mode: 0644]
res/layout-sw600dp/settings_top_level.xml [moved from res/layout-xlarge/settings_top_level.xml with 100% similarity]
res/layout-sw600dp/wifi_settings_for_setup_wizard_xl.xml [new file with mode: 0644]
res/layout/add_account_screen.xml
res/layout/installed_app_details.xml
res/layout/two_buttons_panel.xml
res/values-sw600dp-land/dimens.xml [new file with mode: 0755]
res/values-sw600dp/bools.xml [moved from res/values-xlarge/bools.xml with 100% similarity]
res/values-sw600dp/colors.xml [moved from res/values-xlarge/colors.xml with 100% similarity]
res/values-sw600dp/dimens.xml [new file with mode: 0755]
res/values-sw600dp/styles.xml [moved from res/values-xlarge/styles.xml with 100% similarity]
res/values-xlarge/dimens.xml [new file with mode: 0755]
res/values/strings.xml
src/com/android/settings/DateTimeSettingsSetupWizard.java
src/com/android/settings/applications/InstalledAppDetails.java

index 7879d0c..7e7bf1d 100644 (file)
                   android:theme="@android:style/Theme.Holo.NoActionBar"
                   android:windowBackground="@drawable/setups_bg_default"
                   android:clearTaskOnLaunch="true"
-                  android:screenOrientation="sensorLandscape"
                   android:windowSoftInputMode="adjustResize"
                   android:exported="true" />
 
     android:orientation="vertical"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:paddingTop="154dip"
-    android:paddingLeft="128dip"
-    android:paddingRight="128dip"
-    android:paddingBottom="96dip">
+    android:paddingTop="@dimen/datetime_margin_top"
+    android:paddingLeft="@dimen/screen_margin_sides"
+    android:paddingRight="@dimen/screen_margin_sides"
+    android:paddingBottom="@dimen/datetime_margin_bottom">
 
     <!-- Title: Set date & time-->
     <TextView
@@ -21,8 +21,8 @@
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:paddingTop="60dip"
-    android:paddingLeft="128dip"
-    android:paddingRight="128dip"
+    android:paddingLeft="@dimen/screen_margin_sides"
+    android:paddingRight="@dimen/screen_margin_sides"
     android:paddingBottom="0dip" >
 
     <FrameLayout
diff --git a/res/layout-sw600dp/date_time_settings_setupwizard.xml b/res/layout-sw600dp/date_time_settings_setupwizard.xml
new file mode 100644 (file)
index 0000000..b31462d
--- /dev/null
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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.
+  -->
+<RelativeLayout
+    android:id="@+id/layout_root"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:paddingTop="@dimen/datetime_margin_top"
+    android:paddingLeft="@dimen/screen_margin_sides"
+    android:paddingRight="@dimen/screen_margin_sides"
+    android:paddingBottom="@dimen/datetime_margin_bottom">
+
+    <!-- Title: Set date & time-->
+    <TextView
+        android:id="@+id/title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:minHeight="48dip"
+        android:layout_alignParentLeft="true"
+        android:layout_marginLeft="16dip"
+        android:layout_alignParentTop="true"
+        android:textSize="32dip"
+        android:textColor="#FF99cc00"
+        android:text="@string/date_and_time_settings_title_setup_wizard"
+        android:gravity="bottom" />
+
+    <!-- Divider -->
+    <View
+        android:id="@+id/top_divider"
+        android:layout_width="match_parent"
+        android:layout_height="3dip"
+        android:layout_below="@id/title"
+        android:layout_marginTop="6dip"
+        android:layout_marginBottom="17dip"
+        android:background="@color/divider_color" />
+
+    <RelativeLayout
+        android:id="@+id/timezone_auto_time"
+        android:layout_width="716dip"
+        android:layout_height="wrap_content"
+        android:layout_centerHorizontal="true"
+        android:layout_below="@id/top_divider">
+        <!-- timezone -->
+        <Button
+            android:id="@+id/time_zone_button"
+            style="?android:attr/dropDownSpinnerStyle"
+            android:layout_width="304dip"
+            android:layout_height="48dip"
+            android:layout_alignParentLeft="true"
+            android:layout_alignBottom="@+id/date_time_auto"
+            android:gravity="left|center_vertical"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:textSize="20dip" />
+
+        <LinearLayout
+            android:id="@+id/date_time_auto"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
+            android:layout_toRightOf="@id/time_zone_button"
+            android:layout_marginLeft="32dip"
+            android:layout_alignParentRight="true">
+
+            <Switch
+                android:id="@+id/date_time_auto_button"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:minHeight="?android:attr/listPreferredItemHeight"
+                android:layout_marginLeft="16dip"
+                android:text="@string/date_time_auto"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:textSize="20dip" />
+
+            <!-- Divider -->
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1px"
+                android:background="@color/divider_color" />
+        </LinearLayout>
+    </RelativeLayout>
+
+    <LinearLayout
+        android:layout_width="624dip"
+        android:layout_height="wrap_content"
+        android:layout_centerHorizontal="true"
+        android:layout_below="@+id/timezone_auto_time"
+        android:layout_marginTop="48dip"
+        android:orientation="horizontal">
+
+        <LinearLayout
+            android:layout_width="312dip"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+            <TextView
+                android:id="@+id/date_picker_title"
+                android:layout_width="match_parent"
+                android:layout_height="48dip"
+                android:text="@string/date_picker_title"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:textSize="20dip"
+                android:clickable="false"
+                android:longClickable="false"
+                android:gravity="center" />
+            <DatePicker
+                android:id="@+id/date_picker"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_below="@id/date_picker_title" />
+        </LinearLayout>
+
+        <!-- divider -->
+        <View
+            android:id="@+id/center_divider"
+            android:layout_width="1dip"
+            android:layout_height="match_parent"
+            android:background="@color/divider_color" />
+
+        <LinearLayout
+            android:layout_width="312dip"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+            <TextView
+                android:id="@+id/time_picker_title"
+                android:layout_width="match_parent"
+                android:layout_height="48dip"
+                android:text="@string/time_picker_title"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:textSize="20dip"
+                android:gravity="center" />
+
+            <TimePicker
+                android:id="@+id/time_picker"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_below="@id/time_picker_title" />
+        </LinearLayout>
+    </LinearLayout>
+
+    <View
+        android:id="@+id/bottom_divider"
+        android:layout_width="match_parent"
+        android:layout_height="3dip"
+        android:layout_alignLeft="@id/timezone_auto_time"
+        android:layout_above="@+id/next_button"
+        android:layout_marginBottom="16dip"
+        android:background="@color/divider_color" />
+
+    <Button
+        android:id="@+id/next_button"
+        style="@style/setup_wizard_button"
+        android:layout_alignParentBottom="true"
+        android:layout_alignParentRight="true"
+        android:text="@string/next_label" />
+</RelativeLayout>
diff --git a/res/layout-sw600dp/wifi_settings_for_setup_wizard_xl.xml b/res/layout-sw600dp/wifi_settings_for_setup_wizard_xl.xml
new file mode 100644 (file)
index 0000000..d6df897
--- /dev/null
@@ -0,0 +1,238 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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.
+  -->
+
+<RelativeLayout
+    android:id="@+id/layout_root"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="horizontal"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:paddingTop="60dip"
+    android:paddingLeft="@dimen/screen_margin_sides"
+    android:paddingRight="@dimen/screen_margin_sides"
+    android:paddingBottom="0dip" >
+
+    <FrameLayout
+        android:id="@+id/top_padding_layout"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentTop="true">
+        <!-- Set to gone when software keyboard appears -->
+        <View
+             android:id="@+id/top_padding"
+             android:layout_width="match_parent"
+             android:layout_height="94dip" />
+    </FrameLayout>
+
+    <TextView
+        android:id="@+id/wifi_setup_title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:minHeight="48dip"
+        android:layout_alignParentLeft="true"
+        android:layout_centerVertical="true"
+        android:layout_marginLeft="16dip"
+        android:layout_below="@id/top_padding_layout"
+        android:textSize="32dip"
+        android:textColor="#ff99cc00"
+        android:text="@string/wifi_setup_title"
+        android:gravity="bottom"/>
+
+    <!-- Divider -->
+    <FrameLayout
+        android:id="@+id/top_divider"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/wifi_setup_title">
+        <ProgressBar
+            android:id="@+id/scanning_progress_bar"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            style="?android:attr/progressBarStyleHorizontal" />
+        <View
+            android:id="@+id/top_divider_no_progress"
+            android:layout_width="match_parent"
+            android:layout_height="3dip"
+            android:layout_marginTop="6dip"
+            android:layout_marginBottom="0dip"
+            android:background="@color/divider_color"
+            android:visibility="gone" />
+    </FrameLayout>
+
+    <!-- Dummy view to have the left edge of following Views.
+         @id/content needs to have layout_width="match_parent" to accommodate
+         every views inside @id/wifi_config_ui while sometimes config ui becomes
+         very wide. -->
+    <View
+        android:id="@+id/dummy_for_left_edge"
+        android:layout_width="716dip"
+        android:layout_height="0dip"
+        android:layout_below="@id/top_divider"
+        android:layout_centerHorizontal="true" />
+
+    <RelativeLayout
+        android:id="@+id/content"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/top_divider"
+        android:layout_alignLeft="@id/dummy_for_left_edge"
+        android:layout_centerHorizontal="true">
+
+        <!-- Padding for @id/content shown when keyboard isn't available -->
+        <View
+            android:id="@+id/content_padding"
+            android:layout_width="match_parent"
+            android:layout_height="370dip"
+            android:visibility="gone" />
+
+        <FrameLayout
+            android:id="@+id/wifi_settings_fragment_layout"
+            android:layout_width="716dip"
+            android:layout_height="370dip">
+            <fragment
+                class="com.android.settings.wifi.WifiSettings"
+                android:id="@+id/wifi_setup_fragment"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content" />
+        </FrameLayout>
+        <FrameLayout
+            android:id="@+id/wifi_config_ui"
+            android:layout_width="wrap_content"
+            android:minWidth="406dip"
+            android:layout_height="wrap_content"
+            android:minHeight="160dip"
+            android:layout_marginTop="10dip"
+            android:layout_alignParentLeft="true"
+            android:visibility="gone" />
+        <LinearLayout
+            android:id="@+id/connecting_status_layout"
+            android:layout_width="716dip"
+            android:layout_height="360dip"
+            android:layout_marginTop="10dip"
+            android:visibility="gone">
+            <TextView
+                android:id="@+id/connecting_status"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:lineSpacingExtra="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:textSize="20sp" />
+        </LinearLayout>
+
+    </RelativeLayout>
+
+    <!-- Shown when @id/top_divider is using View instead of ProgressBar.
+         We need this padding to place @id/bottom_divider at the same position
+         regardless of @id/top_divider state.
+
+         Detail:
+         When ProgressBar is used in @id/top_divider, we have 7dip implicit
+         padding inside the ProgressBar object, while we don't have the
+         padding when View is used. As a result, all the objects below it
+         including @id/bottom_divider moves up/down in 7dip between those
+         two states. It is WAI for @id/content, but not for the others.
+
+         Note that we cannot let bottom dividers/buttons align with parent's
+         bottom edge using layout_alignParentBottom="true", since we'd like
+         to control bottom margin between @id/bottom_buttons and the edge
+         depending on software keyboard is shown/hidden.
+
+         We need to enclose @id/bottom_padding with @id/bottom_padding_layout
+         to let @id/bottom_divider use android:layout_below.
+         android:visibility="gone" really let the object go away,
+         causing @id/bottom_divider to lose the target for android:layout_below.
+      -->
+    <FrameLayout
+        android:id="@+id/bottom_padding_layout"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/content">
+        <View
+             android:id="@+id/bottom_padding"
+             android:layout_width="match_parent"
+             android:layout_height="7dip"
+             android:visibility="gone" />
+    </FrameLayout>
+
+    <!-- Divider -->
+    <View
+        android:id="@+id/bottom_divider"
+        android:layout_width="match_parent"
+        android:layout_height="3dip"
+        android:layout_marginBottom="16dip"
+        android:layout_below="@id/bottom_padding_layout"
+        android:layout_alignLeft="@id/content"
+        android:background="@color/divider_color" />  <!-- TODO: fix this -->
+
+    <LinearLayout
+        android:id="@+id/bottom_buttons"
+        android:orientation="vertical"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/bottom_divider"
+        android:layout_alignLeft="@id/bottom_divider">
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_below="@id/bottom_divider"
+            android:layout_alignLeft="@id/bottom_divider"
+            android:layout_alignParentRight="true"
+            android:layout_alignParentBottom="true">
+
+            <Button
+                android:id="@+id/wifi_setup_add_network"
+                style="@style/setup_wizard_button"
+                android:layout_alignParentLeft="true"
+                android:text="@string/wifi_setup_add_network"
+                android:enabled="false" />
+
+            <LinearLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignParentRight="true"
+                android:orientation="horizontal">
+
+                <!-- This misleading name is for keeping consistency between non-XL
+                     layouts -->
+                <Button android:id="@+id/wifi_setup_cancel"
+                        style="@style/setup_wizard_button"
+                        android:text="@string/wifi_setup_back"
+                        android:visibility="gone" />
+
+                <Button android:id="@+id/wifi_setup_connect"
+                        style="@style/setup_wizard_button"
+                        android:layout_marginLeft="16dip"
+                        android:text="@string/wifi_setup_connect"
+                        android:enabled="false"
+                        android:visibility="gone" />
+
+                <Button android:id="@+id/wifi_setup_skip_or_next"
+                        style="@style/setup_wizard_button"
+                        android:layout_marginLeft="16dip"
+                        android:text="@string/wifi_setup_skip" />
+            </LinearLayout>
+
+        </RelativeLayout>
+
+        <Button android:id="@+id/wifi_setup_refresh_list"
+                style="@style/setup_wizard_button"
+                android:layout_alignParentRight="true"
+                android:text="@string/wifi_setup_refresh_list"
+                android:enabled="false" />
+
+    </LinearLayout>
+</RelativeLayout>
index 67cb7aa..b6305a0 100644 (file)
@@ -20,7 +20,9 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:orientation="vertical">
+    android:orientation="vertical"
+    android:paddingLeft="16dip"
+    android:paddingRight="16dip">
 
     <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list"
         android:layout_width="match_parent"
index 0b68d47..6392ee9 100644 (file)
@@ -52,6 +52,7 @@
 
         <TextView
             style="?android:attr/listSeparatorTextViewStyle"
+            android:layout_marginTop="8dip"
             android:text="@string/storage_label" />
 
         <LinearLayout
             <TextView
                 android:id="@+id/cache_header"
                 style="?android:attr/listSeparatorTextViewStyle"
+                android:layout_marginTop="8dip"
                 android:text="@string/cache_header_label" />
             <LinearLayout
                 android:id="@+id/cache_size"
                 android:layout_alignParentRight="true"
                 android:layout_below="@id/cache_size"
                 android:layout_centerHorizontal="true"
-                android:layout_width="150dip"
+                android:layout_width="200dip"
                 android:text="@string/clear_cache_btn_text"
                 android:layout_height="wrap_content" />
         </RelativeLayout>
         <!-- Prefered activities section -->
         <TextView
             style="?android:attr/listSeparatorTextViewStyle"
+            android:layout_marginTop="8dip"
             android:text="@string/auto_launch_label" />
 
         <RelativeLayout 
                 android:layout_alignParentRight="true"
                 android:layout_below="@id/auto_launch"
                 android:layout_centerHorizontal="true"
-                android:layout_width="150dip"
+                android:layout_width="200dip"
                 android:text="@string/clear_activities"
                 android:layout_height="wrap_content" />
         </RelativeLayout>
 
+        <!-- Screen compatibility section -->
+        <LinearLayout android:id="@+id/screen_compatibility_section"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical">
+            <TextView
+                style="?android:attr/listSeparatorTextViewStyle"
+                android:layout_marginTop="8dip"
+                android:text="@string/screen_compatibility_label" />
+
+            <TextView android:textAppearance="?android:attr/textAppearanceSmall"
+                android:layout_alignParentLeft="true"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:paddingTop="6dip"
+                android:paddingRight="6dip"
+                android:paddingLeft="6dip"
+                android:text="@string/screen_compatibility_text"/>
+            <CheckBox android:id="@+id/ask_compatibility_cb"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="12dip"
+                android:layout_gravity="left"
+                android:text="@string/ask_compatibility" />
+            <CheckBox android:id="@+id/enable_compatibility_cb"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="12dip"
+                android:layout_gravity="left"
+                android:text="@string/enable_compatibility" />
+        </LinearLayout>
+
         <!-- Permissions section -->
         <LinearLayout
             android:id="@+id/permissions_section"
             android:orientation="vertical">
             <TextView
                 style="?android:attr/listSeparatorTextViewStyle"
+                android:layout_marginTop="8dip"
                 android:text="@string/permissions_label" />
             <TextView
                 android:text="@string/security_settings_desc"
index d76855c..05ad35d 100755 (executable)
@@ -39,7 +39,7 @@
             android:id="@+id/buttons_spacer_left"
             android:layout_width="0dip"
             android:layout_height="wrap_content"
-            android:visibility="gone"
+            android:visibility="invisible"
             android:layout_weight="0.2" />
         <Button
             android:id="@+id/right_button"
diff --git a/res/values-sw600dp-land/dimens.xml b/res/values-sw600dp-land/dimens.xml
new file mode 100755 (executable)
index 0000000..9bd2336
--- /dev/null
@@ -0,0 +1,19 @@
+<?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.
+-->
+
+<resources>
+    <dimen name="screen_margin_sides">128dip</dimen>
+</resources>
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
new file mode 100755 (executable)
index 0000000..bc9f18d
--- /dev/null
@@ -0,0 +1,21 @@
+<?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.
+-->
+
+<resources>
+    <dimen name="screen_margin_sides">40dip</dimen>
+    <dimen name="datetime_margin_top">40dip</dimen>
+    <dimen name="datetime_margin_bottom">40dip</dimen>
+</resources>
diff --git a/res/values-xlarge/dimens.xml b/res/values-xlarge/dimens.xml
new file mode 100755 (executable)
index 0000000..b6b4591
--- /dev/null
@@ -0,0 +1,21 @@
+<?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.
+-->
+
+<resources>
+    <dimen name="screen_margin_sides">128dip</dimen>
+    <dimen name="datetime_margin_top">154dip</dimen>
+    <dimen name="datetime_margin_bottom">96dip</dimen>
+</resources>
index bb9360d..03b4a05 100644 (file)
     <string name="storage_label">Storage</string>
     <!-- Manage applications, individual application info screen,  heading for settings related to controlling whether this app is the default for some actions -->
     <string name="auto_launch_label">Launch by default</string>
+    <!-- Manage applications, individual application info screen,  heading for settings related to controlling application screen compatibility -->
+    <string name="screen_compatibility_label">Screen compatibility</string>
     <!-- Manage applications, individual application info screen, heading for settings related to the app's permissions. for example, it may list all the permissions the app has. -->
     <string name="permissions_label">Permissions</string>
     <!-- Manage applications, Header name used for cache information -->
     <string name="auto_launch_disable_text">No defaults set.</string>
     <!-- Manage applications, individual application screen, button label under Launch by default heading.  This is used to clear any default actions that may be assigned to this app.  -->
     <string name="clear_activities">Clear defaults</string>
+    <!-- Manage applications, individual application info screen, screen, message text under screen compatibility heading -->
+    <string name="screen_compatibility_text">This application may not be designed for your screen; you can control how it
+            adjusts to your screen here.</string>
+    <!-- Manage applications, individual application screen, checkbox to control asking for compatibility mode.  -->
+    <string name="ask_compatibility">Ask when launched</string>
+    <!-- Manage applications, individual application screen, checkbox to control compatibility mode.  -->
+    <string name="enable_compatibility">Scale application</string>
     <!-- Manage apps, individual app screen, substituted for the application's label when the app's label CAN NOT be determined.-->
     <string name="unknown">Unknown</string>
     <!-- [CHAR LIMIT=25] Manage applications screen, menu item.  Sorts all of the apps in the list alphabetically. -->
index ec9c2af..670fcbc 100644 (file)
@@ -76,7 +76,7 @@ public class DateTimeSettingsSetupWizard extends Activity
         setContentView(R.layout.date_time_settings_setupwizard);
         mXLargeScreenSize = (getResources().getConfiguration().screenLayout
                 & Configuration.SCREENLAYOUT_SIZE_MASK)
-                == Configuration.SCREENLAYOUT_SIZE_XLARGE;
+                >= Configuration.SCREENLAYOUT_SIZE_LARGE;
         if (mXLargeScreenSize) {
             initUiForXl();
         } else {
index ae27d00..a0a568b 100644 (file)
@@ -60,6 +60,8 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AppSecurityPermissions;
 import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
@@ -74,7 +76,8 @@ import android.widget.TextView;
  * uninstall the application.
  */
 public class InstalledAppDetails extends Fragment
-        implements View.OnClickListener, ApplicationsState.Callbacks {
+        implements View.OnClickListener, CompoundButton.OnCheckedChangeListener,
+        ApplicationsState.Callbacks {
     private static final String TAG="InstalledAppDetails";
     static final boolean SUPPORT_DISABLE_APPS = false;
     private static final boolean localLOGV = false;
@@ -92,6 +95,9 @@ public class InstalledAppDetails extends Fragment
     private boolean mMoveInProgress = false;
     private boolean mUpdatedSysApp = false;
     private Button mActivitiesButton;
+    private View mScreenCompatSection;
+    private CheckBox mAskCompatibilityCB;
+    private CheckBox mEnableCompatibilityCB;
     private boolean mCanClearData = true;
     private TextView mAppVersion;
     private TextView mTotalSize;
@@ -345,6 +351,11 @@ public class InstalledAppDetails extends Fragment
 
         mActivitiesButton = (Button)view.findViewById(R.id.clear_activities_button);
         
+        // Screen compatibility control
+        mScreenCompatSection = view.findViewById(R.id.screen_compatibility_section);
+        mAskCompatibilityCB = (CheckBox)view.findViewById(R.id.ask_compatibility_cb);
+        mEnableCompatibilityCB = (CheckBox)view.findViewById(R.id.enable_compatibility_cb);
+
         return view;
     }
 
@@ -466,7 +477,22 @@ public class InstalledAppDetails extends Fragment
             mActivitiesButton.setEnabled(true);
             mActivitiesButton.setOnClickListener(this);
         }
-         
+
+        // Screen compatibility section.
+        ActivityManager am = (ActivityManager)
+                getActivity().getSystemService(Context.ACTIVITY_SERVICE);
+        int compatMode = am.getPackageScreenCompatMode(packageName);
+        if (compatMode == ActivityManager.COMPAT_MODE_DISABLED
+                || compatMode == ActivityManager.COMPAT_MODE_ENABLED) {
+            mScreenCompatSection.setVisibility(View.VISIBLE);
+            mAskCompatibilityCB.setChecked(am.getPackageAskScreenCompat(packageName));
+            mAskCompatibilityCB.setOnCheckedChangeListener(this);
+            mEnableCompatibilityCB.setChecked(compatMode == ActivityManager.COMPAT_MODE_ENABLED);
+            mEnableCompatibilityCB.setOnCheckedChangeListener(this);
+        } else {
+            mScreenCompatSection.setVisibility(View.GONE);
+        }
+
         // Security permissions section
         LinearLayout permsView = (LinearLayout) mRootView.findViewById(R.id.permissions_section);
         AppSecurityPermissions asp = new AppSecurityPermissions(getActivity(), packageName);
@@ -846,5 +872,18 @@ public class InstalledAppDetails extends Fragment
             mPm.movePackage(mAppEntry.info.packageName, mPackageMoveObserver, moveFlags);
         }
     }
+
+    @Override
+    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+        String packageName = mAppEntry.info.packageName;
+        ActivityManager am = (ActivityManager)
+                getActivity().getSystemService(Context.ACTIVITY_SERVICE);
+        if (buttonView == mAskCompatibilityCB) {
+            am.setPackageAskScreenCompat(packageName, isChecked);
+        } else if (buttonView == mEnableCompatibilityCB) {
+            am.setPackageScreenCompatMode(packageName, isChecked ?
+                    ActivityManager.COMPAT_MODE_ENABLED : ActivityManager.COMPAT_MODE_DISABLED);
+        }
+    }
 }