Java Code Examples for android.support.annotation.TransitionRes

The following are top voted examples for showing how to use android.support.annotation.TransitionRes. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: android-proguards   File: SearchActivity.java   View source code 5 votes vote down vote up
Transition getTransition(@TransitionRes int transitionId) {
    Transition transition = transitions.get(transitionId);
    if (transition == null) {
        transition = TransitionInflater.from(this).inflateTransition(transitionId);
        transitions.put(transitionId, transition);
    }
    return transition;
}
 
Example 2
Project: TransitionHelper   File: TransitionHelper.java   View source code 5 votes vote down vote up
@SuppressWarnings("unchecked")
public static void transitionTo(AppCompatActivity from, Intent intent, @TransitionRes int transition, View... sharedElements) {
    final Pair<View, String>[] pairs = createSafeTransitionParticipants(from, true, getPairs(sharedElements));
    ActivityOptionsCompat transitionActivityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation(from, pairs);
    intent.putExtra(TRANSITION_ID, transition);
    from.startActivity(intent, transitionActivityOptions.toBundle());
}
 
Example 3
Project: TransitionHelper   File: TransitionHelper.java   View source code 5 votes vote down vote up
@SuppressWarnings("unchecked")
public static void transitionTo(Fragment from, Intent intent, @TransitionRes int transition, View... sharedElements) {
    final Pair<View, String>[] pairs = createSafeTransitionParticipants(from.getActivity(), true, getPairs(sharedElements));
    ActivityOptionsCompat transitionActivityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation(from.getActivity(), pairs);
    intent.putExtra(TRANSITION_ID, transition);
    from.startActivity(intent, transitionActivityOptions.toBundle());
}
 
Example 4
Project: TransitionHelper   File: TransitionHelper.java   View source code 5 votes vote down vote up
@SuppressWarnings("unchecked")
public static void transitionToForResult(AppCompatActivity from, Intent intent, int requestCode, @TransitionRes int transition, View... sharedElements) {
    final Pair<View, String>[] pairs = createSafeTransitionParticipants(from, true, getPairs(sharedElements));
    ActivityOptionsCompat transitionActivityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation(from, pairs);
    intent.putExtra(TRANSITION_ID, transition);
    from.startActivityForResult(intent, requestCode, transitionActivityOptions.toBundle());
}
 
Example 5
Project: TransitionHelper   File: TransitionHelper.java   View source code 5 votes vote down vote up
@SuppressWarnings("unchecked")
public static void transitionToForResult(Fragment from, Intent intent, int requestCode, @TransitionRes int transition, View... sharedElements) {
    final Pair<View, String>[] pairs = createSafeTransitionParticipants(from.getActivity(), true, getPairs(sharedElements));
    ActivityOptionsCompat transitionActivityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation(from.getActivity(), pairs);
    intent.putExtra(TRANSITION_ID, transition);
    from.startActivityForResult(intent, requestCode, transitionActivityOptions.toBundle());
}
 
Example 6
Project: plaid   File: SearchActivity.java   View source code 5 votes vote down vote up
Transition getTransition(@TransitionRes int transitionId) {
    Transition transition = transitions.get(transitionId);
    if (transition == null) {
        transition = TransitionInflater.from(this).inflateTransition(transitionId);
        transitions.put(transitionId, transition);
    }
    return transition;
}
 
Example 7
Project: Melophile   File: SearchActivity.java   View source code 4 votes vote down vote up
private Transition getTransition(@TransitionRes int transitionId) {
    TransitionInflater inflater=TransitionInflater.from(this);
    return inflater.inflateTransition(transitionId);
}
 
Example 8
Project: android_fragments   File: BaseFragment.java   View source code 2 votes vote down vote up
/**
 * Inflates a desired Transition from the specified <var>resource</var>.
 *
 * @param resource Resource id of the desired transition to inflate.
 * @return Inflated transition or {@code null} if the current API level does not support transitions
 * or this fragment is not attached to its parent context.
 * @see TransitionInflater#inflateTransition(int)
 */
@Nullable
protected Transition inflateTransition(@TransitionRes int resource) {
	final Activity activity = getActivity();
	return activity != null && FragmentPolicies.TRANSITIONS_SUPPORTED ? TransitionInflater.from(activity).inflateTransition(resource) : null;
}
 
Example 9
Project: android_fragments   File: FragmentUtils.java   View source code 2 votes vote down vote up
/**
 * Inflates a desired Transition from the specified <var>resource</var>.
 *
 * @param context  Context used for inflation process.
 * @param resource Resource id of the desired transition to inflate.
 * @return Inflated transition or {@code null} if the current API level does not support transitions.
 * @see TransitionInflater#inflateTransition(int)
 * @see #inflateTransitionManager(Context, int, ViewGroup)
 */
@Nullable
@SuppressLint("NewApi")
public static Transition inflateTransition(@NonNull final Context context, @TransitionRes final int resource) {
	return FragmentPolicies.TRANSITIONS_SUPPORTED ? TransitionInflater.from(context).inflateTransition(resource) : null;
}
 
Example 10
Project: android_fragments   File: FragmentUtils.java   View source code 2 votes vote down vote up
/**
 * Inflates a desired TransitionManager from the specified <var>resource</var>.
 *
 * @param context   Context used for inflation process.
 * @param resource  Resource id of the desired transition manager to inflate.
 * @param sceneRoot Root of the scene for which to inflate transition manager.
 * @return Inflated transition manager or {@code null} if the current API level does not support
 * transitions.
 * @see TransitionInflater#inflateTransitionManager(int, ViewGroup)
 * @see #inflateTransition(Context, int)
 */
@Nullable
@SuppressLint("NewApi")
public static TransitionManager inflateTransitionManager(@NonNull final Context context, @TransitionRes final int resource, @NonNull final ViewGroup sceneRoot) {
	return FragmentPolicies.TRANSITIONS_SUPPORTED ? TransitionInflater.from(context).inflateTransitionManager(resource, sceneRoot) : null;
}