diff --git a/src/com/android/customization/model/color/ColorSectionController.java b/src/com/android/customization/model/color/ColorSectionController.java
index c31f01e..be051ac 100644
--- a/src/com/android/customization/model/color/ColorSectionController.java
+++ b/src/com/android/customization/model/color/ColorSectionController.java
@@ -41,7 +41,6 @@
 import androidx.annotation.Nullable;
 import androidx.lifecycle.LifecycleOwner;
 import androidx.recyclerview.widget.RecyclerView;
-import androidx.viewpager2.widget.MarginPageTransformer;
 import androidx.viewpager2.widget.ViewPager2;
 
 import com.android.customization.model.CustomizationManager;
@@ -54,7 +53,6 @@
 import com.android.wallpaper.model.CustomizationSectionController;
 import com.android.wallpaper.model.WallpaperColorsViewModel;
 import com.android.wallpaper.module.InjectorProvider;
-import com.android.wallpaper.module.LargeScreenMultiPanesChecker;
 import com.android.wallpaper.widget.PageIndicator;
 import com.android.wallpaper.widget.SeparatedTabLayout;
 
@@ -104,7 +102,6 @@
             new Optional[]{Optional.empty(), Optional.empty()};
     private long mLastColorApplyingTime = 0L;
     private ColorSectionView mColorSectionView;
-    private boolean mIsMultiPane;
 
     private static int getNumPages(int optionsPerPage, int totalOptions) {
         return (int) Math.ceil((float) totalOptions / optionsPerPage);
@@ -118,7 +115,6 @@
                 new OverlayManagerCompat(activity));
         mWallpaperColorsViewModel = viewModel;
         mLifecycleOwner = lifecycleOwner;
-        mIsMultiPane = new LargeScreenMultiPanesChecker().isMultiPanesEnabled(activity);
 
         if (savedInstanceState != null) {
             if (savedInstanceState.containsKey(KEY_COLOR_TAB_POSITION)) {
@@ -326,10 +322,8 @@
             subOptions = colorOptions;
         }
 
-        final int padding = container.getContext().getResources().getDimensionPixelSize(
-                R.dimen.section_horizontal_padding);
         OptionSelectorController<ColorOption> adaptiveController = new OptionSelectorController<>(
-                container, subOptions, /* useGrid= */ true, CENTER, padding);
+                container, subOptions, /* useGrid= */ true, CENTER);
         adaptiveController.initOptions(mColorManager);
         setUpColorOptionsController(adaptiveController);
     }
@@ -474,16 +468,6 @@
                 mContainer = itemView.findViewById(R.id.color_page_container);
                 // Correct scrolling goes under collapsing toolbar while scrolling oclor options.
                 mContainer.getChildAt(0).setNestedScrollingEnabled(false);
-                /**
-                 * Sets page transformer with margin to separate color pages and
-                 * sets color pages' padding to not scroll to window boundary if multi-pane case
-                 */
-                if (mIsMultiPane) {
-                    final int padding = itemView.getContext().getResources().getDimensionPixelSize(
-                            R.dimen.section_horizontal_padding);
-                    mContainer.setPageTransformer(new MarginPageTransformer(padding * 2));
-                    mContainer.setPadding(0, /* top= */ 0, 0, /* bottom= */ 0);
-                }
                 mPageIndicator = itemView.findViewById(R.id.color_page_indicator);
                 if (ColorProvider.themeStyleEnabled) {
                     mPageIndicator.setVisibility(VISIBLE);
@@ -541,15 +525,13 @@
             ColorOptionViewHolder(View itemView) {
                 super(itemView);
                 mContainer = itemView.findViewById(R.id.color_option_container);
-                // Sets layout with margins for non multi-pane case to separate color options.
-                if (!mIsMultiPane) {
-                    final FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(
-                            mContainer.getLayoutParams());
-                    final int margin = itemView.getContext().getResources().getDimensionPixelSize(
-                            R.dimen.section_horizontal_padding);
-                    layoutParams.setMargins(margin, /* top= */ 0, margin, /* bottom= */ 0);
-                    mContainer.setLayoutParams(layoutParams);
-                }
+                // Sets layout with margins to separate color options.
+                final FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(
+                        mContainer.getLayoutParams());
+                final int margin = itemView.getContext().getResources().getDimensionPixelSize(
+                        R.dimen.section_horizontal_padding);
+                layoutParams.setMargins(margin, /* top= */ 0, margin, /* bottom= */ 0);
+                mContainer.setLayoutParams(layoutParams);
             }
         }
     }
