Merge "fix(accessibility suw): fix unexpected large padding in accessibility suw when force-two-pane mode" into main

This commit is contained in:
Roy Chou
2024-04-11 01:36:00 +00:00
committed by Android (Google) Code Review

View File

@@ -26,6 +26,7 @@ import androidx.annotation.StringRes;
import com.google.android.setupcompat.template.FooterBarMixin;
import com.google.android.setupcompat.template.FooterButton;
import com.google.android.setupcompat.template.Mixin;
import com.google.android.setupcompat.util.ForceTwoPaneHelper;
import com.google.android.setupdesign.GlifPreferenceLayout;
import com.google.android.setupdesign.R;
import com.google.android.setupdesign.util.ThemeHelper;
@@ -63,6 +64,16 @@ public class AccessibilitySetupWizardUtils {
layout.setDividerInsets(Integer.MAX_VALUE, 0);
if (ThemeHelper.shouldApplyMaterialYouStyle(context)) {
// For b/323771329#comment26, if the layout is forced-two-pan, we should not adjust the
// headerLayout horizontal padding to 0, which will make an unexpected large padding on
// two-pane layout.
// TODO: This is just a short-term quick workaround for force-two-pane devices padding
// issue. The long-term goal here is to remove the header padding adjustment since it
// should be handled in setup design lib. (b/331878747)
if (ForceTwoPaneHelper.shouldForceTwoPane(context)) {
return;
}
final LinearLayout headerLayout = layout.findManagedViewById(R.id.sud_layout_header);
if (headerLayout != null) {
headerLayout.setPadding(0, layout.getPaddingTop(), 0,