Loading src/com/android/launcher3/BaseDraggingActivity.java +2 −1 Original line number Diff line number Diff line Loading @@ -147,7 +147,8 @@ public abstract class BaseDraggingActivity extends BaseActivity @Override public void onDisplayInfoChanged(Context context, Info info, int flags) { if ((flags & CHANGE_ROTATION) != 0 && mDeviceProfile.updateIsSeascape(this)) { if ((flags & CHANGE_ROTATION) != 0 && mDeviceProfile.isVerticalBarLayout()) { mDeviceProfile.updateIsSeascape(this); reapplyUi(); } } Loading src/com/android/launcher3/Hotseat.java +4 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,10 @@ public class Hotseat extends CellLayout implements Insettable { return mHasVerticalHotseat ? (getCountY() - (rank + 1)) : 0; } boolean isHasVerticalHotseat() { return mHasVerticalHotseat; } public void resetLayout(boolean hasVerticalHotseat) { ActivityContext activityContext = ActivityContext.lookupContext(getContext()); boolean bubbleBarEnabled = activityContext.isBubbleBarEnabled(); Loading src/com/android/launcher3/ModelCallbacks.kt +19 −9 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ package com.android.launcher3 import android.annotation.TargetApi import android.os.Build import android.os.Trace import android.util.Log import androidx.annotation.UiThread import com.android.launcher3.Flags.enableSmartspaceRemovalToggle import com.android.launcher3.LauncherConstants.TraceEvents Loading @@ -29,6 +30,8 @@ import com.android.launcher3.widget.PendingAddWidgetInfo import com.android.launcher3.widget.model.WidgetsListBaseEntry import java.util.function.Predicate private const val TAG = "ModelCallbacks" class ModelCallbacks(private var launcher: Launcher) : BgDataModel.Callbacks { var synchronouslyBoundPages = LIntSet() Loading Loading @@ -66,6 +69,13 @@ class ModelCallbacks(private var launcher: Launcher) : BgDataModel.Callbacks { launcher.workspace.removeAllWorkspaceScreens() // Avoid clearing the widget update listeners for staying up-to-date with widget info launcher.appWidgetHolder.clearWidgetViews() // TODO(b/335141365): Remove this log after the bug is fixed. Log.d( TAG, "startBinding: " + "hotseat layout was vertical: ${launcher.hotseat?.isHasVerticalHotseat}" + " and is setting to ${launcher.deviceProfile.isVerticalBarLayout}" ) launcher.hotseat?.resetLayout(launcher.deviceProfile.isVerticalBarLayout) TraceHelper.INSTANCE.endSection() } Loading Loading @@ -142,7 +152,10 @@ class ModelCallbacks(private var launcher: Launcher) : BgDataModel.Callbacks { launcher.viewCache.setCacheSize(R.layout.folder_page, 2) TraceHelper.INSTANCE.endSection() launcher.workspace.removeExtraEmptyScreen(/* stripEmptyScreens= */ true) launcher.workspace.pageIndicator.setPauseScroll(/*pause=*/ false, deviceProfile.isTwoPanels) launcher.workspace.pageIndicator.setPauseScroll( /*pause=*/ false, deviceProfile.isTwoPanels ) } /** Loading Loading @@ -290,8 +303,7 @@ class ModelCallbacks(private var launcher: Launcher) : BgDataModel.Callbacks { val widgetsListBaseEntry: WidgetsListBaseEntry = launcher.popupDataProvider.allWidgets.firstOrNull { item: WidgetsListBaseEntry -> item.mPkgItem.packageName == BuildConfig.APPLICATION_ID } ?: return } ?: return val info = PendingAddWidgetInfo( Loading @@ -315,16 +327,14 @@ class ModelCallbacks(private var launcher: Launcher) : BgDataModel.Callbacks { ) val firstScreenPosition = 0 if ( (isFirstPagePinnedItemEnabled && !SHOULD_SHOW_FIRST_PAGE_WIDGET) && (isFirstPagePinnedItemEnabled && !SHOULD_SHOW_FIRST_PAGE_WIDGET) && orderedScreenIds.indexOf(FIRST_SCREEN_ID) != firstScreenPosition ) { orderedScreenIds.removeValue(FIRST_SCREEN_ID) orderedScreenIds.add(firstScreenPosition, FIRST_SCREEN_ID) } else if ( (!isFirstPagePinnedItemEnabled || SHOULD_SHOW_FIRST_PAGE_WIDGET) && orderedScreenIds.isEmpty (!isFirstPagePinnedItemEnabled || SHOULD_SHOW_FIRST_PAGE_WIDGET) && orderedScreenIds.isEmpty ) { // If there are no screens, we need to have an empty screen launcher.workspace.addExtraEmptyScreens() Loading src/com/android/launcher3/WorkspaceLayoutManager.java +3 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,9 @@ public interface WorkspaceLayoutManager { int screenId = presenterPos.screenId; x = getHotseat().getCellXFromOrder(screenId); y = getHotseat().getCellYFromOrder(screenId); // TODO(b/335141365): Remove this log after the bug is fixed. Log.d(TAG, "addInScreenFromBind: hotseat inflation with x = " + x + " and y = " + y); } addInScreen(child, info.container, presenterPos.screenId, x, y, info.spanX, info.spanY); } Loading Loading
src/com/android/launcher3/BaseDraggingActivity.java +2 −1 Original line number Diff line number Diff line Loading @@ -147,7 +147,8 @@ public abstract class BaseDraggingActivity extends BaseActivity @Override public void onDisplayInfoChanged(Context context, Info info, int flags) { if ((flags & CHANGE_ROTATION) != 0 && mDeviceProfile.updateIsSeascape(this)) { if ((flags & CHANGE_ROTATION) != 0 && mDeviceProfile.isVerticalBarLayout()) { mDeviceProfile.updateIsSeascape(this); reapplyUi(); } } Loading
src/com/android/launcher3/Hotseat.java +4 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,10 @@ public class Hotseat extends CellLayout implements Insettable { return mHasVerticalHotseat ? (getCountY() - (rank + 1)) : 0; } boolean isHasVerticalHotseat() { return mHasVerticalHotseat; } public void resetLayout(boolean hasVerticalHotseat) { ActivityContext activityContext = ActivityContext.lookupContext(getContext()); boolean bubbleBarEnabled = activityContext.isBubbleBarEnabled(); Loading
src/com/android/launcher3/ModelCallbacks.kt +19 −9 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ package com.android.launcher3 import android.annotation.TargetApi import android.os.Build import android.os.Trace import android.util.Log import androidx.annotation.UiThread import com.android.launcher3.Flags.enableSmartspaceRemovalToggle import com.android.launcher3.LauncherConstants.TraceEvents Loading @@ -29,6 +30,8 @@ import com.android.launcher3.widget.PendingAddWidgetInfo import com.android.launcher3.widget.model.WidgetsListBaseEntry import java.util.function.Predicate private const val TAG = "ModelCallbacks" class ModelCallbacks(private var launcher: Launcher) : BgDataModel.Callbacks { var synchronouslyBoundPages = LIntSet() Loading Loading @@ -66,6 +69,13 @@ class ModelCallbacks(private var launcher: Launcher) : BgDataModel.Callbacks { launcher.workspace.removeAllWorkspaceScreens() // Avoid clearing the widget update listeners for staying up-to-date with widget info launcher.appWidgetHolder.clearWidgetViews() // TODO(b/335141365): Remove this log after the bug is fixed. Log.d( TAG, "startBinding: " + "hotseat layout was vertical: ${launcher.hotseat?.isHasVerticalHotseat}" + " and is setting to ${launcher.deviceProfile.isVerticalBarLayout}" ) launcher.hotseat?.resetLayout(launcher.deviceProfile.isVerticalBarLayout) TraceHelper.INSTANCE.endSection() } Loading Loading @@ -142,7 +152,10 @@ class ModelCallbacks(private var launcher: Launcher) : BgDataModel.Callbacks { launcher.viewCache.setCacheSize(R.layout.folder_page, 2) TraceHelper.INSTANCE.endSection() launcher.workspace.removeExtraEmptyScreen(/* stripEmptyScreens= */ true) launcher.workspace.pageIndicator.setPauseScroll(/*pause=*/ false, deviceProfile.isTwoPanels) launcher.workspace.pageIndicator.setPauseScroll( /*pause=*/ false, deviceProfile.isTwoPanels ) } /** Loading Loading @@ -290,8 +303,7 @@ class ModelCallbacks(private var launcher: Launcher) : BgDataModel.Callbacks { val widgetsListBaseEntry: WidgetsListBaseEntry = launcher.popupDataProvider.allWidgets.firstOrNull { item: WidgetsListBaseEntry -> item.mPkgItem.packageName == BuildConfig.APPLICATION_ID } ?: return } ?: return val info = PendingAddWidgetInfo( Loading @@ -315,16 +327,14 @@ class ModelCallbacks(private var launcher: Launcher) : BgDataModel.Callbacks { ) val firstScreenPosition = 0 if ( (isFirstPagePinnedItemEnabled && !SHOULD_SHOW_FIRST_PAGE_WIDGET) && (isFirstPagePinnedItemEnabled && !SHOULD_SHOW_FIRST_PAGE_WIDGET) && orderedScreenIds.indexOf(FIRST_SCREEN_ID) != firstScreenPosition ) { orderedScreenIds.removeValue(FIRST_SCREEN_ID) orderedScreenIds.add(firstScreenPosition, FIRST_SCREEN_ID) } else if ( (!isFirstPagePinnedItemEnabled || SHOULD_SHOW_FIRST_PAGE_WIDGET) && orderedScreenIds.isEmpty (!isFirstPagePinnedItemEnabled || SHOULD_SHOW_FIRST_PAGE_WIDGET) && orderedScreenIds.isEmpty ) { // If there are no screens, we need to have an empty screen launcher.workspace.addExtraEmptyScreens() Loading
src/com/android/launcher3/WorkspaceLayoutManager.java +3 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,9 @@ public interface WorkspaceLayoutManager { int screenId = presenterPos.screenId; x = getHotseat().getCellXFromOrder(screenId); y = getHotseat().getCellYFromOrder(screenId); // TODO(b/335141365): Remove this log after the bug is fixed. Log.d(TAG, "addInScreenFromBind: hotseat inflation with x = " + x + " and y = " + y); } addInScreen(child, info.container, presenterPos.screenId, x, y, info.spanX, info.spanY); } Loading