OSDN Git Service

more cleanups. TODO: whitelist/blacklist db. TODO: logs.
authorKoushik Dutta <koushd@gmail.com>
Sun, 17 Feb 2013 19:57:40 +0000 (11:57 -0800)
committerKoushik Dutta <koushd@gmail.com>
Sun, 17 Feb 2013 19:57:40 +0000 (11:57 -0800)
Superuser/AndroidManifest.xml
Superuser/gen/com/koushikdutta/superuser/R.java
Superuser/res/layout/activity_main.xml
Superuser/res/values-v11/styles.xml
Superuser/res/values-v14/styles.xml
Superuser/res/values/styles.xml
Superuser/src/com/koushikdutta/superuser/MainActivity.java

index 55f046b..7648ccc 100644 (file)
@@ -32,7 +32,7 @@
             </intent-filter>
         </activity>
 
-        <activity android:name="com.koushikdutta.superuser.MultitaskSuRequestActivity" android:theme="@style/Dialog"  android:label="@string/request" />
+        <activity android:name="com.koushikdutta.superuser.MultitaskSuRequestActivity" android:theme="@style/AppTheme"  android:label="@string/request" />
 
         <receiver
             android:name=".SuReceiver"
index 7b1b4f7..a408ef0 100644 (file)
@@ -62,6 +62,10 @@ public final class R {
         public static final int unknown_uid=0x7f050004;
     }
     public static final class style {
+        /**  API 14 theme customizations can go here. 
+ API 14 theme customizations can go here. 
+         */
+        public static final int AppBaseDarkTheme=0x7f060002;
         /** 
         Base application theme, dependent on API level. This theme is replaced
         by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
@@ -87,8 +91,12 @@ public final class R {
         /**  Application theme. 
  All customizations that are NOT specific to a particular API-level can go here. 
          */
+        public static final int AppDarkTheme=0x7f060003;
+        /**  Application theme. 
+ All customizations that are NOT specific to a particular API-level can go here. 
+         */
         public static final int AppTheme=0x7f060001;
-        public static final int Dialog=0x7f060003;
-        public static final int FlatButton=0x7f060002;
+        public static final int Dialog=0x7f060005;
+        public static final int FlatButton=0x7f060004;
     }
 }
index 189005d..a68bb7e 100644 (file)
                     android:textStyle="bold" />
 
                 <TextView
-                    android:singleLine="true"
                     android:id="@+id/app_header"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_weight="2" />
+                    android:layout_weight="2"
+                    android:singleLine="true" />
             </LinearLayout>
 
             <LinearLayout
                     android:textStyle="bold" />
 
                 <TextView
-                    android:singleLine="true"
                     android:id="@+id/package_header"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_weight="2" />
+                    android:layout_weight="2"
+                    android:singleLine="true" />
             </LinearLayout>
 
             <LinearLayout
                     android:textStyle="bold" />
 
                 <TextView
-                    android:singleLine="true"
                     android:id="@+id/uid_header"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_weight="2" />
+                    android:layout_weight="2"
+                    android:singleLine="true" />
             </LinearLayout>
 
             <LinearLayout
                     android:textStyle="bold" />
 
                 <TextView
-                    android:singleLine="true"
-                    android:ellipsize="middle"
                     android:id="@+id/command_header"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_weight="2" />
+                    android:layout_weight="2"
+                    android:ellipsize="middle"
+                    android:singleLine="true" />
             </LinearLayout>
 
             <ListView
                 android:layout_gravity="center"
                 android:gravity="center" />
 
-            <CheckBox
-                android:gravity="center_horizontal"
-                android:id="@+id/always_allow"
-                style="@android:style/TextAppearance.Medium"
-                android:layout_width="match_parent"
+            <LinearLayout
+                android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:paddingBottom="10dp"
-                android:text="@string/always_allow" />
+                android:layout_gravity="center"
+                android:orientation="vertical" >
 
-            <CheckBox
-                android:gravity="center_horizontal"
-                android:id="@+id/allow_temporarily"
-                style="@android:style/TextAppearance.Medium"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:paddingBottom="10dp"
-                android:text="@string/allow_temporarily" />
+                <CheckBox
+                    android:id="@+id/always_allow"
+                    style="@android:style/TextAppearance.Medium"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="10dp"
+                    android:text="@string/always_allow" />
+
+                <CheckBox
+                    android:id="@+id/allow_temporarily"
+                    style="@android:style/TextAppearance.Medium"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="10dp"
+                    android:text="@string/allow_temporarily" />
+            </LinearLayout>
         </LinearLayout>
     </LinearLayout>
 
         </LinearLayout>
 
         <Button
-            android:enabled="false"
             android:id="@+id/allow"
             style="@style/FlatButton"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_weight="1"
+            android:enabled="false"
             android:text="@string/allow" />
     </LinearLayout>
 
index 541752f..fff1478 100644 (file)
@@ -8,4 +8,12 @@
         <!-- API 11 theme customizations can go here. -->
     </style>
 
+    <style name="AppBaseDarkTheme" parent="@android:style/Theme.Holo">
+        <!-- API 14 theme customizations can go here. -->
+    </style>
+        
+    <style name="FlatButton">
+        <item name="android:background">?android:attr/selectableItemBackground</item>
+    </style>
+    
 </resources>
\ No newline at end of file
index 2a52087..94b5881 100644 (file)
@@ -9,10 +9,11 @@
         <!-- API 14 theme customizations can go here. -->
     </style>
 
-    <style name="FlatButton">
-        <item name="android:background">?android:attr/selectableItemBackground</item>
+    <style name="AppBaseDarkTheme" parent="android:Theme.Holo">
+        <!-- API 14 theme customizations can go here. -->
     </style>
     
-    <style name="Dialog" parent="@android:style/Theme.Holo.Light.DarkActionBar">
+    <style name="FlatButton" parent="@android:style/Theme.Holo">
+        <item name="android:background">?android:attr/selectableItemBackground</item>
     </style>
 </resources>
\ No newline at end of file
index 4c888b4..cf8024d 100644 (file)
         <!-- All customizations that are NOT specific to a particular API-level can go here. -->
     </style>
     
+    <style name="AppBaseDarkTheme" parent="android:Theme.Black">
+        
+    </style>
+    
+    <!-- Application theme. -->
+    <style name="AppDarkTheme" parent="AppBaseDarkTheme">
+        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
+    </style>
+    
     <style name="FlatButton">
         
     </style>
index ebc13bb..6ed3df9 100644 (file)
@@ -13,12 +13,15 @@ import android.net.LocalSocketAddress.Namespace;
 import android.os.Bundle;
 import android.os.Handler;
 import android.util.Log;
+import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.view.ViewGroup;
 import android.widget.ArrayAdapter;
 import android.widget.Button;
 import android.widget.ImageView;
+import android.widget.LinearLayout;
 import android.widget.ListView;
 import android.widget.TextView;
 
@@ -185,7 +188,7 @@ public class MainActivity extends Activity {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_main);
-        
+
         Intent intent = getIntent();
         if (intent == null) {
             finish();