Search in sources :

Example 1 with AnimatorListeners.forEndCallback

use of com.android.launcher3.anim.AnimatorListeners.forEndCallback in project android_packages_apps_404Launcher by P-404.

the class Launcher method onInitialBindComplete.

@Override
@TargetApi(Build.VERSION_CODES.S)
public void onInitialBindComplete(IntSet boundPages, RunnableList pendingTasks) {
    mSynchronouslyBoundPages = boundPages;
    mPagesToBindSynchronously = new IntSet();
    clearPendingBinds();
    ViewOnDrawExecutor executor = new ViewOnDrawExecutor(pendingTasks);
    mPendingExecutor = executor;
    if (!isInState(ALL_APPS)) {
        mAppsView.getAppsStore().enableDeferUpdates(AllAppsStore.DEFER_UPDATES_NEXT_DRAW);
        pendingTasks.add(() -> mAppsView.getAppsStore().disableDeferUpdates(AllAppsStore.DEFER_UPDATES_NEXT_DRAW));
    }
    AlphaProperty property = mDragLayer.getAlphaProperty(ALPHA_INDEX_LAUNCHER_LOAD);
    if (property.getValue() < 1) {
        ObjectAnimator anim = ObjectAnimator.ofFloat(property, MultiValueAlpha.VALUE, 1);
        anim.addListener(AnimatorListeners.forEndCallback(executor::onLoadAnimationCompleted));
        anim.start();
    } else {
        executor.onLoadAnimationCompleted();
    }
    executor.attachTo(this);
    if (Utilities.ATLEAST_S) {
        Trace.endAsyncSection(DISPLAY_WORKSPACE_TRACE_METHOD_NAME, DISPLAY_WORKSPACE_TRACE_COOKIE);
    }
}
Also used : AlphaProperty(com.android.launcher3.util.MultiValueAlpha.AlphaProperty) IntSet(com.android.launcher3.util.IntSet) ObjectAnimator(android.animation.ObjectAnimator) ViewOnDrawExecutor(com.android.launcher3.util.ViewOnDrawExecutor) TargetApi(android.annotation.TargetApi)

Example 2 with AnimatorListeners.forEndCallback

use of com.android.launcher3.anim.AnimatorListeners.forEndCallback in project android_packages_apps_Launcher3 by AOSPA.

the class Launcher method onInitialBindComplete.

@Override
@TargetApi(Build.VERSION_CODES.S)
public void onInitialBindComplete(IntSet boundPages, RunnableList pendingTasks) {
    mSynchronouslyBoundPages = boundPages;
    mPagesToBindSynchronously = new IntSet();
    clearPendingBinds();
    ViewOnDrawExecutor executor = new ViewOnDrawExecutor(pendingTasks);
    mPendingExecutor = executor;
    if (!isInState(ALL_APPS)) {
        mAppsView.getAppsStore().enableDeferUpdates(AllAppsStore.DEFER_UPDATES_NEXT_DRAW);
        pendingTasks.add(() -> mAppsView.getAppsStore().disableDeferUpdates(AllAppsStore.DEFER_UPDATES_NEXT_DRAW));
    }
    AlphaProperty property = mDragLayer.getAlphaProperty(ALPHA_INDEX_LAUNCHER_LOAD);
    if (property.getValue() < 1) {
        ObjectAnimator anim = ObjectAnimator.ofFloat(property, MultiValueAlpha.VALUE, 1);
        anim.addListener(AnimatorListeners.forEndCallback(executor::onLoadAnimationCompleted));
        anim.start();
    } else {
        executor.onLoadAnimationCompleted();
    }
    executor.attachTo(this);
    if (Utilities.ATLEAST_S) {
        Trace.endAsyncSection(DISPLAY_WORKSPACE_TRACE_METHOD_NAME, DISPLAY_WORKSPACE_TRACE_COOKIE);
    }
}
Also used : AlphaProperty(com.android.launcher3.util.MultiValueAlpha.AlphaProperty) IntSet(com.android.launcher3.util.IntSet) ObjectAnimator(android.animation.ObjectAnimator) ViewOnDrawExecutor(com.android.launcher3.util.ViewOnDrawExecutor) TargetApi(android.annotation.TargetApi)

Example 3 with AnimatorListeners.forEndCallback

use of com.android.launcher3.anim.AnimatorListeners.forEndCallback in project android_packages_apps_Launcher3 by ArrowOS.

