From 3b70c6c41af7ce53dce37eba434ebcc081a9c03d Mon Sep 17 00:00:00 2001 From: Stanley Wang Date: Wed, 3 Mar 2021 12:06:14 +0800 Subject: [PATCH] Fix the overlap issue of MainSwitch and list view. This issue happen on Developer and Wi-Fi pages, so the problem should be solved on SettingsActivity. Fix: 181341927 Test: Run robotest and see the ui Change-Id: I57722cfcbeb6390c88101d808429346045e57c92 --- src/com/android/settings/SettingsActivity.java | 1 + .../development/DevelopmentSettingsDashboardFragment.java | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java index d22a38117a2..b6729179d11 100644 --- a/src/com/android/settings/SettingsActivity.java +++ b/src/com/android/settings/SettingsActivity.java @@ -309,6 +309,7 @@ public class SettingsActivity extends SettingsBaseActivity mMainSwitch = findViewById(R.id.switch_bar); if (mMainSwitch != null) { mMainSwitch.setMetricsTag(getMetricsTag()); + mMainSwitch.setTranslationZ(findViewById(R.id.main_content).getTranslationZ() + 1); } // see if we should show Back/Next buttons diff --git a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java index 367e7c5086a..e34ae9b6ef7 100644 --- a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java +++ b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java @@ -200,8 +200,6 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra mSwitchBar = ((SettingsActivity) getActivity()).getSwitchBar(); mSwitchBar.setTitle(getContext().getString(R.string.developer_options_main_switch_title)); mSwitchBar.show(); - mSwitchBar.setTranslationZ( - getActivity().findViewById(R.id.main_content).getTranslationZ() + 1); mSwitchBarController = new DevelopmentSwitchBarController( this /* DevelopmentSettings */, mSwitchBar, mIsAvailable, getSettingsLifecycle());