OSDN Git Service

Fix bug 3378333 - Holo-style layout for granting permissions
authorAdam Powell <adamp@google.com>
Sat, 22 Jan 2011 22:34:13 +0000 (14:34 -0800)
committerAdam Powell <adamp@google.com>
Tue, 25 Jan 2011 21:34:28 +0000 (13:34 -0800)
Change-Id: Ie1bb925db3ddd8343c9756e220a0d821f4d31c6d

core/java/android/accounts/GrantCredentialsPermissionActivity.java
core/res/AndroidManifest.xml
core/res/res/layout/grant_credentials_permission.xml

index 83e4fd9..89eee6d 100644 (file)
@@ -51,9 +51,9 @@ public class GrantCredentialsPermissionActivity extends Activity implements View
     private final AccountManagerService accountManagerService = AccountManagerService.getSingleton();
 
     protected void onCreate(Bundle savedInstanceState) {
-        requestWindowFeature(Window.FEATURE_NO_TITLE);
         super.onCreate(savedInstanceState);
         setContentView(R.layout.grant_credentials_permission);
+        setTitle(R.string.grant_permissions_header_text);
 
         mInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
 
index 25d3aca..bd0cd35 100644 (file)
 
         <activity android:name="android.accounts.GrantCredentialsPermissionActivity"
                 android:excludeFromRecents="true"
-                android:exported="true">
+                android:exported="true"
+                android:theme="@android:style/Theme.Holo.DialogWhenLarge">
         </activity>
 
         <activity android:name="android.content.SyncActivityTooManyDeletes"
index 0ffe8de..8b18454 100644 (file)
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <!-- The header -->
-    <TextView
-        android:id="@+id/header_text"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:textColor="@color/white"
-        android:textStyle="bold"
-        android:text="@string/grant_permissions_header_text"
-        android:shadowColor="@color/shadow"
-        android:shadowRadius="2"
-        android:singleLine="true"
-        android:background="@drawable/title_bar_medium"
-        android:gravity="left|center_vertical"
-       android:paddingLeft="19dip"
-        android:ellipsize="marquee" />
+    android:layout_height="match_parent"
+    android:divider="?android:attr/dividerHorizontal"
+    android:showDividers="middle"
+    android:dividerPadding="16dip" >
 
     <!-- The list of packages that correspond to the requesting UID
     and the account/authtokenType that is being requested -->
     <LinearLayout
         android:id="@+id/buttons"
         android:layout_width="match_parent"
-        android:layout_height="52dip"
-        android:background="@drawable/bottom_bar"
-        android:paddingTop="4dip"
-        android:paddingLeft="2dip"
-        android:paddingRight="2dip">
+        android:layout_height="54dip"
+        style="?android:attr/buttonBarStyle">
 
         <Button
             android:id="@+id/allow_button"
             android:text="@string/allow"
             android:layout_width="0dip"
             android:layout_height="wrap_content"
-            android:layout_weight="2" />
+            android:layout_weight="2"
+            style="?android:attr/buttonBarButtonStyle" />
 
         <Button
             android:id="@+id/deny_button"
             android:text="@string/deny"
             android:layout_width="0dip"
             android:layout_height="wrap_content"
-            android:layout_weight="2" />
+            android:layout_weight="2"
+            style="?android:attr/buttonBarButtonStyle" />
 
     </LinearLayout>
 </LinearLayout>