Search in sources :

Example 1 with ReferenceCountedTrigger

use of com.android.systemui.recents.misc.ReferenceCountedTrigger in project android_frameworks_base by ResurrectionRemix.

the class RecentsView method showStackActionButton.

/**
     * Shows the stack action button.
     */
private void showStackActionButton(final int duration, final boolean translate) {
    if (!RecentsDebugFlags.Static.EnableStackActionButton) {
        return;
    }
    if (!showClearAllRecents) {
        final ReferenceCountedTrigger postAnimationTrigger = new ReferenceCountedTrigger();
        if (mStackActionButton.getVisibility() == View.INVISIBLE) {
            mStackActionButton.setVisibility(View.VISIBLE);
            mStackActionButton.setAlpha(0f);
            if (translate) {
                mStackActionButton.setTranslationY(-mStackActionButton.getMeasuredHeight() * 0.25f);
            } else {
                mStackActionButton.setTranslationY(0f);
            }
            postAnimationTrigger.addLastDecrementRunnable(new Runnable() {

                @Override
                public void run() {
                    if (translate) {
                        mStackActionButton.animate().translationY(0f);
                    }
                    mStackActionButton.animate().alpha(1f).setDuration(duration).setInterpolator(Interpolators.FAST_OUT_SLOW_IN).start();
                }
            });
        }
        postAnimationTrigger.flushLastDecrementRunnables();
    } else {
        if (mStackActionButton != null) {
            boolean showing = mStackActionButton.getVisibility() == View.VISIBLE;
            if (showing)
                mStackActionButton.setVisibility(View.INVISIBLE);
        }
    }
}
Also used : ReferenceCountedTrigger(com.android.systemui.recents.misc.ReferenceCountedTrigger)

Example 2 with ReferenceCountedTrigger

use of com.android.systemui.recents.misc.ReferenceCountedTrigger in project android_frameworks_base by ResurrectionRemix.

the class RecentsView method hideStackActionButton.

/**
     * Hides the stack action button.
     */
private void hideStackActionButton(int duration, boolean translate) {
    if (!RecentsDebugFlags.Static.EnableStackActionButton) {
        return;
    }
    final ReferenceCountedTrigger postAnimationTrigger = new ReferenceCountedTrigger();
    hideStackActionButton(duration, translate, postAnimationTrigger);
    postAnimationTrigger.flushLastDecrementRunnables();
}
Also used : ReferenceCountedTrigger(com.android.systemui.recents.misc.ReferenceCountedTrigger)

Example 3 with ReferenceCountedTrigger

use of com.android.systemui.recents.misc.ReferenceCountedTrigger in project android_frameworks_base by AOSPA.

the class RecentsView method hideStackActionButton.

/**
     * Hides the stack action button.
     */
private void hideStackActionButton(int duration, boolean translate) {
    if (!RecentsDebugFlags.Static.EnableStackActionButton) {
        return;
    }
    final ReferenceCountedTrigger postAnimationTrigger = new ReferenceCountedTrigger();
    hideStackActionButton(duration, translate, postAnimationTrigger);
    postAnimationTrigger.flushLastDecrementRunnables();
}
Also used : ReferenceCountedTrigger(com.android.systemui.recents.misc.ReferenceCountedTrigger)

Example 4 with ReferenceCountedTrigger

use of com.android.systemui.recents.misc.ReferenceCountedTrigger in project platform_frameworks_base by android.

the class RecentsView method showStackActionButton.

/**
     * Shows the stack action button.
     */
private void showStackActionButton(final int duration, final boolean translate) {
    if (!RecentsDebugFlags.Static.EnableStackActionButton) {
        return;
    }
    final ReferenceCountedTrigger postAnimationTrigger = new ReferenceCountedTrigger();
    if (mStackActionButton.getVisibility() == View.INVISIBLE) {
        mStackActionButton.setVisibility(View.VISIBLE);
        mStackActionButton.setAlpha(0f);
        if (translate) {
            mStackActionButton.setTranslationY(-mStackActionButton.getMeasuredHeight() * 0.25f);
        } else {
            mStackActionButton.setTranslationY(0f);
        }
        postAnimationTrigger.addLastDecrementRunnable(new Runnable() {

            @Override
            public void run() {
                if (translate) {
                    mStackActionButton.animate().translationY(0f);
                }
                mStackActionButton.animate().alpha(1f).setDuration(duration).setInterpolator(Interpolators.FAST_OUT_SLOW_IN).start();
            }
        });
    }
    postAnimationTrigger.flushLastDecrementRunnables();
}
Also used : ReferenceCountedTrigger(com.android.systemui.recents.misc.ReferenceCountedTrigger)

Example 5 with ReferenceCountedTrigger

use of com.android.systemui.recents.misc.ReferenceCountedTrigger in project platform_frameworks_base by android.

the class RecentsView method hideStackActionButton.

/**
     * Hides the stack action button.
     */
private void hideStackActionButton(int duration, boolean translate) {
    if (!RecentsDebugFlags.Static.EnableStackActionButton) {
        return;
    }
    final ReferenceCountedTrigger postAnimationTrigger = new ReferenceCountedTrigger();
    hideStackActionButton(duration, translate, postAnimationTrigger);
    postAnimationTrigger.flushLastDecrementRunnables();
}
Also used : ReferenceCountedTrigger(com.android.systemui.recents.misc.ReferenceCountedTrigger)

Aggregations

ReferenceCountedTrigger (com.android.systemui.recents.misc.ReferenceCountedTrigger)15 TimeInterpolator (android.animation.TimeInterpolator)5 Interpolator (android.view.animation.Interpolator)5 PathInterpolator (android.view.animation.PathInterpolator)5 Task (com.android.systemui.recents.model.Task)5 TaskStack (com.android.systemui.recents.model.TaskStack)5