OSDN Git Service

30c3fb524ef81df351c30a0dc9b4bba66a9693af
[android-x86/external-koush-Superuser.git] / Superuser / src / com / koushikdutta / superuser / SettingsNativeFragment.java
1 package com.koushikdutta.superuser;
2
3 import android.content.Context;
4 import android.content.res.Configuration;
5 import android.os.Bundle;
6 import android.view.ContextThemeWrapper;
7 import android.view.LayoutInflater;
8 import android.view.View;
9 import android.view.ViewGroup;
10
11 import com.koushikdutta.widgets.NativeFragment;
12
13
14 public class SettingsNativeFragment extends NativeFragment<SettingsFragmentInternal> {
15     ContextThemeWrapper mWrapper;
16     public Context getContext(Context ctx) {
17         if (mWrapper != null)
18             return mWrapper;
19         mWrapper = new ContextThemeWrapper(ctx, R.style.SuperuserDark);
20         return mWrapper;
21     }
22
23     @Override
24     public SettingsFragmentInternal createFragmentInterface() {
25         return new SettingsFragmentInternal(this) {
26             @Override
27             protected void setPadding() {
28                 super.setPadding();
29                 getListView().setPadding(0, 0, 0, 0);
30             }
31             @Override
32             public Context getContext() {
33                 return SettingsNativeFragment.this.getContext(super.getContext());
34             }
35         };
36     }
37     
38     @Override
39     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
40         return super.onCreateView((LayoutInflater)getContext(inflater.getContext()).getSystemService(Context.LAYOUT_INFLATER_SERVICE), container, savedInstanceState);
41     }
42 }