diff --git a/src/com/android/customization/picker/clock/ui/fragment/ClockSettingsFragment.kt b/src/com/android/customization/picker/clock/ui/fragment/ClockSettingsFragment.kt
index ef1a5ef..c5cde53 100644
--- a/src/com/android/customization/picker/clock/ui/fragment/ClockSettingsFragment.kt
+++ b/src/com/android/customization/picker/clock/ui/fragment/ClockSettingsFragment.kt
@@ -108,7 +108,7 @@
                         },
                     ),
                 lifecycleOwner = this,
-                offsetToStart = displayUtils.isOnWallpaperDisplay(activity),
+                offsetToStart = displayUtils.isSingleDisplayOrUnfoldedHorizontalHinge(activity),
             )
             .show()
 
diff --git a/src/com/android/customization/picker/color/ui/fragment/ColorPickerFragment.kt b/src/com/android/customization/picker/color/ui/fragment/ColorPickerFragment.kt
index ef68a4e..c6b2023 100644
--- a/src/com/android/customization/picker/color/ui/fragment/ColorPickerFragment.kt
+++ b/src/com/android/customization/picker/color/ui/fragment/ColorPickerFragment.kt
@@ -105,7 +105,8 @@
                     },
                 ),
             lifecycleOwner = this,
-            offsetToStart = displayUtils.isOnWallpaperDisplay(requireActivity()),
+            offsetToStart =
+                displayUtils.isSingleDisplayOrUnfoldedHorizontalHinge(requireActivity()),
         )
         ScreenPreviewBinder.bind(
             activity = requireActivity(),
@@ -136,7 +137,8 @@
                     },
                 ),
             lifecycleOwner = this,
-            offsetToStart = displayUtils.isOnWallpaperDisplay(requireActivity()),
+            offsetToStart =
+                displayUtils.isSingleDisplayOrUnfoldedHorizontalHinge(requireActivity()),
         )
         val darkModeToggleContainerView: FrameLayout =
             view.requireViewById(R.id.dark_mode_toggle_container)
