Exposing functionality to pin Taskbar from TaskbarDividerPopupView.
This CL allows user to long press on Taskbar divider view to bring up divider popup view. It also included functionality of allowing user to turn on always show taskbar from the divider popup view. Test: Manual Bug: 265436055 Bug: 265434718 Bug: 265434902 Bug: 265434705 Flag: ENABLE_TASKBAR_PINNING Change-Id: Ied54d718483a9b06b053d68988e5c294a786002a
This commit is contained in:
@@ -74,7 +74,8 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch
|
||||
TYPE_TASKBAR_EDUCATION_DIALOG,
|
||||
TYPE_TASKBAR_ALL_APPS,
|
||||
TYPE_ADD_TO_HOME_CONFIRMATION,
|
||||
TYPE_TASKBAR_OVERLAY_PROXY
|
||||
TYPE_TASKBAR_OVERLAY_PROXY,
|
||||
TYPE_TASKBAR_PINNING_POPUP
|
||||
})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface FloatingViewType {}
|
||||
@@ -102,6 +103,7 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch
|
||||
public static final int TYPE_TASKBAR_ALL_APPS = 1 << 18;
|
||||
public static final int TYPE_ADD_TO_HOME_CONFIRMATION = 1 << 19;
|
||||
public static final int TYPE_TASKBAR_OVERLAY_PROXY = 1 << 20;
|
||||
public static final int TYPE_TASKBAR_PINNING_POPUP = 1 << 21;
|
||||
|
||||
public static final int TYPE_ALL = TYPE_FOLDER | TYPE_ACTION_POPUP
|
||||
| TYPE_WIDGETS_BOTTOM_SHEET | TYPE_WIDGET_RESIZE_FRAME | TYPE_WIDGETS_FULL_SHEET
|
||||
@@ -110,7 +112,7 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch
|
||||
| TYPE_ICON_SURFACE | TYPE_DRAG_DROP_POPUP | TYPE_PIN_WIDGET_FROM_EXTERNAL_POPUP
|
||||
| TYPE_WIDGETS_EDUCATION_DIALOG | TYPE_TASKBAR_EDUCATION_DIALOG | TYPE_TASKBAR_ALL_APPS
|
||||
| TYPE_OPTIONS_POPUP_DIALOG | TYPE_ADD_TO_HOME_CONFIRMATION
|
||||
| TYPE_TASKBAR_OVERLAY_PROXY;
|
||||
| TYPE_TASKBAR_OVERLAY_PROXY | TYPE_TASKBAR_PINNING_POPUP;
|
||||
|
||||
// Type of popups which should be kept open during launcher rebind
|
||||
public static final int TYPE_REBIND_SAFE = TYPE_WIDGETS_FULL_SHEET
|
||||
|
||||
@@ -273,12 +273,15 @@ class LauncherPrefs(private val encryptedContext: Context) {
|
||||
|
||||
@JvmStatic fun get(context: Context): LauncherPrefs = INSTANCE.get(context)
|
||||
|
||||
const val TASKBAR_PINNING_KEY = "TASKBAR_PINNING_KEY"
|
||||
@JvmField val ICON_STATE = nonRestorableItem(LauncherAppState.KEY_ICON_STATE, "", true)
|
||||
@JvmField val THEMED_ICONS = backedUpItem(Themes.KEY_THEMED_ICONS, false, true)
|
||||
@JvmField val PROMISE_ICON_IDS = backedUpItem(InstallSessionHelper.PROMISE_ICON_IDS, "")
|
||||
@JvmField val WORK_EDU_STEP = backedUpItem(WorkProfileManager.KEY_WORK_EDU_STEP, 0)
|
||||
@JvmField val WORKSPACE_SIZE = backedUpItem(DeviceGridState.KEY_WORKSPACE_SIZE, "", true)
|
||||
@JvmField val HOTSEAT_COUNT = backedUpItem(DeviceGridState.KEY_HOTSEAT_COUNT, -1, true)
|
||||
@JvmField val TASKBAR_PINNING = backedUpItem(TASKBAR_PINNING_KEY, false)
|
||||
|
||||
@JvmField
|
||||
val DEVICE_TYPE =
|
||||
backedUpItem(DeviceGridState.KEY_DEVICE_TYPE, InvariantDeviceProfile.TYPE_PHONE, true)
|
||||
|
||||
@@ -19,9 +19,10 @@ import static android.content.Intent.ACTION_CONFIGURATION_CHANGED;
|
||||
import static android.view.Display.DEFAULT_DISPLAY;
|
||||
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
|
||||
|
||||
import static com.android.launcher3.LauncherPrefs.TASKBAR_PINNING;
|
||||
import static com.android.launcher3.Utilities.dpiFromPx;
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_PINNING;
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_TRANSIENT_TASKBAR;
|
||||
import static com.android.launcher3.config.FeatureFlags.FORCE_PERSISTENT_TASKBAR;
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
import static com.android.launcher3.util.FlagDebugUtils.appendFlag;
|
||||
import static com.android.launcher3.util.window.WindowManagerProxy.MIN_TABLET_WIDTH;
|
||||
@@ -45,6 +46,7 @@ import androidx.annotation.AnyThread;
|
||||
import androidx.annotation.UiThread;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.launcher3.LauncherPrefs;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.util.window.CachedDisplayInfo;
|
||||
import com.android.launcher3.util.window.WindowManagerProxy;
|
||||
@@ -101,9 +103,12 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable {
|
||||
private Info mInfo;
|
||||
private boolean mDestroyed = false;
|
||||
|
||||
private final LauncherPrefs mPrefs;
|
||||
|
||||
private DisplayController(Context context) {
|
||||
mContext = context;
|
||||
mDM = context.getSystemService(DisplayManager.class);
|
||||
mPrefs = LauncherPrefs.get(context);
|
||||
|
||||
Display display = mDM.getDisplay(DEFAULT_DISPLAY);
|
||||
if (Utilities.ATLEAST_S) {
|
||||
@@ -144,7 +149,9 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable {
|
||||
// TODO(b/258604917): When running in test harness, use !sTransientTaskbarStatusForTests
|
||||
// once tests are updated to expect new persistent behavior such as not allowing long press
|
||||
// to stash.
|
||||
if (!Utilities.isRunningInTestHarness() && FORCE_PERSISTENT_TASKBAR.get()) {
|
||||
if (!Utilities.isRunningInTestHarness()
|
||||
&& ENABLE_TASKBAR_PINNING.get()
|
||||
&& mPrefs.get(TASKBAR_PINNING)) {
|
||||
return false;
|
||||
}
|
||||
return getInfo().navigationMode == NavigationMode.NO_BUTTON
|
||||
|
||||
Reference in New Issue
Block a user