summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2011-01-10 11:38:08 -0800
committerKenny Root <kroot@google.com>2011-01-10 13:20:54 -0800
commit9fb403beef24339913ce0e0d545a83fd102caf5b (patch)
treee6a9577741abab68644dae439f5386b552f9fa30
parent2244205c4fdda49f0ff6f2e16f4cbb6678e20c48 (diff)
downloadandroid_packages_apps_PackageInstaller-9fb403beef24339913ce0e0d545a83fd102caf5b.tar.gz
android_packages_apps_PackageInstaller-9fb403beef24339913ce0e0d545a83fd102caf5b.tar.bz2
android_packages_apps_PackageInstaller-9fb403beef24339913ce0e0d545a83fd102caf5b.zip
Change theme to DialogWhenLarge
Fix some layouts to correctly display as dialogs when using a large screen device. Still needs the WeightedLinearLayout trick. Bug: 3298362 Change-Id: I76ad192ca8c27a0d9f4ce106dc4e1e922c01c02b
-rw-r--r--AndroidManifest.xml3
-rwxr-xr-xres/layout/install_confirm.xml136
-rwxr-xr-xres/layout/op_progress.xml87
-rwxr-xr-xres/layout/uninstall_confirm.xml80
-rwxr-xr-xres/layout/uninstall_progress.xml89
-rwxr-xr-xres/values/styles.xml22
6 files changed, 278 insertions, 139 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index a514af66..d8ab8187 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -9,7 +9,8 @@
<uses-permission android:name="android.permission.CLEAR_APP_CACHE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CLEAR_APP_USER_DATA" />
- <application android:label="@string/app_name">
+ <application android:label="@string/app_name"
+ android:theme="@android:style/Theme.Holo.DialogWhenLarge">
<activity android:name=".PackageInstallerActivity"
android:configChanges="orientation|keyboardHidden"
android:excludeFromRecents="true">
diff --git a/res/layout/install_confirm.xml b/res/layout/install_confirm.xml
index 268a744e..026116c1 100755
--- a/res/layout/install_confirm.xml
+++ b/res/layout/install_confirm.xml
@@ -22,73 +22,107 @@
-->
<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_weight="1"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/padded"
+ android:orientation="vertical"
+ android:layout_weight="1"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
<TextView
- android:id="@+id/install_confirm_question"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/install_confirm_question"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:paddingTop="20dip"
- android:paddingLeft="20dip"
- android:paddingBottom="20dip"/>
+ android:id="@+id/install_confirm_question"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/install_confirm_question"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:paddingTop="16dip"
+ android:paddingLeft="16dip"
+ android:paddingBottom="16dip"/>
<ScrollView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:fillViewport="true"
- android:layout_weight="1">
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:fillViewport="true"
+ android:layout_weight="1">
<!-- Security settings description. -->
<LinearLayout
- android:id="@+id/permissions_section"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginRight = "2dip"
- android:orientation="vertical">
- <TextView
- android:id="@+id/security_settings_desc"
- android:text="@string/security_settings_desc"
- android:layout_width="wrap_content"
+ android:id="@+id/permissions_section"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:paddingTop="20dip"
- android:paddingLeft="20dip"
- android:paddingBottom="20dip"/>
+ android:layout_marginRight = "2dip"
+ android:orientation="vertical">
+ <TextView
+ android:id="@+id/security_settings_desc"
+ android:text="@string/security_settings_desc"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:paddingTop="20dip"
+ android:paddingLeft="20dip"
+ android:paddingBottom="20dip"/>
<LinearLayout
- android:id="@+id/security_settings_list"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_weight="1.0"
- android:orientation="vertical"/>
+ android:id="@+id/security_settings_list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1.0"
+ android:orientation="vertical"/>
</LinearLayout>
</ScrollView>
<!-- OK confirm and cancel buttons. -->
<LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- style="@android:style/ButtonBar"
- >
- <Button android:id="@+id/ok_button"
- android:layout_width="0dip"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:text="@string/install"
- />
+ android:minHeight="54dip"
+ android:orientation="vertical"
+ android:divider="?android:attr/dividerHorizontal"
+ android:showDividers="beginning"
+ android:dividerPadding="16dip"
+ android:paddingTop="16dip">
- <Button android:id="@+id/cancel_button"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:text="@string/cancel"
- />
+ <LinearLayout
+ style="?android:attr/buttonBarStyle"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:paddingLeft="2dip"
+ android:paddingRight="2dip"
+ android:measureWithLargestChild="true">
+
+ <LinearLayout android:id="@+id/leftSpacer"
+ android:layout_weight="0.25"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone" />
+
+ <Button android:id="@+id/ok_button"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_gravity="left"
+ android:layout_weight="1"
+ android:text="@string/install"
+ android:maxLines="2"
+ style="?android:attr/buttonBarButtonStyle" />
+
+ <Button android:id="@+id/cancel_button"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_gravity="right"
+ android:layout_weight="1"
+ android:text="@string/cancel"
+ android:maxLines="2"
+ style="?android:attr/buttonBarButtonStyle" />
+
+ <LinearLayout android:id="@+id/rightSpacer"
+ android:layout_width="0dip"
+ android:layout_weight="0.25"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone" />
+
+ </LinearLayout>
</LinearLayout>
</LinearLayout>
diff --git a/res/layout/op_progress.xml b/res/layout/op_progress.xml
index 9fe2d0be..3b410523 100755
--- a/res/layout/op_progress.xml
+++ b/res/layout/op_progress.xml
@@ -14,27 +14,27 @@
limitations under the License.
-->
-<ScrollView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:fillViewport="true">
- <RelativeLayout
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/padded"
android:layout_width="match_parent"
- android:layout_height="match_parent">
- <include
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="vertical">
+ <include
layout="@layout/app_details"
android:id="@+id/app_snippet"/>
- <TextView
+ <TextView
android:id="@+id/center_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/installing"
+ android:paddingTop="16dip"
android:paddingLeft="16dip"
+ android:paddingBottom="16dip"
android:textAppearance="?android:attr/textAppearanceMedium"/>
- <ProgressBar
+ <ProgressBar
android:id="@+id/progress_bar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
@@ -42,32 +42,63 @@
android:paddingTop="24dip"
android:paddingLeft="16dip"
android:paddingRight="16dip"
- android:layout_below="@id/center_text"
android:max="100" />
- <!-- Launch and close buttons. -->
- <LinearLayout android:id="@+id/buttons_panel"
+ <!-- Launch and close buttons. -->
+ <LinearLayout android:id="@+id/buttons_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
- android:orientation="horizontal"
- style="@android:style/ButtonBar"
- >
- <Button android:id="@+id/launch_button"
- android:layout_width="0dip"
+ android:minHeight="54dip"
+ android:orientation="vertical"
+ android:divider="?android:attr/dividerHorizontal"
+ android:showDividers="beginning"
+ android:dividerPadding="16dip"
+ android:paddingTop="16dip">
+
+ <LinearLayout
+ style="?android:attr/buttonBarStyle"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:text="@string/launch"
- />
+ android:orientation="horizontal"
+ android:paddingLeft="2dip"
+ android:paddingRight="2dip"
+ android:measureWithLargestChild="true">
+
+ <LinearLayout android:id="@+id/leftSpacer"
+ android:layout_weight="0.25"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone" />
+
+ <Button android:id="@+id/launch_button"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_gravity="left"
+ android:layout_weight="1"
+ android:text="@string/launch"
+ android:maxLines="2"
+ style="?android:attr/buttonBarButtonStyle" />
<Button android:id="@+id/done_button"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:text="@string/done"
- />
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_gravity="right"
+ android:layout_weight="1"
+ android:text="@string/done"
+ android:maxLines="2"
+ style="?android:attr/buttonBarButtonStyle" />
+
+ <LinearLayout android:id="@+id/rightSpacer"
+ android:layout_width="0dip"
+ android:layout_weight="0.25"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone" />
+
</LinearLayout>
- </RelativeLayout>
-</ScrollView>
+ </LinearLayout>
+</LinearLayout>
diff --git a/res/layout/uninstall_confirm.xml b/res/layout/uninstall_confirm.xml
index 78cd64be..4b273964 100755
--- a/res/layout/uninstall_confirm.xml
+++ b/res/layout/uninstall_confirm.xml
@@ -21,14 +21,16 @@
to let the uinstallation continue or abort.
-->
-<RelativeLayout
+<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/padded"
+ android:orientation="vertical"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:orientation="vertical"
android:paddingTop="6dip"
@@ -60,30 +62,62 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:paddingTop="16dip"
android:paddingLeft="6dip"
- android:paddingRight="6dip" />
+ android:paddingRight="6dip"
+ android:paddingBottom="16dip" />
- </LinearLayout>
+ </LinearLayout>
<!-- OK confirm and cancel buttons. -->
<LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:orientation="horizontal"
- style="@android:style/ButtonBar"
- >
- <Button android:id="@+id/ok_button"
- android:layout_width="0dip"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:text="@string/ok"
- />
+ android:minHeight="54dip"
+ android:orientation="vertical"
+ android:divider="?android:attr/dividerHorizontal"
+ android:showDividers="beginning"
+ android:dividerPadding="16dip">
- <Button android:id="@+id/cancel_button"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:text="@string/cancel"
- />
+ <LinearLayout
+ style="?android:attr/buttonBarStyle"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:paddingLeft="2dip"
+ android:paddingRight="2dip"
+ android:measureWithLargestChild="true">
+
+ <LinearLayout android:id="@+id/leftSpacer"
+ android:layout_weight="0.25"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone" />
+
+ <Button android:id="@+id/ok_button"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_gravity="left"
+ android:layout_weight="1"
+ android:text="@string/ok"
+ android:maxLines="2"
+ style="?android:attr/buttonBarButtonStyle" />
+
+ <Button android:id="@+id/cancel_button"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_gravity="right"
+ android:layout_weight="1"
+ android:text="@string/cancel"
+ android:maxLines="2"
+ style="?android:attr/buttonBarButtonStyle" />
+
+ <LinearLayout android:id="@+id/rightSpacer"
+ android:layout_width="0dip"
+ android:layout_weight="0.25"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone" />
+
+ </LinearLayout>
</LinearLayout>
-</RelativeLayout>
+</LinearLayout>
diff --git a/res/layout/uninstall_progress.xml b/res/layout/uninstall_progress.xml
index 86204e30..394d1fd3 100755
--- a/res/layout/uninstall_progress.xml
+++ b/res/layout/uninstall_progress.xml
@@ -14,62 +14,79 @@
limitations under the License.
-->
-<ScrollView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:fillViewport="true" >
- <RelativeLayout
- android:orientation="vertical"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/padded"
android:layout_width="match_parent"
- android:layout_height="match_parent">
- <include
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="vertical">
+ <include
layout="@layout/app_details"
android:id="@+id/app_snippet"/>
- <TextView
+ <TextView
android:id="@+id/center_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
+ android:paddingTop="16dip"
+ android:paddingLeft="16dip"
+ android:paddingBottom="16dip"
android:textAppearance="?android:attr/textAppearanceMedium" />
- <ProgressBar
+ <ProgressBar
android:id="@+id/progress_bar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="24dip"
- android:layout_below="@id/center_text"
+ android:paddingLeft="16dip"
+ android:paddingRight="16dip"
android:max="100" />
- <!-- Button bar with OK button -->
- <LinearLayout android:id="@+id/ok_panel"
+ <!-- Button bar with OK button -->
+ <LinearLayout android:id="@+id/ok_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
- android:orientation="horizontal"
- style="@android:style/ButtonBar"
- >
- <!-- Left spacer -->
- <View
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- />
+ android:minHeight="54dip"
+ android:orientation="vertical"
+ android:divider="?android:attr/dividerHorizontal"
+ android:showDividers="beginning"
+ android:dividerPadding="16dip"
+ android:paddingTop="16dip">
- <Button android:id="@+id/ok_button"
- android:layout_width="0dip"
+ <LinearLayout
+ style="?android:attr/buttonBarStyle"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_weight="2"
- android:text="@string/ok"
- />
+ android:orientation="horizontal"
+ android:paddingLeft="2dip"
+ android:paddingRight="2dip"
+ android:measureWithLargestChild="true">
+
+ <LinearLayout android:id="@+id/leftSpacer"
+ android:layout_weight="0.5"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone" />
+
+ <Button android:id="@+id/ok_button"
+ android:layout_width="0dip"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_weight="1"
+ android:text="@string/ok"
+ android:maxLines="2"
+ style="?android:attr/buttonBarButtonStyle" />
+
+ <LinearLayout android:id="@+id/rightSpacer"
+ android:layout_width="0dip"
+ android:layout_weight="0.5"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:visibility="gone" />
- <!-- Right spacer -->
- <View
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- />
</LinearLayout>
- </RelativeLayout>
-</ScrollView>
+ </LinearLayout>
+</LinearLayout>
diff --git a/res/values/styles.xml b/res/values/styles.xml
new file mode 100755
index 00000000..f03a37e2
--- /dev/null
+++ b/res/values/styles.xml
@@ -0,0 +1,22 @@
+<?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.
+-->
+
+<resources>
+ <style name="padded">
+ <item name="android:paddingLeft">16dip</item>
+ <item name="android:paddingRight">16dip</item>
+ </style>
+</resources>