Merge "[Expressive design] Update MainSwitchPreference padding in SettingsActivity." into main

This commit is contained in:
Yuchen Sun
2024-12-30 01:26:02 -08:00
committed by Android (Google) Code Review

View File

@@ -315,6 +315,12 @@ public class SettingsActivity extends SettingsBaseActivity
if (mMainSwitch != null) { if (mMainSwitch != null) {
mMainSwitch.setMetricsCategory(lookupMetricsCategory()); mMainSwitch.setMetricsCategory(lookupMetricsCategory());
mMainSwitch.setTranslationZ(findViewById(R.id.main_content).getTranslationZ() + 1); mMainSwitch.setTranslationZ(findViewById(R.id.main_content).getTranslationZ() + 1);
if (SettingsThemeHelper.isExpressiveTheme(this)) {
final int paddingHorizontal = getResources().getDimensionPixelSize(
com.android.settingslib.widget.theme
.R.dimen.settingslib_expressive_space_small1);
mMainSwitch.setPadding(paddingHorizontal, 0, paddingHorizontal, 0);
}
} }
getSupportFragmentManager().addOnBackStackChangedListener(this); getSupportFragmentManager().addOnBackStackChangedListener(this);