Search in sources :

Example 1 with PreferenceController

use of de.danoeh.antennapod.preferences.PreferenceController in project AntennaPod by AntennaPod.

the class PreferenceActivity method onCreate.

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
protected void onCreate(Bundle savedInstanceState) {
    // This must be the FIRST thing we do, otherwise other code may not have the
    // reference it needs
    instance = new WeakReference<>(this);
    setTheme(UserPreferences.getTheme());
    super.onCreate(savedInstanceState);
    ActionBar ab = getSupportActionBar();
    if (ab != null) {
        ab.setDisplayHomeAsUpEnabled(true);
    }
    // set up layout
    FrameLayout root = new FrameLayout(this);
    root.setId(R.id.content);
    root.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    setContentView(root);
    // we need to create the PreferenceController before the MainFragment
    // since the MainFragment depends on the preferenceController already being created
    preferenceController = new PreferenceController(preferenceUI);
    prefFragment = new MainFragment();
    getFragmentManager().beginTransaction().replace(R.id.content, prefFragment).commit();
}
Also used : FrameLayout(android.widget.FrameLayout) PreferenceController(de.danoeh.antennapod.preferences.PreferenceController) ActionBar(android.support.v7.app.ActionBar) TargetApi(android.annotation.TargetApi)

Example 2 with PreferenceController

use of de.danoeh.antennapod.preferences.PreferenceController in project AntennaPod by AntennaPod.

the class PreferenceActivityGingerbread method onCreate.

@SuppressLint("NewApi")
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState) {
    setTheme(UserPreferences.getTheme());
    super.onCreate(savedInstanceState);
    addPreferencesFromResource(R.xml.preferences);
    preferenceController = new PreferenceController(preferenceUI);
    preferenceController.onCreate();
}
Also used : PreferenceController(de.danoeh.antennapod.preferences.PreferenceController) SuppressLint(android.annotation.SuppressLint)

Aggregations

PreferenceController (de.danoeh.antennapod.preferences.PreferenceController)2 SuppressLint (android.annotation.SuppressLint)1 TargetApi (android.annotation.TargetApi)1 ActionBar (android.support.v7.app.ActionBar)1 FrameLayout (android.widget.FrameLayout)1