use of forpdateam.ru.forpda.ui.fragments.settings.SettingsFragment in project ForPDA by RadiationX.
the class SettingsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
currentThemeIsDark = App.get().isDarkTheme();
setTheme(currentThemeIsDark ? R.style.PreferenceAppThemeDark : R.style.PreferenceAppThemeLight);
setContentView(R.layout.activity_settings);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setTitle(R.string.activity_title_settings);
}
PreferenceFragmentCompat fragment = null;
Intent intent = getIntent();
if (intent != null) {
String settingsArgument = intent.getStringExtra(ARG_NEW_PREFERENCE_SCREEN);
if (settingsArgument != null) {
if (settingsArgument.equals(NotificationsSettingsFragment.PREFERENCE_SCREEN_NAME)) {
fragment = new NotificationsSettingsFragment();
}
}
}
if (fragment == null) {
fragment = new SettingsFragment();
}
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_content, fragment).commit();
/*View view = findViewById(R.id.fragment_content);
view.setBackgroundColor(Color.TRANSPARENT);
view.setBackgroundColor(Color.rgb(4, 26, 55));*/
App.get().addPreferenceChangeObserver(appThemeChangeObserver);
}
Aggregations