Fix the inconsistent alignment of the main switch preference.

Remove the redundant function.

Bug: 232494666
Test: manual test
Change-Id: I1827d39b194048452b71c680e2bbf94e43bfcac5
This commit is contained in:
Peter_Liang
2022-07-14 12:33:37 +08:00
parent 6e14ff02e8
commit e1c4901ce8
2 changed files with 0 additions and 20 deletions

View File

@@ -49,8 +49,6 @@ public class ToggleScreenReaderPreferenceFragmentForSetupWizard
if (mTopIntroPreference != null) {
mTopIntroPreference.setVisible(false);
}
mToggleServiceSwitchPreference.applyPartnerCustomizationPaddingStyle();
}
@Override

View File

@@ -22,7 +22,6 @@ import android.content.Context;
import android.content.res.TypedArray;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.Switch;
import androidx.core.content.res.TypedArrayUtils;
@@ -35,8 +34,6 @@ import com.android.settingslib.RestrictedPreferenceHelper;
import com.android.settingslib.core.instrumentation.SettingsJankMonitor;
import com.android.settingslib.widget.OnMainSwitchChangeListener;
import com.google.android.setupdesign.util.LayoutStyler;
import java.util.ArrayList;
import java.util.List;
@@ -52,7 +49,6 @@ public class SettingsMainSwitchPreference extends TwoStatePreference implements
new ArrayList<>();
private final List<OnMainSwitchChangeListener> mSwitchChangeListeners = new ArrayList<>();
private boolean mApplyPartnerCustomizationPaddingStyle;
private SettingsMainSwitchBar mMainSwitchBar;
private CharSequence mTitle;
private EnforcedAdmin mEnforcedAdmin;
@@ -100,12 +96,6 @@ public class SettingsMainSwitchPreference extends TwoStatePreference implements
} else {
mMainSwitchBar.hide();
}
if (mApplyPartnerCustomizationPaddingStyle) {
// TODO(b/232494666): Replace all margins of the root view with the padding
final ViewGroup parentView = (ViewGroup) mMainSwitchBar.getParent();
LayoutStyler.applyPartnerCustomizationLayoutPaddingStyle(parentView);
}
}
private void init(Context context, AttributeSet attrs) {
@@ -253,14 +243,6 @@ public class SettingsMainSwitchPreference extends TwoStatePreference implements
}
}
/**
* Apples the padding style of the partner's customization. It's used in the SetupWizard.
*/
public void applyPartnerCustomizationPaddingStyle() {
mApplyPartnerCustomizationPaddingStyle = true;
notifyChanged();
}
private void initMainSwitchBar() {
if (mMainSwitchBar != null) {
mMainSwitchBar.setTitle(mTitle);