Revert "[Expressive design] Update MainSwitch in SettingsActivity."

This reverts commit b7e0923414.

Reason for revert: Cause regression b/385850462

Change-Id: I82992d428ea985bc2a762854df2abd555cc4a467
This commit is contained in:
Jacky Wang
2024-12-26 20:44:31 -08:00
committed by Android (Google) Code Review
parent b7e0923414
commit 63a14901aa
2 changed files with 1 additions and 11 deletions

View File

@@ -28,13 +28,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
<com.android.settings.widget.SettingsMainSwitchBar
android:id="@+id/expressive_switch_bar"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dip"/>
<FrameLayout <FrameLayout
android:id="@+id/main_content" android:id="@+id/main_content"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -311,10 +311,7 @@ public class SettingsActivity extends SettingsBaseActivity
} }
setContentView(R.layout.settings_main_prefs); setContentView(R.layout.settings_main_prefs);
mMainSwitch = findViewById(R.id.switch_bar);
mMainSwitch = SettingsThemeHelper.isExpressiveTheme(this)
? findViewById(R.id.expressive_switch_bar)
: findViewById(R.id.switch_bar);
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);