Search in sources :

Example 1 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project Meizhi by drakeet.

the class MainActivity method startPictureActivity.

private void startPictureActivity(Meizhi meizhi, View transitView) {
    Intent intent = PictureActivity.newIntent(MainActivity.this, meizhi.url, meizhi.desc);
    ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation(MainActivity.this, transitView, PictureActivity.TRANSIT_PIC);
    try {
        ActivityCompat.startActivity(MainActivity.this, intent, optionsCompat.toBundle());
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
        startActivity(intent);
    }
}
Also used : Intent(android.content.Intent) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Example 2 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project CloudReader by youlookwhat.

the class OneMovieDetailActivity method start.

/**
     * @param context      activity
     * @param positionData bean
     * @param imageView    imageView
     */
public static void start(Activity context, SubjectsBean positionData, ImageView imageView) {
    Intent intent = new Intent(context, OneMovieDetailActivity.class);
    intent.putExtra("bean", positionData);
    ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(context, imageView, //与xml文件对应
    CommonUtils.getString(R.string.transition_movie_img));
    ActivityCompat.startActivity(context, intent, options.toBundle());
}
Also used : Intent(android.content.Intent) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Example 3 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project CloudReader by youlookwhat.

the class SlideScrollViewActivity method start.

/**
     * @param context      activity
     * @param positionData bean
     * @param imageView    imageView
     */
public static void start(Activity context, SubjectsBean positionData, ImageView imageView) {
    Intent intent = new Intent(context, SlideScrollViewActivity.class);
    intent.putExtra("bean", positionData);
    ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(context, imageView, //与xml文件对应
    CommonUtils.getString(R.string.transition_movie_img));
    ActivityCompat.startActivity(context, intent, options.toBundle());
}
Also used : Intent(android.content.Intent) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Example 4 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project CloudReader by youlookwhat.

the class BookDetailActivity method start.

/**
     * @param context      activity
     * @param positionData bean
     * @param imageView    imageView
     */
public static void start(Activity context, BooksBean positionData, ImageView imageView) {
    Intent intent = new Intent(context, BookDetailActivity.class);
    intent.putExtra(EXTRA_PARAM, positionData);
    ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(context, imageView, //与xml文件对应
    CommonUtils.getString(R.string.transition_book_img));
    ActivityCompat.startActivity(context, intent, options.toBundle());
}
Also used : Intent(android.content.Intent) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Example 5 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project android-topeka by googlesamples.

the class CategorySelectionFragment method startQuizActivityWithTransition.

private void startQuizActivityWithTransition(Activity activity, View toolbar, Category category) {
    final Pair[] pairs = TransitionHelper.createSafeTransitionParticipants(activity, false, new Pair<>(toolbar, activity.getString(R.string.transition_toolbar)));
    @SuppressWarnings("unchecked") ActivityOptionsCompat sceneTransitionAnimation = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, pairs);
    // Start the activity with the participants, animating from one to the other.
    final Bundle transitionBundle = sceneTransitionAnimation.toBundle();
    Intent startIntent = QuizActivity.getStartIntent(activity, category);
    ActivityCompat.startActivityForResult(activity, startIntent, REQUEST_CATEGORY, transitionBundle);
}
Also used : Bundle(android.os.Bundle) Intent(android.content.Intent) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat) Pair(android.support.v4.util.Pair)

Aggregations

ActivityOptionsCompat (android.support.v4.app.ActivityOptionsCompat)90 Intent (android.content.Intent)70 View (android.view.View)31 Pair (android.support.v4.util.Pair)18 ImageView (android.widget.ImageView)14 RecyclerView (android.support.v7.widget.RecyclerView)13 TextView (android.widget.TextView)13 Activity (android.app.Activity)12 OnClick (butterknife.OnClick)7 ActivityOptions (android.app.ActivityOptions)4 Context (android.content.Context)4 Bundle (android.os.Bundle)4 Handler (android.os.Handler)4 BindView (butterknife.BindView)4 CardView (android.support.v7.widget.CardView)3 Explode (android.transition.Explode)3 AdapterView (android.widget.AdapterView)3 LinearLayout (android.widget.LinearLayout)3 Uri (android.net.Uri)2 LayoutInflater (android.view.LayoutInflater)2