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));
}
}
});
}
}
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));
}
}
});
}
}
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);
}
}
}
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));
}
}
});
}
}
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));
}
}
});
}
}
Aggregations