Search in sources :

Example 51 with Overview

use of com.android.launcher3.tapl.Overview in project Neo-Launcher by NeoApplications.

the class TaplTestsQuickstep method testOverview.

@Test
@PortraitLandscape
public void testOverview() throws Exception {
    startTestApps();
    Overview overview = mLauncher.pressHome().switchToOverview();
    assertTrue("Launcher internal state didn't switch to Overview", isInState(LauncherState.OVERVIEW));
    executeOnLauncher(launcher -> assertTrue("Don't have at least 3 tasks", getTaskCount(launcher) >= 3));
    // Test flinging forward and backward.
    executeOnLauncher(launcher -> assertEquals("Current task in Overview is not 0", 0, getCurrentOverviewPage(launcher)));
    overview.flingForward();
    assertTrue("Launcher internal state is not Overview", isInState(LauncherState.OVERVIEW));
    final Integer currentTaskAfterFlingForward = getFromLauncher(launcher -> getCurrentOverviewPage(launcher));
    executeOnLauncher(launcher -> assertTrue("Current task in Overview is still 0", currentTaskAfterFlingForward > 0));
    overview.flingBackward();
    assertTrue("Launcher internal state is not Overview", isInState(LauncherState.OVERVIEW));
    executeOnLauncher(launcher -> assertTrue("Flinging back in Overview did nothing", getCurrentOverviewPage(launcher) < currentTaskAfterFlingForward));
    // Test opening a task.
    OverviewTask task = mLauncher.pressHome().switchToOverview().getCurrentTask();
    assertNotNull("overview.getCurrentTask() returned null (1)", task);
    assertNotNull("OverviewTask.open returned null", task.open());
    assertTrue("Test activity didn't open from Overview", mDevice.wait(Until.hasObject(By.pkg(getAppPackageName()).text("TestActivity2")), DEFAULT_UI_TIMEOUT));
    executeOnLauncher(launcher -> assertTrue("Launcher activity is the top activity; expecting another activity to be the top " + "one", isInBackground(launcher)));
    // Test dismissing a task.
    overview = mLauncher.pressHome().switchToOverview();
    assertTrue("Launcher internal state didn't switch to Overview", isInState(LauncherState.OVERVIEW));
    final Integer numTasks = getFromLauncher(launcher -> getTaskCount(launcher));
    task = overview.getCurrentTask();
    assertNotNull("overview.getCurrentTask() returned null (2)", task);
    task.dismiss();
    executeOnLauncher(launcher -> assertEquals("Dismissing a task didn't remove 1 task from Overview", numTasks - 1, getTaskCount(launcher)));
    if (!TestHelpers.isInLauncherProcess() || getFromLauncher(launcher -> !launcher.getDeviceProfile().isLandscape)) {
        // Test switching to all apps and back.
        final AllAppsFromOverview allApps = overview.switchToAllApps();
        assertNotNull("overview.switchToAllApps() returned null (1)", allApps);
        assertTrue("Launcher internal state is not All Apps (1)", isInState(LauncherState.ALL_APPS));
        overview = allApps.switchBackToOverview();
        assertNotNull("allApps.switchBackToOverview() returned null", overview);
        assertTrue("Launcher internal state didn't switch to Overview", isInState(LauncherState.OVERVIEW));
        // Test UIDevice.pressBack()
        overview.switchToAllApps();
        assertNotNull("overview.switchToAllApps() returned null (2)", allApps);
        assertTrue("Launcher internal state is not All Apps (2)", isInState(LauncherState.ALL_APPS));
        mDevice.pressBack();
        mLauncher.getOverview();
    }
    // Test UIDevice.pressHome, once we are in AllApps.
    mDevice.pressHome();
    waitForState("Launcher internal state didn't switch to Home", LauncherState.NORMAL);
    // Test dismissing all tasks.
    mLauncher.getWorkspace().switchToOverview().dismissAllTasks();
    waitForState("Launcher internal state didn't switch to Home", LauncherState.NORMAL);
    executeOnLauncher(launcher -> assertEquals("Still have tasks after dismissing all", 0, getTaskCount(launcher)));
}
Also used : AndroidJUnit4(androidx.test.runner.AndroidJUnit4) Background(com.android.launcher3.tapl.Background) Overview(com.android.launcher3.tapl.Overview) TaplTestsLauncher3(com.android.launcher3.ui.TaplTestsLauncher3) RunWith(org.junit.runner.RunWith) Intent(android.content.Intent) RemoteException(android.os.RemoteException) By(androidx.test.uiautomator.By) TestHelpers(com.android.launcher3.tapl.TestHelpers) AllAppsFromOverview(com.android.launcher3.tapl.AllAppsFromOverview) NavigationModel(com.android.launcher3.tapl.LauncherInstrumentation.NavigationModel) AllApps(com.android.launcher3.tapl.AllApps) LargeTest(androidx.test.filters.LargeTest) Until(androidx.test.uiautomator.Until) Before(org.junit.Before) OverviewTask(com.android.launcher3.tapl.OverviewTask) Launcher(com.android.launcher3.Launcher) Assert.assertNotNull(org.junit.Assert.assertNotNull) TaplTestsLauncher3.getAppPackageName(com.android.launcher3.ui.TaplTestsLauncher3.getAppPackageName) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) LauncherState(com.android.launcher3.LauncherState) Ignore(org.junit.Ignore) RecentsView(com.android.quickstep.views.RecentsView) Assert.assertEquals(org.junit.Assert.assertEquals) NavigationModeSwitch(com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch) OverviewTask(com.android.launcher3.tapl.OverviewTask) Overview(com.android.launcher3.tapl.Overview) AllAppsFromOverview(com.android.launcher3.tapl.AllAppsFromOverview) AllAppsFromOverview(com.android.launcher3.tapl.AllAppsFromOverview) LargeTest(androidx.test.filters.LargeTest) Test(org.junit.Test)

