OSDN Git Service

embedded fixes, need to move fragments out of inner classes.
authorKoushik Dutta <koushd@gmail.com>
Wed, 27 Feb 2013 13:37:29 +0000 (05:37 -0800)
committerKoushik Dutta <koushd@gmail.com>
Wed, 27 Feb 2013 13:37:29 +0000 (05:37 -0800)
Android.mk
Superuser/Android.mk
Superuser/res/values-de/strings.xml
Superuser/src/com/koushikdutta/superuser/LogNativeFragment.java
Superuser/src/com/koushikdutta/superuser/PolicyNativeFragment.java
Superuser/src/com/koushikdutta/superuser/SettingsNativeFragment.java

index d97b395..e1e98d8 100644 (file)
@@ -5,14 +5,15 @@ LOCAL_PATH := $(call my-dir)
 
 include $(CLEAR_VARS)
 
-SUPERUSER_EMBEDDED := true
 ifdef SUPERUSER_EMBEDDED
 SUPERUSER_PACKAGE := com.android.settings
-endif
-
+else
 ifeq ($(SUPERUSER_PACKAGE),)
 SUPERUSER_PACKAGE := com.thirdparty.superuser
 endif
+include $(LOCAL_PATH)/Superuser/Android.mk
+endif
+
 
 LOCAL_MODULE := su
 LOCAL_FORCE_STATIC_EXECUTABLE := true
@@ -23,4 +24,3 @@ LOCAL_CFLAGS := -DSQLITE_OMIT_LOAD_EXTENSION -DREQUESTOR=\"$(SUPERUSER_PACKAGE)\
 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
 include $(BUILD_EXECUTABLE)
 
-include $(LOCAL_PATH)/Superuser/Android.mk
\ No newline at end of file
index a50d1fe..e2215ba 100644 (file)
@@ -1,5 +1,3 @@
-ifndef SUPERUSER_EMBEDDED
-
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
@@ -11,5 +9,3 @@ LOCAL_AAPT_INCLUDE_ALL_RESOURCES := true
 LOCAL_AAPT_FLAGS := --extra-packages com.koushikdutta.widgets -S $(LOCAL_PATH)/../../Widgets/Widgets/res --auto-add-overlay --rename-manifest-package $(SUPERUSER_PACKAGE)
 
 include $(BUILD_PACKAGE)
-
-endif
index 3a2e9bb..5b085b3 100644 (file)
@@ -2,7 +2,6 @@
 <resources>
 
     <string name="superuser">Superuser</string>
-    <string name="app_name">Superuser</string>
     <string name="allow">Gewähren</string>
     <string name="deny">Verweigern</string>
     <string name="status_incoming">Eingehende Superuser-Anfrage\u2026</string>
index b182060..f5cbb65 100644 (file)
@@ -1,32 +1,43 @@
 package com.koushikdutta.superuser;
 
 import android.content.Context;
+import android.os.Bundle;
 import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
 
 import com.koushikdutta.widgets.NativeFragment;
 
 public class LogNativeFragment extends NativeFragment<LogFragmentInternal> {
+    ContextThemeWrapper mWrapper;
+    public Context getContext(Context ctx) {
+        if (mWrapper != null)
+            return mWrapper;
+        mWrapper = new ContextThemeWrapper(ctx, R.style.SuperuserDark);
+        return mWrapper;
+    }
 
     @Override
     public LogFragmentInternal createFragmentInterface() {
         return new LogFragmentInternal(this) {
             @Override
-            void onDelete() {
-                super.onDelete();
-                LogNativeFragment.this.onDelete();
+            public Context getContext() {
+                return LogNativeFragment.this.getContext(super.getContext());
             }
-            ContextThemeWrapper mWrapper;
+            
             @Override
-            public Context getContext() {
-                if (mWrapper != null)
-                    return mWrapper;
-                Context ctx = super.getContext();
-                mWrapper = new ContextThemeWrapper(ctx, R.style.SuperuserDark);
-                return mWrapper;
+            protected void setPadding() {
+                super.setPadding();
+                getListView().setPadding(0, 0, 0, 0);
             }
         };
     }
-
+    
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+        return super.onCreateView((LayoutInflater)getContext(inflater.getContext()).getSystemService(Context.LAYOUT_INFLATER_SERVICE), container, savedInstanceState);
+    }
     void onDelete() {
         
     }
index e801100..fc61a27 100644 (file)
@@ -1,24 +1,41 @@
 package com.koushikdutta.superuser;
 
 import android.content.Context;
+import android.os.Bundle;
 import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
 
 import com.koushikdutta.widgets.NativeFragment;
 
 public class PolicyNativeFragment extends NativeFragment<PolicyFragmentInternal> {
+    ContextThemeWrapper mWrapper;
+    public Context getContext(Context ctx) {
+        if (mWrapper != null)
+            return mWrapper;
+        mWrapper = new ContextThemeWrapper(ctx, R.style.SuperuserDark);
+        return mWrapper;
+    }
 
     @Override
     public PolicyFragmentInternal createFragmentInterface() {
         return new PolicyFragmentInternal(this) {
-            ContextThemeWrapper mWrapper;
             @Override
             public Context getContext() {
-                if (mWrapper != null)
-                    return mWrapper;
-                Context ctx = super.getContext();
-                mWrapper = new ContextThemeWrapper(ctx, R.style.SuperuserDark);
-                return mWrapper;
+                return PolicyNativeFragment.this.getContext(super.getContext());
+            }
+            
+            @Override
+            protected void setPadding() {
+                getListView().setPadding(0, 0, 0, 0);
+                getContainer().setPadding(0, 0, 0, 0);
             }
         };
     }
+    
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+        return super.onCreateView((LayoutInflater)getContext(inflater.getContext()).getSystemService(Context.LAYOUT_INFLATER_SERVICE), container, savedInstanceState);
+    }
 }
index 84644e5..bc6c672 100644 (file)
@@ -1,24 +1,37 @@
 package com.koushikdutta.superuser;
 
 import android.content.Context;
+import android.content.res.Configuration;
+import android.os.Bundle;
 import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
 
 import com.koushikdutta.widgets.NativeFragment;
 
 
 public class SettingsNativeFragment extends NativeFragment<SettingsFragmentInternal> {
+    ContextThemeWrapper mWrapper;
+    public Context getContext(Context ctx) {
+        if (mWrapper != null)
+            return mWrapper;
+        mWrapper = new ContextThemeWrapper(ctx, R.style.SuperuserDark);
+        return mWrapper;
+    }
+
     @Override
     public SettingsFragmentInternal createFragmentInterface() {
         return new SettingsFragmentInternal(this) {
-            ContextThemeWrapper mWrapper;
             @Override
             public Context getContext() {
-                if (mWrapper != null)
-                    return mWrapper;
-                Context ctx = super.getContext();
-                mWrapper = new ContextThemeWrapper(ctx, R.style.SuperuserDark);
-                return mWrapper;
+                return SettingsNativeFragment.this.getContext(super.getContext());
             }
         };
     }
+    
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+        return super.onCreateView((LayoutInflater)getContext(inflater.getContext()).getSystemService(Context.LAYOUT_INFLATER_SERVICE), container, savedInstanceState);
+    }
 }