Search in sources :

Example 1 with SystemUiProxy

use of com.android.quickstep.SystemUiProxy in project android_packages_apps_Launcher3 by crdroidandroid.

the class RecentsView method finishRecentsAnimation.

public void finishRecentsAnimation(boolean toRecents, boolean shouldPip, Runnable onFinishComplete) {
    if (!toRecents && ENABLE_QUICKSTEP_LIVE_TILE.get()) {
        // Reset the minimized state since we force-toggled the minimized state when entering
        // overview, but never actually finished the recents animation.  This is a catch all for
        // cases where we haven't already reset it.
        SystemUiProxy p = SystemUiProxy.INSTANCE.getNoCreate();
        if (p != null) {
            p.setSplitScreenMinimized(false);
        }
    }
    if (mRecentsAnimationController == null) {
        if (onFinishComplete != null) {
            onFinishComplete.run();
        }
        return;
    }
    final boolean sendUserLeaveHint = toRecents && shouldPip;
    if (sendUserLeaveHint) {
        // Notify the SysUI to use fade-in animation when entering PiP from live tile.
        final SystemUiProxy systemUiProxy = SystemUiProxy.INSTANCE.get(getContext());
        systemUiProxy.notifySwipeToHomeFinished();
        systemUiProxy.setShelfHeight(true, mActivity.getDeviceProfile().hotseatBarSizePx);
    }
    mRecentsAnimationController.finish(toRecents, () -> {
        if (onFinishComplete != null) {
            onFinishComplete.run();
        }
        onRecentsAnimationComplete();
    }, sendUserLeaveHint);
}
Also used : SystemUiProxy(com.android.quickstep.SystemUiProxy)

Example 2 with SystemUiProxy

use of com.android.quickstep.SystemUiProxy in project android_packages_apps_Launcher3 by crdroidandroid.

the class TaskView method onClick.

private void onClick(View view) {
    if (getTask() == null) {
        return;
    }
    if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask()) {
        if (!mIsClickableAsLiveTile) {
            return;
        }
        // Reset the minimized state since we force-toggled the minimized state when entering
        // overview, but never actually finished the recents animation
        SystemUiProxy p = SystemUiProxy.INSTANCE.getNoCreate();
        if (p != null) {
            p.setSplitScreenMinimized(false);
        }
        mIsClickableAsLiveTile = false;
        RecentsView recentsView = getRecentsView();
        final RemoteAnimationTargets targets = recentsView.getLiveTileParams().getTargetSet();
        if (targets == null) {
            // If the recents animation is cancelled somehow between the parent if block and
            // here, try to launch the task as a non live tile task.
            launcherNonLiveTileTask();
            return;
        }
        AnimatorSet anim = new AnimatorSet();
        TaskViewUtils.composeRecentsLaunchAnimator(anim, this, targets.apps, targets.wallpapers, targets.nonApps, true, /* launcherClosing */
        mActivity.getStateManager(), recentsView, recentsView.getDepthController());
        anim.addListener(new AnimatorListenerAdapter() {

            @Override
            public void onAnimationStart(Animator animator) {
                recentsView.getLiveTileTaskViewSimulator().setDrawsBelowRecents(false);
            }

            @Override
            public void onAnimationEnd(Animator animator) {
                recentsView.getLiveTileTaskViewSimulator().setDrawsBelowRecents(true);
                mIsClickableAsLiveTile = true;
            }
        });
        anim.start();
    } else {
        launcherNonLiveTileTask();
    }
    mActivity.getStatsLogManager().logger().withItemInfo(getItemInfo()).log(LAUNCHER_TASK_LAUNCH_TAP);
}
Also used : Animator(android.animation.Animator) ObjectAnimator(android.animation.ObjectAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) SystemUiProxy(com.android.quickstep.SystemUiProxy) RemoteAnimationTargets(com.android.quickstep.RemoteAnimationTargets) AnimatorSet(android.animation.AnimatorSet)

Aggregations

SystemUiProxy (com.android.quickstep.SystemUiProxy)2 Animator (android.animation.Animator)1 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)1 AnimatorSet (android.animation.AnimatorSet)1 ObjectAnimator (android.animation.ObjectAnimator)1 RemoteAnimationTargets (com.android.quickstep.RemoteAnimationTargets)1