Example 52 with Overview

use of com.android.launcher3.tapl.Overview in project Neo-Launcher by NeoApplications.

the class Launcher method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    RaceConditionTracker.onEvent(ON_CREATE_EVT, ENTER);
    if (DEBUG_STRICT_MODE) {
        StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNetwork().penaltyLog().build());
        StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects().detectLeakedClosableObjects().penaltyLog().penaltyDeath().build());
    }
    TraceHelper.beginSection("Launcher-onCreate");
    super.onCreate(savedInstanceState);
    TraceHelper.partitionSection("Launcher-onCreate", "super call");
    LauncherAppState app = LauncherAppState.getInstance(this);
    OmegaPreferences prefs = Utilities.getOmegaPrefs(this);
    prefs.getDrawerGridSize();
    prefs.getGridSize();
    prefs.getDockGridSize();
    mOldConfig = new Configuration(getResources().getConfiguration());
    mModel = app.setLauncher(this);
    mRotationHelper = new RotationHelper(this);
    InvariantDeviceProfile idp = app.getInvariantDeviceProfile();
    initDeviceProfile(idp);
    idp.addOnChangeListener(this);
    mSharedPrefs = Utilities.getPrefs(this);
    mIconCache = app.getIconCache();
    mAccessibilityDelegate = new LauncherAccessibilityDelegate(this);
    mDragController = new DragController(this);
    mAllAppsController = new AllAppsTransitionController(this);
    mStateManager = new LauncherStateManager(this);
    UiFactory.onCreate(this);
    mAppWidgetManager = AppWidgetManagerCompat.getInstance(this);
    mAppWidgetHost = new LauncherAppWidgetHost(this, appWidgetId -> getWorkspace().removeWidget(appWidgetId));
    mAppWidgetHost.startListening();
    mLauncherView = LayoutInflater.from(this).inflate(R.layout.launcher, null);
    setupViews();
    mPopupDataProvider = new PopupDataProvider(this);
    mAppTransitionManager = LauncherAppTransitionManager.newInstance(this);
    boolean internalStateHandled = InternalStateHandler.handleCreate(this, getIntent());
    if (internalStateHandled) {
        if (savedInstanceState != null) {
            // InternalStateHandler has already set the appropriate state.
            // We dont need to do anything.
            savedInstanceState.remove(RUNTIME_STATE);
        }
    }
    restoreState(savedInstanceState);
    mStateManager.reapplyState();
    // We only load the page synchronously if the user rotates (or triggers a
    // configuration change) while launcher is in the foreground
    int currentScreen = PagedView.INVALID_RESTORE_PAGE;
    if (savedInstanceState != null) {
        currentScreen = savedInstanceState.getInt(RUNTIME_STATE_CURRENT_SCREEN, currentScreen);
    }
    if (!mModel.startLoader(currentScreen)) {
        if (!internalStateHandled) {
            // If we are not binding synchronously, show a fade in animation when
            // the first page bind completes.
            mDragLayer.getAlphaProperty(ALPHA_INDEX_LAUNCHER_LOAD).setValue(0);
        }
    } else {
        // Pages bound synchronously.
        mWorkspace.setCurrentPage(currentScreen);
        setWorkspaceLoading(true);
    }
    // For handling default keys
    setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
    setContentView(mLauncherView);
    getRootView().dispatchInsets();
    // Listen for broadcasts
    registerReceiver(mScreenOffReceiver, new IntentFilter(Intent.ACTION_SCREEN_OFF));
    getSystemUiController().updateUiState(SystemUiController.UI_STATE_BASE_WINDOW, Themes.getAttrBoolean(this, R.attr.isWorkspaceDarkText));
    if (mLauncherCallbacks != null) {
        mLauncherCallbacks.onCreate(savedInstanceState);
    }
    mRotationHelper.initialize();
    TraceHelper.endSection("Launcher-onCreate");
    RaceConditionTracker.onEvent(ON_CREATE_EVT, EXIT);
    mStateManager.addStateListener(new LauncherStateManager.StateListener() {

        @Override
        public void onStateTransitionStart(LauncherState toState) {
        }

        @Override
        public void onStateTransitionComplete(LauncherState finalState) {
            float alpha = 1f - mCurrentAssistantVisibility;
            if (finalState == NORMAL) {
                mAppsView.getAlphaProperty(APPS_VIEW_ALPHA_CHANNEL_INDEX).setValue(alpha);
            } else if (finalState == OVERVIEW || finalState == OVERVIEW_PEEK) {
                mAppsView.getAlphaProperty(APPS_VIEW_ALPHA_CHANNEL_INDEX).setValue(alpha);
                mScrimView.getAlphaProperty(SCRIM_VIEW_ALPHA_CHANNEL_INDEX).setValue(alpha);
            } else {
                mAppsView.getAlphaProperty(APPS_VIEW_ALPHA_CHANNEL_INDEX).setValue(1f);
                mScrimView.getAlphaProperty(SCRIM_VIEW_ALPHA_CHANNEL_INDEX).setValue(1f);
            }
        }
    });
}
Also used : Bundle(android.os.Bundle) AllAppsTransitionController(com.android.launcher3.allapps.AllAppsTransitionController) ViewOnDrawExecutor(com.android.launcher3.util.ViewOnDrawExecutor) PendingAddWidgetInfo(com.android.launcher3.widget.PendingAddWidgetInfo) CustomActionsPopup(com.android.launcher3.keyboard.CustomActionsPopup) CONFIG_ORIENTATION(android.content.pm.ActivityInfo.CONFIG_ORIENTATION) OVERVIEW(com.android.launcher3.LauncherState.OVERVIEW) CustomWidgetParser(com.android.launcher3.widget.custom.CustomWidgetParser) Process(android.os.Process) SQLiteDatabase(android.database.sqlite.SQLiteDatabase) Handler(android.os.Handler) Display(android.view.Display) Target(com.android.launcher3.userevent.nano.LauncherLogProto.Target) AccessibilityEvent(android.view.accessibility.AccessibilityEvent) OmegaLauncher(com.saggitt.omega.OmegaLauncher) RotationMode(com.android.launcher3.graphics.RotationMode) TargetApi(android.annotation.TargetApi) Log(android.util.Log) OVERVIEW_PEEK(com.android.launcher3.LauncherState.OVERVIEW_PEEK) PrintWriter(java.io.PrintWriter) KeyboardShortcutInfo(android.view.KeyboardShortcutInfo) ALPHA_INDEX_LAUNCHER_LOAD(com.android.launcher3.dragndrop.DragLayer.ALPHA_INDEX_LAUNCHER_LOAD) IntentFilter(android.content.IntentFilter) AllAppsStore(com.android.launcher3.allapps.AllAppsStore) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) LauncherAccessibilityDelegate(com.android.launcher3.accessibility.LauncherAccessibilityDelegate) Nullable(androidx.annotation.Nullable) ShortcutUtil(com.android.launcher3.util.ShortcutUtil) LauncherAppWidgetHostView(com.android.launcher3.widget.LauncherAppWidgetHostView) ItemInfoMatcher(com.android.launcher3.util.ItemInfoMatcher) DiscoveryBounce(com.android.launcher3.allapps.DiscoveryBounce) TextKeyListener(android.text.method.TextKeyListener) PackageManagerHelper(com.android.launcher3.util.PackageManagerHelper) NORMAL(com.android.launcher3.LauncherState.NORMAL) LauncherLogProto(com.android.launcher3.userevent.nano.LauncherLogProto) TYPE_REBIND_SAFE(com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE) ViewGroupFocusHelper(com.android.launcher3.keyboard.ViewGroupFocusHelper) FileLog(com.android.launcher3.logging.FileLog) UserEventDispatcher(com.android.launcher3.logging.UserEventDispatcher) InternalStateHandler(com.android.launcher3.states.InternalStateHandler) SystemUiController(com.android.launcher3.util.SystemUiController) AppLaunchTracker(com.android.launcher3.model.AppLaunchTracker) ArrayList(java.util.ArrayList) IntentSender(android.content.IntentSender) REQUEST_NONE(com.android.launcher3.states.RotationHelper.REQUEST_NONE) AppWidgetHostView(android.appwidget.AppWidgetHostView) PendingRequestArgs(com.android.launcher3.util.PendingRequestArgs) Toast(android.widget.Toast) Menu(android.view.Menu) DragObject(com.android.launcher3.DropTarget.DragObject) TYPE_ALL(com.android.launcher3.AbstractFloatingView.TYPE_ALL) PopupDataProvider(com.android.launcher3.popup.PopupDataProvider) IntArray(com.android.launcher3.util.IntArray) Parcelable(android.os.Parcelable) ActivityContext(com.android.launcher3.views.ActivityContext) DragController(com.android.launcher3.dragndrop.DragController) TextUtils(android.text.TextUtils) FeatureFlags(com.android.launcher3.config.FeatureFlags) ItemClickHandler(com.android.launcher3.touch.ItemClickHandler) EXIT(com.android.launcher3.util.RaceConditionTracker.EXIT) AppWidgetManager(android.appwidget.AppWidgetManager) ComponentCallbacks2(android.content.ComponentCallbacks2) ENTER(com.android.launcher3.util.RaceConditionTracker.ENTER) FolderGridOrganizer(com.android.launcher3.folder.FolderGridOrganizer) SharedPreferences(android.content.SharedPreferences) Configuration(android.content.res.Configuration) ComponentKey(com.android.launcher3.util.ComponentKey) AlphaProperty(com.android.launcher3.util.MultiValueAlpha.AlphaProperty) ValueAnimator(android.animation.ValueAnimator) DotInfo(com.android.launcher3.dot.DotInfo) Rect(android.graphics.Rect) Callbacks(com.android.launcher3.model.BgDataModel.Callbacks) PackageManager(android.content.pm.PackageManager) SPRING_LOADED_EXIT_DELAY(com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_EXIT_DELAY) LauncherAppsCompatVO(com.android.launcher3.compat.LauncherAppsCompatVO) Animator(android.animation.Animator) IconCache(com.android.launcher3.icons.IconCache) OptionsPopupView(com.android.launcher3.views.OptionsPopupView) WidgetsFullSheet(com.android.launcher3.widget.WidgetsFullSheet) UiFactory(com.android.launcher3.uioverrides.UiFactory) ActivityOptions(android.app.ActivityOptions) KeyboardShortcutGroup(android.view.KeyboardShortcutGroup) RotationHelper(com.android.launcher3.states.RotationHelper) View(android.view.View) Predicate(java.util.function.Predicate) ObjectAnimator(android.animation.ObjectAnimator) Collection(java.util.Collection) PendingAppWidgetHostView(com.android.launcher3.widget.PendingAppWidgetHostView) BroadcastReceiver(android.content.BroadcastReceiver) ViewGroup(android.view.ViewGroup) MultiValueAlpha(com.android.launcher3.util.MultiValueAlpha) SparseArray(android.util.SparseArray) List(java.util.List) ALL_APPS(com.android.launcher3.LauncherState.ALL_APPS) NotificationListener(com.android.launcher3.notification.NotificationListener) OmegaPreferences(com.saggitt.omega.OmegaPreferences) ActivityNotFoundException(android.content.ActivityNotFoundException) WidgetHostViewLoader(com.android.launcher3.widget.WidgetHostViewLoader) FolderNameProvider(com.android.launcher3.folder.FolderNameProvider) AllAppsContainerView(com.android.launcher3.allapps.AllAppsContainerView) Themes(com.android.launcher3.util.Themes) ModelWriter(com.android.launcher3.model.ModelWriter) Context(android.content.Context) CONFIG_SCREEN_SIZE(android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE) KeyEvent(android.view.KeyEvent) ActivityResultInfo(com.android.launcher3.util.ActivityResultInfo) WidgetAddFlowHandler(com.android.launcher3.widget.WidgetAddFlowHandler) TYPE_SNACKBAR(com.android.launcher3.AbstractFloatingView.TYPE_SNACKBAR) FolderIcon(com.android.launcher3.folder.FolderIcon) Intent(android.content.Intent) HashMap(java.util.HashMap) UiThreadHelper(com.android.launcher3.util.UiThreadHelper) PopupContainerWithArrow(com.android.launcher3.popup.PopupContainerWithArrow) HashSet(java.util.HashSet) LoggerUtils.newTarget(com.android.launcher3.logging.LoggerUtils.newTarget) AnimatorSet(android.animation.AnimatorSet) DragLayer(com.android.launcher3.dragndrop.DragLayer) Build(android.os.Build) StatsLogUtils(com.android.launcher3.logging.StatsLogUtils) Action(com.android.launcher3.userevent.nano.LauncherLogProto.Action) ContainerType(com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType) LayoutInflater(android.view.LayoutInflater) PackageUserKey(com.android.launcher3.util.PackageUserKey) Point(android.graphics.Point) RaceConditionTracker(com.android.launcher3.util.RaceConditionTracker) AppWidgetManagerCompat(com.android.launcher3.compat.AppWidgetManagerCompat) WidgetListRowEntry(com.android.launcher3.widget.WidgetListRowEntry) PropertyListBuilder(com.android.launcher3.anim.PropertyListBuilder) PendingAddShortcutInfo(com.android.launcher3.widget.PendingAddShortcutInfo) StrictMode(android.os.StrictMode) OvershootInterpolator(android.view.animation.OvershootInterpolator) LoggerUtils.newContainerTarget(com.android.launcher3.logging.LoggerUtils.newContainerTarget) FileDescriptor(java.io.FileDescriptor) UserEventDelegate(com.android.launcher3.logging.UserEventDispatcher.UserEventDelegate) ScrimView(com.android.launcher3.views.ScrimView) Thunk(com.android.launcher3.util.Thunk) VisibleForTesting(androidx.annotation.VisibleForTesting) DragView(com.android.launcher3.dragndrop.DragView) TraceHelper(com.android.launcher3.util.TraceHelper) IntentFilter(android.content.IntentFilter) Configuration(android.content.res.Configuration) RotationHelper(com.android.launcher3.states.RotationHelper) PropertyListBuilder(com.android.launcher3.anim.PropertyListBuilder) PopupDataProvider(com.android.launcher3.popup.PopupDataProvider) OmegaPreferences(com.saggitt.omega.OmegaPreferences) Point(android.graphics.Point) StrictMode(android.os.StrictMode) AllAppsTransitionController(com.android.launcher3.allapps.AllAppsTransitionController) DragController(com.android.launcher3.dragndrop.DragController) LauncherAccessibilityDelegate(com.android.launcher3.accessibility.LauncherAccessibilityDelegate)

