Search in sources :

Example 6 with ViewGroupOverlay

use of android.view.ViewGroupOverlay in project platform_frameworks_base by android.

the class EnterTransitionCoordinator method startRejectedAnimations.

private void startRejectedAnimations(final ArrayList<View> rejectedSnapshots) {
    if (rejectedSnapshots == null || rejectedSnapshots.isEmpty()) {
        return;
    }
    final ViewGroup decorView = getDecor();
    if (decorView != null) {
        ViewGroupOverlay overlay = decorView.getOverlay();
        ObjectAnimator animator = null;
        int numRejected = rejectedSnapshots.size();
        for (int i = 0; i < numRejected; i++) {
            View snapshot = rejectedSnapshots.get(i);
            overlay.add(snapshot);
            animator = ObjectAnimator.ofFloat(snapshot, View.ALPHA, 1, 0);
            animator.start();
        }
        animator.addListener(new AnimatorListenerAdapter() {

            @Override
            public void onAnimationEnd(Animator animation) {
                ViewGroupOverlay overlay = decorView.getOverlay();
                int numRejected = rejectedSnapshots.size();
                for (int i = 0; i < numRejected; i++) {
                    overlay.remove(rejectedSnapshots.get(i));
                }
            }
        });
    }
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) Animator(android.animation.Animator) ViewGroupOverlay(android.view.ViewGroupOverlay) ViewGroup(android.view.ViewGroup) ObjectAnimator(android.animation.ObjectAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) View(android.view.View)

Example 7 with ViewGroupOverlay

use of android.view.ViewGroupOverlay in project android_frameworks_base by DirtyUnicorns.

the class EnterTransitionCoordinator method startRejectedAnimations.

private void startRejectedAnimations(final ArrayList<View> rejectedSnapshots) {
    if (rejectedSnapshots == null || rejectedSnapshots.isEmpty()) {
        return;
    }
    final ViewGroup decorView = getDecor();
    if (decorView != null) {
        ViewGroupOverlay overlay = decorView.getOverlay();
        ObjectAnimator animator = null;
        int numRejected = rejectedSnapshots.size();
        for (int i = 0; i < numRejected; i++) {
            View snapshot = rejectedSnapshots.get(i);
            overlay.add(snapshot);
            animator = ObjectAnimator.ofFloat(snapshot, View.ALPHA, 1, 0);
            animator.start();
        }
        animator.addListener(new AnimatorListenerAdapter() {

            @Override
            public void onAnimationEnd(Animator animation) {
                ViewGroupOverlay overlay = decorView.getOverlay();
                int numRejected = rejectedSnapshots.size();
                for (int i = 0; i < numRejected; i++) {
                    overlay.remove(rejectedSnapshots.get(i));
                }
            }
        });
    }
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) Animator(android.animation.Animator) ViewGroupOverlay(android.view.ViewGroupOverlay) ViewGroup(android.view.ViewGroup) ObjectAnimator(android.animation.ObjectAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) View(android.view.View)

Example 8 with ViewGroupOverlay

use of android.view.ViewGroupOverlay in project android_frameworks_base by AOSPA.

the class ActivityTransitionCoordinator method moveSharedElementsFromOverlay.

protected void moveSharedElementsFromOverlay() {
    int numListeners = mGhostViewListeners.size();
    for (int i = 0; i < numListeners; i++) {
        GhostViewListeners listener = mGhostViewListeners.get(i);
        ViewGroup parent = (ViewGroup) listener.getView().getParent();
        parent.getViewTreeObserver().removeOnPreDrawListener(listener);
    }
    mGhostViewListeners.clear();
    if (mWindow == null || !mWindow.getSharedElementsUseOverlay()) {
        return;
    }
    ViewGroup decor = getDecor();
    if (decor != null) {
        ViewGroupOverlay overlay = decor.getOverlay();
        int count = mSharedElements.size();
        for (int i = 0; i < count; i++) {
            View sharedElement = mSharedElements.get(i);
            GhostView.removeGhost(sharedElement);
        }
    }
}
Also used : ViewGroupOverlay(android.view.ViewGroupOverlay) ViewGroup(android.view.ViewGroup) ImageView(android.widget.ImageView) GhostView(android.view.GhostView) View(android.view.View)