diff --git a/src/com/android/customization/picker/grid/GridFragment.java b/src/com/android/customization/picker/grid/GridFragment.java
index b0b1107..b5ed7ee 100644
--- a/src/com/android/customization/picker/grid/GridFragment.java
+++ b/src/com/android/customization/picker/grid/GridFragment.java
@@ -82,6 +82,7 @@
     private final Callback mApplyGridCallback = new Callback() {
         @Override
         public void onSuccess() {
+            mGridManager.fetchOptions(unused -> {}, true);
             Toast.makeText(getContext(), R.string.applied_grid_msg, Toast.LENGTH_SHORT).show();
             getActivity().overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
             getActivity().finish();
@@ -217,7 +218,7 @@
                 mLoading.hide();
                 mOptionsController = new OptionSelectorController<>(
                         mOptionsContainer, options, /* useGrid= */ false,
-                        CheckmarkStyle.CENTER_CHANGE_COLOR_WHEN_NOT_SELECTED, 0);
+                        CheckmarkStyle.CENTER_CHANGE_COLOR_WHEN_NOT_SELECTED);
                 mOptionsController.initOptions(mGridManager);
                 GridOption previouslySelectedOption = findEquivalent(options,
                         mGridOptionViewModel.getSelectedOption());
diff --git a/src/com/android/customization/picker/quickaffordance/ui/fragment/KeyguardQuickAffordancePickerFragment.kt b/src/com/android/customization/picker/quickaffordance/ui/fragment/KeyguardQuickAffordancePickerFragment.kt
index f956598..d5f0d33 100644
--- a/src/com/android/customization/picker/quickaffordance/ui/fragment/KeyguardQuickAffordancePickerFragment.kt
+++ b/src/com/android/customization/picker/quickaffordance/ui/fragment/KeyguardQuickAffordancePickerFragment.kt
@@ -68,7 +68,9 @@
             viewModel = viewModel,
             lifecycleOwner = this,
             offsetToStart =
-                injector.getDisplayUtils(requireActivity()).isOnWallpaperDisplay(requireActivity())
+                requireActivity().let {
+                    injector.getDisplayUtils(it).isSingleDisplayOrUnfoldedHorizontalHinge(it)
+                }
         )
         KeyguardQuickAffordancePickerBinder.bind(
             view = view,
diff --git a/src/com/android/customization/picker/theme/CustomThemeComponentFragment.java b/src/com/android/customization/picker/theme/CustomThemeComponentFragment.java
index 83d5e69..a1e9967 100644
--- a/src/com/android/customization/picker/theme/CustomThemeComponentFragment.java
+++ b/src/com/android/customization/picker/theme/CustomThemeComponentFragment.java
@@ -95,7 +95,7 @@
     private void setUpOptions() {
         mProvider.fetch(options -> {
             mOptionsController = new OptionSelectorController(
-                    mOptionsContainer, options, mUseGridLayout, CheckmarkStyle.NONE, 0);
+                    mOptionsContainer, options, mUseGridLayout, CheckmarkStyle.NONE);
 
             mOptionsController.addListener(selected -> {
                 mSelectedOption = (ThemeComponentOption) selected;
diff --git a/src/com/android/customization/picker/theme/ThemeFragment.java b/src/com/android/customization/picker/theme/ThemeFragment.java
index 493213d..3a9a56f 100644
--- a/src/com/android/customization/picker/theme/ThemeFragment.java
+++ b/src/com/android/customization/picker/theme/ThemeFragment.java
@@ -258,7 +258,7 @@
         mThemeManager.fetchOptions(new OptionsFetchedListener<ThemeBundle>() {
             @Override
             public void onOptionsLoaded(List<ThemeBundle> options) {
-                mOptionsController = new OptionSelectorController<>(mOptionsContainer, options, 0);
+                mOptionsController = new OptionSelectorController<>(mOptionsContainer, options);
                 mOptionsController.initOptions(mThemeManager);
 
                 // Find out the selected theme option.
diff --git a/src/com/android/customization/widget/OptionSelectorController.java b/src/com/android/customization/widget/OptionSelectorController.java
index 6ca13be..8c7af00 100644
--- a/src/com/android/customization/widget/OptionSelectorController.java
+++ b/src/com/android/customization/widget/OptionSelectorController.java
@@ -85,19 +85,18 @@
     private final boolean mUseGrid;
     @CheckmarkStyle
     private final int mCheckmarkStyle;
-    private final int mContainerInset;
 
     private final Set<OptionSelectedListener> mListeners = new HashSet<>();
     private RecyclerView.Adapter<TileViewHolder> mAdapter;
     private T mSelectedOption;
     private T mAppliedOption;
 
-    public OptionSelectorController(RecyclerView container, List<T> options, int containerInset) {
-        this(container, options, true, CheckmarkStyle.CORNER, containerInset);
+    public OptionSelectorController(RecyclerView container, List<T> options) {
+        this(container, options, true, CheckmarkStyle.CORNER);
     }
 
     public OptionSelectorController(RecyclerView container, List<T> options,
-            boolean useGrid, @CheckmarkStyle int checkmarkStyle, int containerInset) {
+            boolean useGrid, @CheckmarkStyle int checkmarkStyle) {
         mContainer = container;
         mOptions = options;
         mUseGrid = useGrid;
@@ -106,7 +105,6 @@
         mContainer.getResources().getValue(R.dimen.linear_layout_horizontal_display_options_max,
                 typedValue, true);
         mLinearLayoutHorizontalDisplayOptionsMax = typedValue.getFloat();
-        mContainerInset = containerInset;
     }
 
     public void addListener(OptionSelectedListener listener) {
@@ -304,9 +302,6 @@
             int numColumns = res.getInteger(R.integer.options_grid_num_columns);
             GridLayoutManager gridLayoutManager = new GridLayoutManager(mContainer.getContext(),
                     numColumns);
-            if (mContainerInset != 0) {
-                mContainer.setPadding(mContainerInset, 0, mContainerInset, 0);
-            }
             mContainer.setLayoutManager(gridLayoutManager);
         } else {
             final int padding = res.getDimensionPixelSize(