Example 53 with Overview

use of com.android.launcher3.tapl.Overview in project Neo-Launcher by NeoApplications.

the class DiscoveryBounce method showForOverviewIfNeeded.

private static void showForOverviewIfNeeded(Launcher launcher, boolean withDelay) {
    if (!launcher.isInState(OVERVIEW) || !launcher.hasBeenResumed() || launcher.isForceInvisible() || launcher.getDeviceProfile().isVerticalBarLayout() || (launcher.getSharedPrefs().getBoolean(SHELF_BOUNCE_SEEN, false) && !shouldShowForWorkProfile(launcher)) || UserManagerCompat.getInstance(launcher).isDemoUser() || Utilities.IS_RUNNING_IN_TEST_HARNESS) {
        return;
    }
    if (withDelay) {
        new Handler().postDelayed(() -> showForOverviewIfNeeded(launcher, false), DELAY_MS);
        return;
    } else if (InternalStateHandler.hasPending() || AbstractFloatingView.getTopOpenView(launcher) != null) {
        // TODO: Move these checks to the top and call this method after invalidate handler.
        return;
    }
    incrementShelfBounceCount(launcher);
    new DiscoveryBounce(launcher, (1 - OVERVIEW.getVerticalProgress(launcher))).show(PREDICTION);
}
Also used : InternalStateHandler(com.android.launcher3.states.InternalStateHandler) Handler(android.os.Handler)