Example 9 with ViewGroupOverlay

use of android.view.ViewGroupOverlay in project android_frameworks_base by AOSPA.

the class EnterTransitionCoordinator method startRejectedAnimations.

private void startRejectedAnimations(final ArrayList<View> rejectedSnapshots) {
    if (rejectedSnapshots == null || rejectedSnapshots.isEmpty()) {
        return;
    }
    final ViewGroup decorView = getDecor();
    if (decorView != null) {
        ViewGroupOverlay overlay = decorView.getOverlay();
        ObjectAnimator animator = null;
        int numRejected = rejectedSnapshots.size();
        for (int i = 0; i < numRejected; i++) {
            View snapshot = rejectedSnapshots.get(i);
            overlay.add(snapshot);
            animator = ObjectAnimator.ofFloat(snapshot, View.ALPHA, 1, 0);
            animator.start();
        }
        animator.addListener(new AnimatorListenerAdapter() {

            @Override
            public void onAnimationEnd(Animator animation) {
                ViewGroupOverlay overlay = decorView.getOverlay();
                int numRejected = rejectedSnapshots.size();
                for (int i = 0; i < numRejected; i++) {
                    overlay.remove(rejectedSnapshots.get(i));
                }
            }
        });
    }
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) Animator(android.animation.Animator) ViewGroupOverlay(android.view.ViewGroupOverlay) ViewGroup(android.view.ViewGroup) ObjectAnimator(android.animation.ObjectAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) View(android.view.View)

Example 10 with ViewGroupOverlay

use of android.view.ViewGroupOverlay in project android_frameworks_base by ResurrectionRemix.

the class EnterTransitionCoordinator method startRejectedAnimations.

private void startRejectedAnimations(final ArrayList<View> rejectedSnapshots) {
    if (rejectedSnapshots == null || rejectedSnapshots.isEmpty()) {
        return;
    }
    final ViewGroup decorView = getDecor();
    if (decorView != null) {
        ViewGroupOverlay overlay = decorView.getOverlay();
        ObjectAnimator animator = null;
        int numRejected = rejectedSnapshots.size();
        for (int i = 0; i < numRejected; i++) {
            View snapshot = rejectedSnapshots.get(i);
            overlay.add(snapshot);
            animator = ObjectAnimator.ofFloat(snapshot, View.ALPHA, 1, 0);
            animator.start();
        }
        animator.addListener(new AnimatorListenerAdapter() {

            @Override
            public void onAnimationEnd(Animator animation) {
                ViewGroupOverlay overlay = decorView.getOverlay();
                int numRejected = rejectedSnapshots.size();
                for (int i = 0; i < numRejected; i++) {
                    overlay.remove(rejectedSnapshots.get(i));
                }
            }
        });
    }
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) Animator(android.animation.Animator) ViewGroupOverlay(android.view.ViewGroupOverlay) ViewGroup(android.view.ViewGroup) ObjectAnimator(android.animation.ObjectAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) View(android.view.View)

Aggregations

View (android.view.View)11 ViewGroupOverlay (android.view.ViewGroupOverlay)11 ViewGroup (android.view.ViewGroup)10 ImageView (android.widget.ImageView)6 Animator (android.animation.Animator)5 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)5 ObjectAnimator (android.animation.ObjectAnimator)5 GhostView (android.view.GhostView)5 Bitmap (android.graphics.Bitmap)1 Pair (android.util.Pair)1 ViewTreeObserver (android.view.ViewTreeObserver)1 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)1 AdapterView (android.widget.AdapterView)1 ListView (android.widget.ListView)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Set (java.util.Set)1 WifiAutoDownloadPictureRunnable (org.qii.weiciyuan.othercomponent.WifiAutoDownloadPictureRunnable)1 HeaderListView (org.qii.weiciyuan.support.lib.HeaderListView)1 VelocityListView (org.qii.weiciyuan.support.lib.VelocityListView)1