use of android.preference.PreferenceFragment in project ListenerMusicPlayer by hefuyicoder.
the class SettingActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(R.string.settings);
PreferenceFragment fragment = new SettingFragment();
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction().replace(R.id.fragment_container, fragment).commit();
}
use of android.preference.PreferenceFragment in project Auto.js by hyb1996.
the class SettingsActivity method setupViews.
private void setupViews() {
setContentView(R.layout.activity_settings);
getFragmentManager().beginTransaction().replace(R.id.fragment_setting, new PreferenceFragment()).commit();
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle(R.string.text_settings);
setSupportActionBar(toolbar);
toolbar.setNavigationOnClickListener(v -> finish());
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
use of android.preference.PreferenceFragment in project Talon-for-Twitter by klinker24.
the class SectionsPagerAdapter method getItem.
@Override
public Fragment getItem(int position) {
PreferenceFragment fragment = new PrefFragment();
Bundle args = new Bundle();
args.putInt("position", position);
fragment.setArguments(args);
return fragment;
}
use of android.preference.PreferenceFragment in project android-uploader by nightscout.
the class SettingsActivityTest method setUpPreferenceFragment.
private PreferenceFragment setUpPreferenceFragment(Class<? extends PreferenceFragment> clazz) {
PreferenceFragment instance;
try {
instance = clazz.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
throw new RuntimeException(e);
}
FragmentTestUtil.startVisibleFragment(instance);
return instance;
}
use of android.preference.PreferenceFragment in project Timber by naman14.
the class SettingsActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
if (PreferencesUtility.getInstance(this).getTheme().equals("dark"))
setTheme(R.style.AppThemeNormalDark);
else if (PreferencesUtility.getInstance(this).getTheme().equals("black"))
setTheme(R.style.AppThemeNormalBlack);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
action = getIntent().getAction();
if (action.equals(Constants.SETTINGS_STYLE_SELECTOR)) {
getSupportActionBar().setTitle(R.string.now_playing);
String what = getIntent().getExtras().getString(Constants.SETTINGS_STYLE_SELECTOR_WHAT);
Fragment fragment = StyleSelectorFragment.newInstance(what);
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().add(R.id.fragment_container, fragment).commit();
} else {
getSupportActionBar().setTitle(R.string.settings);
PreferenceFragment fragment = new SettingsFragment();
android.app.FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction().replace(R.id.fragment_container, fragment).commit();
}
}
Aggregations