Example 54 with Overview

use of com.android.launcher3.tapl.Overview in project Neo-Launcher by NeoApplications.

the class AbstractStateChangeTouchController method maybeUpdateAtomicAnim.

/**
 * When going between normal and overview states, see if we passed the overview threshold and
 * play the appropriate atomic animation if so.
 */
private void maybeUpdateAtomicAnim(LauncherState fromState, LauncherState toState, float progress) {
    if (!goingBetweenNormalAndOverview(fromState, toState)) {
        return;
    }
    float threshold = toState == OVERVIEW ? ATOMIC_OVERVIEW_ANIM_THRESHOLD : 1f - ATOMIC_OVERVIEW_ANIM_THRESHOLD;
    boolean passedThreshold = progress >= threshold;
    if (passedThreshold != mPassedOverviewAtomicThreshold) {
        LauncherState atomicFromState = passedThreshold ? fromState : toState;
        LauncherState atomicToState = passedThreshold ? toState : fromState;
        mPassedOverviewAtomicThreshold = passedThreshold;
        if (mAtomicAnim != null) {
            mAtomicAnim.cancel();
        }
        mAtomicAnim = createAtomicAnimForState(atomicFromState, atomicToState, ATOMIC_DURATION);
        mAtomicAnim.addListener(new AnimationSuccessListener() {

            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                mAtomicAnim = null;
                mScheduleResumeAtomicComponent = false;
            }

            @Override
            public void onAnimationSuccess(Animator animator) {
                if (!mScheduleResumeAtomicComponent) {
                    return;
                }
                cancelAtomicComponentsController();
                if (mCurrentAnimation != null) {
                    mAtomicComponentsStartProgress = mCurrentAnimation.getProgressFraction();
                    long duration = (long) (getShiftRange() * 2);
                    mAtomicComponentsController = AnimatorPlaybackController.wrap(createAtomicAnimForState(mFromState, mToState, duration), duration);
                    mAtomicComponentsController.dispatchOnStart();
                    mAtomicComponentsTargetState = mToState;
                    maybeAutoPlayAtomicComponentsAnim();
                }
            }
        });
        mAtomicAnim.start();
        mLauncher.getDragLayer().performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
    }
}
Also used : LauncherState(com.android.launcher3.LauncherState) Animator(android.animation.Animator) ValueAnimator(android.animation.ValueAnimator) AnimationSuccessListener(com.android.launcher3.anim.AnimationSuccessListener)