the class Launcher method onInitialBindComplete.

@Override
@TargetApi(Build.VERSION_CODES.S)
public void onInitialBindComplete(IntSet boundPages, RunnableList pendingTasks) {
    mSynchronouslyBoundPages = boundPages;
    mPagesToBindSynchronously = new IntSet();
    clearPendingBinds();
    ViewOnDrawExecutor executor = new ViewOnDrawExecutor(pendingTasks);
    mPendingExecutor = executor;
    if (!isInState(ALL_APPS)) {
        mAppsView.getAppsStore().enableDeferUpdates(AllAppsStore.DEFER_UPDATES_NEXT_DRAW);
        pendingTasks.add(() -> mAppsView.getAppsStore().disableDeferUpdates(AllAppsStore.DEFER_UPDATES_NEXT_DRAW));
    }
    AlphaProperty property = mDragLayer.getAlphaProperty(ALPHA_INDEX_LAUNCHER_LOAD);
    if (property.getValue() < 1) {
        ObjectAnimator anim = ObjectAnimator.ofFloat(property, MultiValueAlpha.VALUE, 1);
        anim.addListener(AnimatorListeners.forEndCallback(executor::onLoadAnimationCompleted));
        anim.start();
    } else {
        executor.onLoadAnimationCompleted();
    }
    executor.attachTo(this);
    if (Utilities.ATLEAST_S) {
        Trace.endAsyncSection(DISPLAY_WORKSPACE_TRACE_METHOD_NAME, DISPLAY_WORKSPACE_TRACE_COOKIE);
    }
}
Also used : AlphaProperty(com.android.launcher3.util.MultiValueAlpha.AlphaProperty) IntSet(com.android.launcher3.util.IntSet) ObjectAnimator(android.animation.ObjectAnimator) ViewOnDrawExecutor(com.android.launcher3.util.ViewOnDrawExecutor) TargetApi(android.annotation.TargetApi)

Example 4 with AnimatorListeners.forEndCallback

use of com.android.launcher3.anim.AnimatorListeners.forEndCallback in project android_packages_apps_Launcher3 by ProtonAOSP.

the class Launcher method onInitialBindComplete.

@Override
@TargetApi(Build.VERSION_CODES.S)
public void onInitialBindComplete(IntSet boundPages, RunnableList pendingTasks) {
    mSynchronouslyBoundPages = boundPages;
    mPagesToBindSynchronously = new IntSet();
    clearPendingBinds();
    ViewOnDrawExecutor executor = new ViewOnDrawExecutor(pendingTasks);
    mPendingExecutor = executor;
    if (!isInState(ALL_APPS)) {
        mAppsView.getAppsStore().enableDeferUpdates(AllAppsStore.DEFER_UPDATES_NEXT_DRAW);
        pendingTasks.add(() -> mAppsView.getAppsStore().disableDeferUpdates(AllAppsStore.DEFER_UPDATES_NEXT_DRAW));
    }
    AlphaProperty property = mDragLayer.getAlphaProperty(ALPHA_INDEX_LAUNCHER_LOAD);
    if (property.getValue() < 1) {
        ObjectAnimator anim = ObjectAnimator.ofFloat(property, MultiValueAlpha.VALUE, 1);
        anim.addListener(AnimatorListeners.forEndCallback(executor::onLoadAnimationCompleted));
        anim.start();
    } else {
        executor.onLoadAnimationCompleted();
    }
    executor.attachTo(this);
    if (Utilities.ATLEAST_S) {
        Trace.endAsyncSection(DISPLAY_WORKSPACE_TRACE_METHOD_NAME, DISPLAY_WORKSPACE_TRACE_COOKIE);
    }
}
Also used : AlphaProperty(com.android.launcher3.util.MultiValueAlpha.AlphaProperty) IntSet(com.android.launcher3.util.IntSet) ObjectAnimator(android.animation.ObjectAnimator) ViewOnDrawExecutor(com.android.launcher3.util.ViewOnDrawExecutor) TargetApi(android.annotation.TargetApi)

Aggregations

ObjectAnimator (android.animation.ObjectAnimator)4 TargetApi (android.annotation.TargetApi)4 IntSet (com.android.launcher3.util.IntSet)4 AlphaProperty (com.android.launcher3.util.MultiValueAlpha.AlphaProperty)4 ViewOnDrawExecutor (com.android.launcher3.util.ViewOnDrawExecutor)4