OSDN Git Service

Fix froyo pin crash
authorKoushik Dutta <koushd@gmail.com>
Mon, 4 Mar 2013 22:49:28 +0000 (14:49 -0800)
committerKoushik Dutta <koushd@gmail.com>
Mon, 4 Mar 2013 22:49:28 +0000 (14:49 -0800)
Change-Id: Ibe36dad36c4b688dcc9162c141646adede052ef3

Superuser/res/layout/pin.xml
Superuser/res/values-v14/styles.xml
Superuser/res/values/styles.xml
Superuser/src/com/koushikdutta/superuser/SettingsFragmentInternal.java

index 9b7350b..041b7e8 100644 (file)
@@ -2,7 +2,11 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical" >
-
+<LinearLayout
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical" >
+    
     <EditText
         android:id="@+id/password"
         style="@android:style/TextAppearance.Large"
             android:text="@android:string/ok" />
     </LinearLayout>
 
+</LinearLayout>
 </LinearLayout>
\ No newline at end of file
index deae508..31754ed 100644 (file)
@@ -4,5 +4,9 @@
         <item name="android:background">?android:attr/selectableItemBackground</item>
         <item name="android:textColor">?attr/bottomButtonBarText</item>
     </style>
+    
 
+    <style name="PinButton" parent="PinButtonBase">
+        <item name="android:background">?android:attr/selectableItemBackground</item>
+    </style>
 </resources>
\ No newline at end of file
index 429347b..e66ce5a 100644 (file)
@@ -6,13 +6,15 @@
 
     <color name="background_dark">#1F1F1F</color>
 
-    <style name="PinButton" parent="@android:style/TextAppearance.Large">
+    <style name="PinButtonBase" parent="@android:style/TextAppearance.Large">
         <item name="android:layout_width">0dp</item>
         <item name="android:layout_height">64dp</item>
         <item name="android:layout_weight">1</item>
-        <item name="android:background">?android:attr/selectableItemBackground</item>
     </style>
 
+    <style name="PinButton" parent="PinButtonBase">
+    </style>
+    
     <style name="SuperuserDark" parent="@style/AppDarkTheme">
         <item name="bottomButtonBar">@null</item>
         <item name="bottomButtonBarText">?android:attr/textColorPrimary</item>
index 0e05d85..4964950 100644 (file)
@@ -25,6 +25,8 @@ import android.content.DialogInterface.OnClickListener;
 import android.os.Bundle;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewGroup.LayoutParams;
 import android.widget.Toast;
 
 import com.koushikdutta.superuser.util.Settings;
@@ -65,7 +67,8 @@ public class SettingsFragmentInternal extends BetterListFragmentInternal {
                 super.onCancel();
                 d.dismiss();
             };
-        }.getView());
+        }.getView(), new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
+        d.getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
         d.show();
     }
     
@@ -84,6 +87,7 @@ public class SettingsFragmentInternal extends BetterListFragmentInternal {
                 d.dismiss();
             };
         }.getView());
+        d.getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
         d.show();
     }
 
@@ -107,7 +111,8 @@ public class SettingsFragmentInternal extends BetterListFragmentInternal {
                     super.onCancel();
                     d.dismiss();
                 };
-            }.getView());
+            }.getView(), new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
+            d.getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
             d.show();
         }
         else {