use of com.android.settingslib.core.lifecycle.HideNonSystemOverlayMixin in project android_packages_apps_Settings by omnirom.
the class SettingsBaseActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isLockTaskModePinned() && !isSettingsRunOnTop()) {
Log.w(TAG, "Devices lock task mode pinned.");
finish();
}
final long startTime = System.currentTimeMillis();
getLifecycle().addObserver(new HideNonSystemOverlayMixin(this));
TextAppearanceConfig.setShouldLoadFontSynchronously(true);
mCategoryMixin = new CategoryMixin(this);
getLifecycle().addObserver(mCategoryMixin);
final TypedArray theme = getTheme().obtainStyledAttributes(android.R.styleable.Theme);
if (!theme.getBoolean(android.R.styleable.Theme_windowNoTitle, false)) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
}
// Apply SetupWizard light theme during setup flow. This is for SubSettings pages.
final boolean isAnySetupWizard = WizardManagerHelper.isAnySetupWizard(getIntent());
if (isAnySetupWizard && this instanceof SubSettings) {
int appliedTheme;
if (ThemeHelper.trySetDynamicColor(this)) {
appliedTheme = ThemeHelper.isSetupWizardDayNightEnabled(this) ? R.style.SudDynamicColorThemeSettings_SetupWizard_DayNight : R.style.SudDynamicColorThemeSettings_SetupWizard;
} else {
appliedTheme = ThemeHelper.isSetupWizardDayNightEnabled(this) ? R.style.SubSettings_SetupWizard : R.style.SudThemeGlifV3_Light;
}
setTheme(appliedTheme);
}
if (isToolbarEnabled() && !isAnySetupWizard) {
super.setContentView(R.layout.collapsing_toolbar_base_layout);
mCollapsingToolbarLayout = findViewById(R.id.collapsing_toolbar);
mAppBarLayout = findViewById(R.id.app_bar);
if (mCollapsingToolbarLayout != null) {
mCollapsingToolbarLayout.setLineSpacingMultiplier(TOOLBAR_LINE_SPACING_MULTIPLIER);
}
disableCollapsingToolbarLayoutScrollingBehavior();
} else {
super.setContentView(R.layout.settings_base_layout);
}
// This is to hide the toolbar from those pages which don't need a toolbar originally.
final Toolbar toolbar = findViewById(R.id.action_bar);
if (!isToolbarEnabled() || isAnySetupWizard) {
toolbar.setVisibility(View.GONE);
return;
}
setActionBar(toolbar);
if (DEBUG_TIMING) {
Log.d(TAG, "onCreate took " + (System.currentTimeMillis() - startTime) + " ms");
}
}
use of com.android.settingslib.core.lifecycle.HideNonSystemOverlayMixin in project android_packages_apps_Settings by omnirom.
the class SettingsHomepageActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings_homepage_container);
final View appBar = findViewById(R.id.app_bar_container);
appBar.setMinimumHeight(getSearchBoxHeight());
initHomepageContainer();
final Toolbar toolbar = findViewById(R.id.search_action_bar);
FeatureFactory.getFactory(this).getSearchFeatureProvider().initSearchToolbar(this, /* activity */
toolbar, SettingsEnums.SETTINGS_HOMEPAGE);
getLifecycle().addObserver(new HideNonSystemOverlayMixin(this));
mCategoryMixin = new CategoryMixin(this);
getLifecycle().addObserver(mCategoryMixin);
if (!getSystemService(ActivityManager.class).isLowRamDevice()) {
// Only allow features on high ram devices.
final ImageView avatarView = findViewById(R.id.account_avatar);
if (AvatarViewMixin.isAvatarSupported(this)) {
avatarView.setVisibility(View.VISIBLE);
getLifecycle().addObserver(new AvatarViewMixin(this, avatarView));
}
showSuggestionFragment();
if (FeatureFlagUtils.isEnabled(this, FeatureFlags.CONTEXTUAL_HOME)) {
showFragment(new ContextualCardsFragment(), R.id.contextual_cards_content);
}
}
showFragment(new TopLevelSettings(), R.id.main_content);
((FrameLayout) findViewById(R.id.main_content)).getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
}
use of com.android.settingslib.core.lifecycle.HideNonSystemOverlayMixin in project android_packages_apps_Settings by omnirom.
the class SettingsPanelActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getApplicationContext().getTheme().rebase();
createOrUpdatePanel(true);
getLifecycle().addObserver(new HideNonSystemOverlayMixin(this));
}
use of com.android.settingslib.core.lifecycle.HideNonSystemOverlayMixin in project android_packages_apps_Settings by omnirom.
the class AddAppNetworksActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings_panel);
showAddNetworksFragment();
getLifecycle().addObserver(new HideNonSystemOverlayMixin(this));
// Move the window to the bottom of screen, and make it take up the entire screen width.
final Window window = getWindow();
window.setGravity(Gravity.BOTTOM);
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
}
use of com.android.settingslib.core.lifecycle.HideNonSystemOverlayMixin in project android_packages_apps_Settings by omnirom.
the class CredentialStorage method onCreate.
@Override
protected void onCreate(Bundle savedState) {
super.onCreate(savedState);
mUtils = new LockPatternUtils(this);
getLifecycle().addObserver(new HideNonSystemOverlayMixin(this));
}
Aggregations