Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3dbce41 authored by fbaron's avatar fbaron
Browse files

Prevent two pane widget picker code from reaching foldables

Currently, there's a few sections of the code that are intended to only be reached by tablets in landscape mode that can be reached by unfolded foldables. Here, we fix this so it no longer occurs.

Bug: 277102339
Test: Verify widget picker works correctly on tablet
Change-Id: I1f2bc99072aff6d852f9ce658ab00fa33b9e02b5
parent 296f8776
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -186,7 +186,9 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<Launcher>
        int widthUsed;
        if (deviceProfile.isTablet) {
            int margin = deviceProfile.allAppsLeftRightMargin;
            if (deviceProfile.isLandscape && LARGE_SCREEN_WIDGET_PICKER.get()) {
            if (deviceProfile.isLandscape
                    && LARGE_SCREEN_WIDGET_PICKER.get()
                    && !deviceProfile.isTwoPanels) {
                margin = getResources().getDimensionPixelSize(
                        R.dimen.widget_picker_landscape_tablet_left_right_margin);
            }
+3 −2
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ public class WidgetsFullSheet extends BaseWidgetSheet
        super(context, attrs, defStyleAttr);
        mDeviceProfile = Launcher.getLauncher(context).getDeviceProfile();
        mHasWorkProfile = context.getSystemService(LauncherApps.class).getProfiles().size() > 1;
        mOrientation = Launcher.getLauncher(context).getOrientation();
        mOrientation = context.getResources().getConfiguration().orientation;
        mAdapters.put(AdapterHolder.PRIMARY, new AdapterHolder(AdapterHolder.PRIMARY));
        mAdapters.put(AdapterHolder.WORK, new AdapterHolder(AdapterHolder.WORK));
        mAdapters.put(AdapterHolder.SEARCH, new AdapterHolder(AdapterHolder.SEARCH));
@@ -799,7 +799,8 @@ public class WidgetsFullSheet extends BaseWidgetSheet
        // Checks the orientation of the screen
        if (LARGE_SCREEN_WIDGET_PICKER.get()
                && mOrientation != newConfig.orientation
                && mDeviceProfile.isTablet) {
                && mDeviceProfile.isTablet
                && !mDeviceProfile.isTwoPanels) {
            mOrientation = newConfig.orientation;
            handleClose(false);
            show(Launcher.getLauncher(getContext()), false);