Loading quickstep/src/com/android/launcher3/taskbar/BaseTaskbarContext.java +3 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,9 @@ public abstract class BaseTaskbarContext extends ContextThemeWrapper implements /** Callback invoked when a drag is initiated within this context. */ public abstract void onDragStart(); /** Callback invoked when a drag is finished within this context. */ public abstract void onDragEnd(); /** Callback invoked when a popup is shown or closed within this context. */ public abstract void onPopupVisibilityChanged(boolean isVisible); } quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +17 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL; import static com.android.launcher3.AbstractFloatingView.TYPE_ALL; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED; Loading Loading @@ -385,6 +386,11 @@ public class TaskbarActivityContext extends BaseTaskbarContext { setTaskbarWindowFullscreen(true); } @Override public void onDragEnd() { maybeSetTaskbarWindowNotFullscreen(); } @Override public void onPopupVisibilityChanged(boolean isVisible) { setTaskbarWindowFocusable(isVisible); Loading Loading @@ -488,6 +494,17 @@ public class TaskbarActivityContext extends BaseTaskbarContext { setTaskbarWindowHeight(fullscreen ? MATCH_PARENT : mLastRequestedNonFullscreenHeight); } /** * Reverts Taskbar window to its original size, if all floating views are closed and there is * no system drag operation in progress. */ void maybeSetTaskbarWindowNotFullscreen() { if (AbstractFloatingView.getAnyView(this, TYPE_ALL) == null && !mControllers.taskbarDragController.isSystemDragInProgress()) { setTaskbarWindowFullscreen(false); } } public boolean isTaskbarWindowFullscreen() { return mIsFullscreen; } Loading quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java +6 −0 Original line number Diff line number Diff line Loading @@ -391,11 +391,17 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im return super.isDragging() || mIsSystemDragInProgress; } /** {@code true} if the system is currently handling the drag. */ public boolean isSystemDragInProgress() { return mIsSystemDragInProgress; } private void maybeOnDragEnd() { if (!isDragging()) { ((BubbleTextView) mDragObject.originalView).getIcon().setIsDisabled(false); mControllers.taskbarAutohideSuspendController.updateFlag( TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING, false); mActivity.onDragEnd(); } } Loading quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java +4 −3 Original line number Diff line number Diff line Loading @@ -181,6 +181,9 @@ public class TaskbarDragLayerController implements TaskbarControllers.LoggableTa } else if (!mControllers.uiController.isTaskbarTouchable()) { // Let touches pass through us. insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION); } else if (mControllers.taskbarDragController.isSystemDragInProgress()) { // Let touches pass through us. insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION); } else if (mControllers.taskbarViewController.areIconsVisible() || AbstractFloatingView.getOpenView(mActivity, TYPE_ALL) != null || mActivity.isNavBarKidsModeActive()) { Loading Loading @@ -208,9 +211,7 @@ public class TaskbarDragLayerController implements TaskbarControllers.LoggableTa * Called when a child is removed from TaskbarDragLayer. */ public void onDragLayerViewRemoved() { if (AbstractFloatingView.getAnyView(mActivity, TYPE_ALL) == null) { mActivity.setTaskbarWindowFullscreen(false); } mActivity.maybeSetTaskbarWindowNotFullscreen(); } /** Loading quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java +30 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ import static android.view.KeyEvent.ACTION_UP; import static android.view.KeyEvent.KEYCODE_BACK; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY; import static com.android.systemui.shared.system.ViewTreeObserverWrapper.InsetsInfo.TOUCHABLE_INSETS_REGION; import android.content.Context; import android.view.KeyEvent; import android.view.View; Loading @@ -37,6 +39,9 @@ import com.android.launcher3.taskbar.TaskbarStashController; import com.android.launcher3.util.OnboardingPrefs; import com.android.launcher3.util.TouchController; import com.android.launcher3.views.BaseDragLayer; import com.android.systemui.shared.system.ViewTreeObserverWrapper; import com.android.systemui.shared.system.ViewTreeObserverWrapper.InsetsInfo; import com.android.systemui.shared.system.ViewTreeObserverWrapper.OnComputeInsetsListener; /** * Window context for the taskbar all apps overlay. Loading @@ -48,6 +53,7 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { private final TaskbarActivityContext mTaskbarContext; private final OnboardingPrefs<TaskbarAllAppsContext> mOnboardingPrefs; private final TaskbarAllAppsController mWindowController; private final TaskbarAllAppsViewController mAllAppsViewController; private final TaskbarDragController mDragController; private final TaskbarAllAppsDragLayer mDragLayer; Loading @@ -66,6 +72,7 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { mDragLayer = new TaskbarAllAppsDragLayer(this); TaskbarAllAppsSlideInView slideInView = (TaskbarAllAppsSlideInView) mLayoutInflater.inflate( R.layout.taskbar_all_apps, mDragLayer, false); mWindowController = windowController; mAllAppsViewController = new TaskbarAllAppsViewController( this, slideInView, Loading Loading @@ -127,11 +134,17 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { @Override public void onDragStart() {} @Override public void onDragEnd() { mWindowController.maybeCloseWindow(); } @Override public void onPopupVisibilityChanged(boolean isVisible) {} /** Root drag layer for this context. */ private static class TaskbarAllAppsDragLayer extends BaseDragLayer<TaskbarAllAppsContext> { private static class TaskbarAllAppsDragLayer extends BaseDragLayer<TaskbarAllAppsContext> implements OnComputeInsetsListener { private TaskbarAllAppsDragLayer(Context context) { super(context, null, 1); Loading @@ -142,9 +155,17 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); ViewTreeObserverWrapper.addOnComputeInsetsListener( getViewTreeObserver(), this); mActivity.mAllAppsViewController.show(); } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); ViewTreeObserverWrapper.removeOnComputeInsetsListener(this); } @Override public void recreateControllers() { mControllers = new TouchController[]{mActivity.mDragController}; Loading @@ -160,5 +181,13 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { } return super.dispatchKeyEvent(event); } @Override public void onComputeInsets(InsetsInfo inoutInfo) { if (mActivity.mDragController.isSystemDragInProgress()) { inoutInfo.touchableRegion.setEmpty(); inoutInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION); } } } } Loading
quickstep/src/com/android/launcher3/taskbar/BaseTaskbarContext.java +3 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,9 @@ public abstract class BaseTaskbarContext extends ContextThemeWrapper implements /** Callback invoked when a drag is initiated within this context. */ public abstract void onDragStart(); /** Callback invoked when a drag is finished within this context. */ public abstract void onDragEnd(); /** Callback invoked when a popup is shown or closed within this context. */ public abstract void onPopupVisibilityChanged(boolean isVisible); }
quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +17 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL; import static com.android.launcher3.AbstractFloatingView.TYPE_ALL; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED; Loading Loading @@ -385,6 +386,11 @@ public class TaskbarActivityContext extends BaseTaskbarContext { setTaskbarWindowFullscreen(true); } @Override public void onDragEnd() { maybeSetTaskbarWindowNotFullscreen(); } @Override public void onPopupVisibilityChanged(boolean isVisible) { setTaskbarWindowFocusable(isVisible); Loading Loading @@ -488,6 +494,17 @@ public class TaskbarActivityContext extends BaseTaskbarContext { setTaskbarWindowHeight(fullscreen ? MATCH_PARENT : mLastRequestedNonFullscreenHeight); } /** * Reverts Taskbar window to its original size, if all floating views are closed and there is * no system drag operation in progress. */ void maybeSetTaskbarWindowNotFullscreen() { if (AbstractFloatingView.getAnyView(this, TYPE_ALL) == null && !mControllers.taskbarDragController.isSystemDragInProgress()) { setTaskbarWindowFullscreen(false); } } public boolean isTaskbarWindowFullscreen() { return mIsFullscreen; } Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java +6 −0 Original line number Diff line number Diff line Loading @@ -391,11 +391,17 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im return super.isDragging() || mIsSystemDragInProgress; } /** {@code true} if the system is currently handling the drag. */ public boolean isSystemDragInProgress() { return mIsSystemDragInProgress; } private void maybeOnDragEnd() { if (!isDragging()) { ((BubbleTextView) mDragObject.originalView).getIcon().setIsDisabled(false); mControllers.taskbarAutohideSuspendController.updateFlag( TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING, false); mActivity.onDragEnd(); } } Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java +4 −3 Original line number Diff line number Diff line Loading @@ -181,6 +181,9 @@ public class TaskbarDragLayerController implements TaskbarControllers.LoggableTa } else if (!mControllers.uiController.isTaskbarTouchable()) { // Let touches pass through us. insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION); } else if (mControllers.taskbarDragController.isSystemDragInProgress()) { // Let touches pass through us. insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION); } else if (mControllers.taskbarViewController.areIconsVisible() || AbstractFloatingView.getOpenView(mActivity, TYPE_ALL) != null || mActivity.isNavBarKidsModeActive()) { Loading Loading @@ -208,9 +211,7 @@ public class TaskbarDragLayerController implements TaskbarControllers.LoggableTa * Called when a child is removed from TaskbarDragLayer. */ public void onDragLayerViewRemoved() { if (AbstractFloatingView.getAnyView(mActivity, TYPE_ALL) == null) { mActivity.setTaskbarWindowFullscreen(false); } mActivity.maybeSetTaskbarWindowNotFullscreen(); } /** Loading
quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java +30 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ import static android.view.KeyEvent.ACTION_UP; import static android.view.KeyEvent.KEYCODE_BACK; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY; import static com.android.systemui.shared.system.ViewTreeObserverWrapper.InsetsInfo.TOUCHABLE_INSETS_REGION; import android.content.Context; import android.view.KeyEvent; import android.view.View; Loading @@ -37,6 +39,9 @@ import com.android.launcher3.taskbar.TaskbarStashController; import com.android.launcher3.util.OnboardingPrefs; import com.android.launcher3.util.TouchController; import com.android.launcher3.views.BaseDragLayer; import com.android.systemui.shared.system.ViewTreeObserverWrapper; import com.android.systemui.shared.system.ViewTreeObserverWrapper.InsetsInfo; import com.android.systemui.shared.system.ViewTreeObserverWrapper.OnComputeInsetsListener; /** * Window context for the taskbar all apps overlay. Loading @@ -48,6 +53,7 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { private final TaskbarActivityContext mTaskbarContext; private final OnboardingPrefs<TaskbarAllAppsContext> mOnboardingPrefs; private final TaskbarAllAppsController mWindowController; private final TaskbarAllAppsViewController mAllAppsViewController; private final TaskbarDragController mDragController; private final TaskbarAllAppsDragLayer mDragLayer; Loading @@ -66,6 +72,7 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { mDragLayer = new TaskbarAllAppsDragLayer(this); TaskbarAllAppsSlideInView slideInView = (TaskbarAllAppsSlideInView) mLayoutInflater.inflate( R.layout.taskbar_all_apps, mDragLayer, false); mWindowController = windowController; mAllAppsViewController = new TaskbarAllAppsViewController( this, slideInView, Loading Loading @@ -127,11 +134,17 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { @Override public void onDragStart() {} @Override public void onDragEnd() { mWindowController.maybeCloseWindow(); } @Override public void onPopupVisibilityChanged(boolean isVisible) {} /** Root drag layer for this context. */ private static class TaskbarAllAppsDragLayer extends BaseDragLayer<TaskbarAllAppsContext> { private static class TaskbarAllAppsDragLayer extends BaseDragLayer<TaskbarAllAppsContext> implements OnComputeInsetsListener { private TaskbarAllAppsDragLayer(Context context) { super(context, null, 1); Loading @@ -142,9 +155,17 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); ViewTreeObserverWrapper.addOnComputeInsetsListener( getViewTreeObserver(), this); mActivity.mAllAppsViewController.show(); } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); ViewTreeObserverWrapper.removeOnComputeInsetsListener(this); } @Override public void recreateControllers() { mControllers = new TouchController[]{mActivity.mDragController}; Loading @@ -160,5 +181,13 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { } return super.dispatchKeyEvent(event); } @Override public void onComputeInsets(InsetsInfo inoutInfo) { if (mActivity.mDragController.isSystemDragInProgress()) { inoutInfo.touchableRegion.setEmpty(); inoutInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION); } } } }