Loading quickstep/src/com/android/launcher3/taskbar/BaseTaskbarContext.java +0 −11 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ import android.content.Context; import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DeviceProfile.DeviceProfileListenable; import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener; import com.android.launcher3.util.Themes; Loading @@ -36,8 +35,6 @@ public abstract class BaseTaskbarContext extends ContextThemeWrapper implements protected final LayoutInflater mLayoutInflater; private final List<OnDeviceProfileChangeListener> mDPChangeListeners = new ArrayList<>(); protected DeviceProfile mDeviceProfile; public BaseTaskbarContext(Context windowContext) { super(windowContext, Themes.getActivityThemeRes(windowContext)); mLayoutInflater = LayoutInflater.from(this).cloneInContext(this); Loading @@ -48,19 +45,11 @@ public abstract class BaseTaskbarContext extends ContextThemeWrapper implements return mLayoutInflater; } @Override public final DeviceProfile getDeviceProfile() { return mDeviceProfile; } @Override public final List<OnDeviceProfileChangeListener> getOnDeviceProfileChangeListeners() { return mDPChangeListeners; } /** Updates the {@link DeviceProfile} instance to the latest representation of the screen. */ public abstract void updateDeviceProfile(DeviceProfile dp); /** Callback invoked when a drag is initiated within this context. */ public abstract void onDragStart(); Loading quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +1 −1 Original line number Diff line number Diff line Loading @@ -522,7 +522,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT if (button.getVisibility() == View.VISIBLE) { parent.getDescendantRectRelativeToSelf(button, mTempRect); if (mHitboxExtender.extendedHitboxEnabled()) { mTempRect.bottom += mContext.mDeviceProfile.getTaskbarOffsetY(); mTempRect.bottom += mContext.getDeviceProfile().getTaskbarOffsetY(); } outRegion.op(mTempRect, Op.UNION); } Loading quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +10 −4 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { private final WindowManager mWindowManager; private final @Nullable RoundedCorner mLeftCorner, mRightCorner; private DeviceProfile mDeviceProfile; private WindowManager.LayoutParams mWindowLayoutParams; private boolean mIsFullscreen; // The size we should return to when we call setTaskbarWindowFullscreen(false) Loading @@ -135,7 +136,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { TaskbarNavButtonController buttonController, ScopedUnfoldTransitionProgressProvider unfoldTransitionProgressProvider) { super(windowContext); mDeviceProfile = dp; mDeviceProfile = dp.copy(this); final Resources resources = getResources(); Loading Loading @@ -198,7 +199,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { new TaskbarAutohideSuspendController(this), new TaskbarPopupController(this), new TaskbarForceVisibleImmersiveController(this), new TaskbarAllAppsController(this), new TaskbarAllAppsController(this, dp), new TaskbarInsetsController(this)); } Loading @@ -214,8 +215,14 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } @Override public DeviceProfile getDeviceProfile() { return mDeviceProfile; } /** Updates {@link DeviceProfile} instances for any Taskbar windows. */ public void updateDeviceProfile(DeviceProfile dp) { mDeviceProfile = dp; mControllers.taskbarAllAppsController.updateDeviceProfile(dp); mDeviceProfile = dp.copy(this); updateIconSize(getResources()); AbstractFloatingView.closeAllOpenViewsExcept(this, false, TYPE_REBIND_SAFE); Loading @@ -230,7 +237,6 @@ public class TaskbarActivityContext extends BaseTaskbarContext { mDeviceProfile.updateIconSize(1, resources); float iconScale = taskbarIconSize / mDeviceProfile.iconSizePx; mDeviceProfile.updateIconSize(iconScale, resources); mDeviceProfile.updateAllAppsIconSize(1, resources); // Leave all apps unscaled. } @VisibleForTesting Loading quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ public class TaskbarManager { // Config change might be handled without re-creating the taskbar if (mTaskbarActivityContext != null) { if (dp != null && dp.isTaskbarPresent) { mTaskbarActivityContext.updateDeviceProfile(dp.copy(mContext)); mTaskbarActivityContext.updateDeviceProfile(dp); } mTaskbarActivityContext.onConfigurationChanged(configDiff); } Loading Loading @@ -274,8 +274,8 @@ public class TaskbarManager { return; } mTaskbarActivityContext = new TaskbarActivityContext(mContext, dp.copy(mContext), mNavButtonController, mUnfoldProgressProvider); mTaskbarActivityContext = new TaskbarActivityContext(mContext, dp, mNavButtonController, mUnfoldProgressProvider); mTaskbarActivityContext.init(mSharedState); if (mActivity != null) { Loading quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java +6 −12 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ 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.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE; import static com.android.systemui.shared.system.ViewTreeObserverWrapper.InsetsInfo.TOUCHABLE_INSETS_REGION; import android.content.Context; Loading Loading @@ -78,14 +77,13 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { TaskbarStashController taskbarStashController) { super(taskbarContext.createWindowContext(TYPE_APPLICATION_OVERLAY, null)); mTaskbarContext = taskbarContext; mDeviceProfile = taskbarContext.getDeviceProfile(); mWindowController = windowController; mDragController = new TaskbarDragController(this); mOnboardingPrefs = new OnboardingPrefs<>(this, Utilities.getPrefs(this)); mDragLayer = new TaskbarAllAppsDragLayer(this); TaskbarAllAppsSlideInView slideInView = (TaskbarAllAppsSlideInView) mLayoutInflater.inflate( R.layout.taskbar_all_apps, mDragLayer, false); mWindowController = windowController; mAllAppsViewController = new TaskbarAllAppsViewController( this, slideInView, Loading @@ -101,6 +99,11 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { return mAllAppsViewController; } @Override public DeviceProfile getDeviceProfile() { return mWindowController.getDeviceProfile(); } @Override public TaskbarDragController getDragController() { return mDragController; Loading Loading @@ -141,15 +144,6 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { return mTaskbarContext.getDotInfoForItem(info); } @Override public void updateDeviceProfile(DeviceProfile dp) { mDeviceProfile = dp; AbstractFloatingView.closeAllOpenViewsExcept(this, false, TYPE_REBIND_SAFE); dispatchDeviceProfileChanged(); } @Override public void onDragStart() {} Loading Loading
quickstep/src/com/android/launcher3/taskbar/BaseTaskbarContext.java +0 −11 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ import android.content.Context; import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DeviceProfile.DeviceProfileListenable; import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener; import com.android.launcher3.util.Themes; Loading @@ -36,8 +35,6 @@ public abstract class BaseTaskbarContext extends ContextThemeWrapper implements protected final LayoutInflater mLayoutInflater; private final List<OnDeviceProfileChangeListener> mDPChangeListeners = new ArrayList<>(); protected DeviceProfile mDeviceProfile; public BaseTaskbarContext(Context windowContext) { super(windowContext, Themes.getActivityThemeRes(windowContext)); mLayoutInflater = LayoutInflater.from(this).cloneInContext(this); Loading @@ -48,19 +45,11 @@ public abstract class BaseTaskbarContext extends ContextThemeWrapper implements return mLayoutInflater; } @Override public final DeviceProfile getDeviceProfile() { return mDeviceProfile; } @Override public final List<OnDeviceProfileChangeListener> getOnDeviceProfileChangeListeners() { return mDPChangeListeners; } /** Updates the {@link DeviceProfile} instance to the latest representation of the screen. */ public abstract void updateDeviceProfile(DeviceProfile dp); /** Callback invoked when a drag is initiated within this context. */ public abstract void onDragStart(); Loading
quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +1 −1 Original line number Diff line number Diff line Loading @@ -522,7 +522,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT if (button.getVisibility() == View.VISIBLE) { parent.getDescendantRectRelativeToSelf(button, mTempRect); if (mHitboxExtender.extendedHitboxEnabled()) { mTempRect.bottom += mContext.mDeviceProfile.getTaskbarOffsetY(); mTempRect.bottom += mContext.getDeviceProfile().getTaskbarOffsetY(); } outRegion.op(mTempRect, Op.UNION); } Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +10 −4 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { private final WindowManager mWindowManager; private final @Nullable RoundedCorner mLeftCorner, mRightCorner; private DeviceProfile mDeviceProfile; private WindowManager.LayoutParams mWindowLayoutParams; private boolean mIsFullscreen; // The size we should return to when we call setTaskbarWindowFullscreen(false) Loading @@ -135,7 +136,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { TaskbarNavButtonController buttonController, ScopedUnfoldTransitionProgressProvider unfoldTransitionProgressProvider) { super(windowContext); mDeviceProfile = dp; mDeviceProfile = dp.copy(this); final Resources resources = getResources(); Loading Loading @@ -198,7 +199,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { new TaskbarAutohideSuspendController(this), new TaskbarPopupController(this), new TaskbarForceVisibleImmersiveController(this), new TaskbarAllAppsController(this), new TaskbarAllAppsController(this, dp), new TaskbarInsetsController(this)); } Loading @@ -214,8 +215,14 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } @Override public DeviceProfile getDeviceProfile() { return mDeviceProfile; } /** Updates {@link DeviceProfile} instances for any Taskbar windows. */ public void updateDeviceProfile(DeviceProfile dp) { mDeviceProfile = dp; mControllers.taskbarAllAppsController.updateDeviceProfile(dp); mDeviceProfile = dp.copy(this); updateIconSize(getResources()); AbstractFloatingView.closeAllOpenViewsExcept(this, false, TYPE_REBIND_SAFE); Loading @@ -230,7 +237,6 @@ public class TaskbarActivityContext extends BaseTaskbarContext { mDeviceProfile.updateIconSize(1, resources); float iconScale = taskbarIconSize / mDeviceProfile.iconSizePx; mDeviceProfile.updateIconSize(iconScale, resources); mDeviceProfile.updateAllAppsIconSize(1, resources); // Leave all apps unscaled. } @VisibleForTesting Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ public class TaskbarManager { // Config change might be handled without re-creating the taskbar if (mTaskbarActivityContext != null) { if (dp != null && dp.isTaskbarPresent) { mTaskbarActivityContext.updateDeviceProfile(dp.copy(mContext)); mTaskbarActivityContext.updateDeviceProfile(dp); } mTaskbarActivityContext.onConfigurationChanged(configDiff); } Loading Loading @@ -274,8 +274,8 @@ public class TaskbarManager { return; } mTaskbarActivityContext = new TaskbarActivityContext(mContext, dp.copy(mContext), mNavButtonController, mUnfoldProgressProvider); mTaskbarActivityContext = new TaskbarActivityContext(mContext, dp, mNavButtonController, mUnfoldProgressProvider); mTaskbarActivityContext.init(mSharedState); if (mActivity != null) { Loading
quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsContext.java +6 −12 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ 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.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE; import static com.android.systemui.shared.system.ViewTreeObserverWrapper.InsetsInfo.TOUCHABLE_INSETS_REGION; import android.content.Context; Loading Loading @@ -78,14 +77,13 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { TaskbarStashController taskbarStashController) { super(taskbarContext.createWindowContext(TYPE_APPLICATION_OVERLAY, null)); mTaskbarContext = taskbarContext; mDeviceProfile = taskbarContext.getDeviceProfile(); mWindowController = windowController; mDragController = new TaskbarDragController(this); mOnboardingPrefs = new OnboardingPrefs<>(this, Utilities.getPrefs(this)); mDragLayer = new TaskbarAllAppsDragLayer(this); TaskbarAllAppsSlideInView slideInView = (TaskbarAllAppsSlideInView) mLayoutInflater.inflate( R.layout.taskbar_all_apps, mDragLayer, false); mWindowController = windowController; mAllAppsViewController = new TaskbarAllAppsViewController( this, slideInView, Loading @@ -101,6 +99,11 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { return mAllAppsViewController; } @Override public DeviceProfile getDeviceProfile() { return mWindowController.getDeviceProfile(); } @Override public TaskbarDragController getDragController() { return mDragController; Loading Loading @@ -141,15 +144,6 @@ class TaskbarAllAppsContext extends BaseTaskbarContext { return mTaskbarContext.getDotInfoForItem(info); } @Override public void updateDeviceProfile(DeviceProfile dp) { mDeviceProfile = dp; AbstractFloatingView.closeAllOpenViewsExcept(this, false, TYPE_REBIND_SAFE); dispatchDeviceProfileChanged(); } @Override public void onDragStart() {} Loading