Example 55 with Overview

use of com.android.launcher3.tapl.Overview in project Neo-Launcher by NeoApplications.

the class ItemLongClickListener method onWorkspaceItemLongClick.

private static boolean onWorkspaceItemLongClick(View v) {
    Launcher launcher = Launcher.getLauncher(v.getContext());
    if (!canStartDrag(launcher))
        return false;
    if (!launcher.isInState(NORMAL) && !launcher.isInState(OVERVIEW))
        return false;
    if (!(v.getTag() instanceof ItemInfo))
        return false;
    launcher.setWaitingForResult(null);
    beginDrag(v, launcher, (ItemInfo) v.getTag(), new DragOptions());
    return true;
}
Also used : DragOptions(com.android.launcher3.dragndrop.DragOptions) ItemInfo(com.android.launcher3.ItemInfo) Launcher(com.android.launcher3.Launcher)

Aggregations

LauncherState (com.android.launcher3.LauncherState)53 Animator (android.animation.Animator)50 ValueAnimator (android.animation.ValueAnimator)42 StateAnimationConfig (com.android.launcher3.states.StateAnimationConfig)41 RecentsView (com.android.quickstep.views.RecentsView)40 AnimatorSet (android.animation.AnimatorSet)38 Launcher (com.android.launcher3.Launcher)36 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)34 ObjectAnimator (android.animation.ObjectAnimator)30 LargeTest (androidx.test.filters.LargeTest)29 Test (org.junit.Test)29 Point (android.graphics.Point)24 View (android.view.View)22 DeviceProfile (com.android.launcher3.DeviceProfile)19 PendingAnimation (com.android.launcher3.anim.PendingAnimation)19 RemoteAnimationTargetCompat (com.android.systemui.shared.system.RemoteAnimationTargetCompat)19 ItemInfo (com.android.launcher3.model.data.ItemInfo)18 DepthController (com.android.launcher3.statehandlers.DepthController)17 Task (com.android.systemui.shared.recents.model.Task)17 Rect (android.graphics.Rect)16