use of android.transition.Transition in project android_frameworks_base by DirtyUnicorns.
the class ExitTransitionCoordinator method startExitTransition.
private void startExitTransition() {
Transition transition = getExitTransition();
ViewGroup decorView = getDecor();
if (transition != null && decorView != null && mTransitioningViews != null) {
setTransitioningViewsVisiblity(View.VISIBLE, false);
TransitionManager.beginDelayedTransition(decorView, transition);
setTransitioningViewsVisiblity(View.INVISIBLE, false);
decorView.invalidate();
} else {
transitionStarted();
}
}
use of android.transition.Transition in project android_frameworks_base by AOSPA.
the class BackStackRecord method setEpicenter.
private static void setEpicenter(Transition transition, View view) {
final Rect epicenter = new Rect();
view.getBoundsOnScreen(epicenter);
transition.setEpicenterCallback(new Transition.EpicenterCallback() {
@Override
public Rect onGetEpicenter(Transition transition) {
return epicenter;
}
});
}
use of android.transition.Transition in project android_frameworks_base by AOSPA.
the class BackStackRecord method removeTargets.
/**
* This method removes the views from transitions that target ONLY those views.
* The views list should match those added in addTargets and should contain
* one view that is not in the view hierarchy (state.nonExistentView).
*/
public static void removeTargets(Transition transition, ArrayList<View> views) {
if (transition instanceof TransitionSet) {
TransitionSet set = (TransitionSet) transition;
int numTransitions = set.getTransitionCount();
for (int i = 0; i < numTransitions; i++) {
Transition child = set.getTransitionAt(i);
removeTargets(child, views);
}
} else if (!hasSimpleTarget(transition)) {
List<View> targets = transition.getTargets();
if (targets != null && targets.size() == views.size() && targets.containsAll(views)) {
// We have an exact match. We must have added these earlier in addTargets
for (int i = views.size() - 1; i >= 0; i--) {
transition.removeTarget(views.get(i));
}
}
}
}
use of android.transition.Transition in project Shuttle by timusus.
the class LibraryController method pushDetailFragment.
void pushDetailFragment(BaseDetailFragment detailFragment, @Nullable View transitionView) {
List<Pair<View, String>> transitions = new ArrayList<>();
if (transitionView != null) {
String transitionName = ViewCompat.getTransitionName(transitionView);
transitions.add(new Pair<>(transitionView, transitionName));
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
Transition moveTransition = TransitionInflater.from(getContext()).inflateTransition(R.transition.image_transition);
detailFragment.setSharedElementEnterTransition(moveTransition);
detailFragment.setSharedElementReturnTransition(moveTransition);
}
}
getNavigationController().pushViewController(detailFragment, "DetailFragment", transitions);
}
use of android.transition.Transition in project Shuttle by timusus.
the class SearchFragment method pushDetailFragment.
void pushDetailFragment(BaseDetailFragment detailFragment, @Nullable View transitionView) {
List<Pair<View, String>> transitions = new ArrayList<>();
if (transitionView != null) {
String transitionName = ViewCompat.getTransitionName(transitionView);
transitions.add(new Pair<>(transitionView, transitionName));
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
Transition moveTransition = TransitionInflater.from(getContext()).inflateTransition(R.transition.image_transition);
detailFragment.setSharedElementEnterTransition(moveTransition);
detailFragment.setSharedElementReturnTransition(moveTransition);
}
}
getNavigationController().pushViewController(detailFragment, "DetailFragment", transitions);
}
Aggregations