Search in sources :

Example 26 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project TicktockMusic by Lauzy.

the class Navigator method navigateToPlayActivity.

public void navigateToPlayActivity(Context context, ImageView imageView) {
    if (context == null) {
        return;
    }
    Intent intent = PlayActivity.newInstance(context);
    if (imageView == null) {
        context.startActivity(intent);
        return;
    }
    ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation(((Activity) context), imageView, context.getString(R.string.play_view_transition_name));
    context.startActivity(intent, optionsCompat.toBundle());
}
Also used : PlayActivity(com.freedom.lauzy.ticktockmusic.ui.activity.PlayActivity) AppCompatActivity(android.support.v7.app.AppCompatActivity) Activity(android.app.Activity) SettingActivity(com.freedom.lauzy.ticktockmusic.ui.activity.SettingActivity) Intent(android.content.Intent) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Example 27 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project anitrend-app by AniTrend.

the class CompatUtil method startSharedTransitionActivity.

/**
 * Starts a shared transition of activities connected by views
 * <br/>
 *
 * @param base The calling activity
 * @param target The view from the calling activity with transition name
 * @param data Intent with bundle and or activity to start
 */
public static void startSharedTransitionActivity(FragmentActivity base, View target, Intent data) {
    Pair participants = new Pair<>(target, ViewCompat.getTransitionName(target));
    ActivityOptionsCompat transitionActivityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation(base, participants);
    ActivityCompat.startActivity(base, data, transitionActivityOptions.toBundle());
}
Also used : ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat) IntPair(com.annimon.stream.IntPair) Pair(android.support.v4.util.Pair)

Example 28 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project anitrend-app by AniTrend.

the class CompatUtil method startSharedImageTransition.

/**
 * Starts a shared transition of activities connected by views
 * by making use of the provided transition name
 * <br/>
 *
 * @param base The calling activity
 * @param target The view from the calling activity with transition name
 * @param data Intent with bundle and or activity to start
 */
public static void startSharedImageTransition(FragmentActivity base, View target, Intent data, @StringRes int transitionName) {
    ViewCompat.setTransitionName(target, base.getString(transitionName));
    ActivityOptionsCompat transition = ActivityOptionsCompat.makeSceneTransitionAnimation(base, target, ViewCompat.getTransitionName(target));
    base.startActivity(data, transition.toBundle());
}
Also used : ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Example 29 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project MaterializeYourApp by antoniolg.

the class DetailActivity method navigate.

public static void navigate(AppCompatActivity activity, View transitionImage, ViewModel viewModel) {
    Intent intent = new Intent(activity, DetailActivity.class);
    intent.putExtra(EXTRA_IMAGE, viewModel.getImage());
    intent.putExtra(EXTRA_TITLE, viewModel.getText());
    ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, transitionImage, EXTRA_IMAGE);
    ActivityCompat.startActivity(activity, intent, options.toBundle());
}
Also used : Intent(android.content.Intent) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Example 30 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project animate by hitherejoe.

the class SharedTransitionsActivity method startToolbarTransition.

@OnClick(R.id.text_shared_toolbar)
public void startToolbarTransition() {
    Intent intent = new Intent(SharedTransitionsActivity.this, SharedTransitionToolbarActivity.class);
    Pair squareParticipant = new Pair<>(mRelativeView, ViewCompat.getTransitionName(mRelativeView));
    Pair toolbarParticipants = new Pair<>(mToolbarView, ViewCompat.getTransitionName(mToolbarView));
    ActivityOptionsCompat transitionActivityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation(SharedTransitionsActivity.this, squareParticipant, toolbarParticipants);
    ActivityCompat.startActivity(SharedTransitionsActivity.this, intent, transitionActivityOptions.toBundle());
}
Also used : Intent(android.content.Intent) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat) Pair(android.support.v4.util.Pair) OnClick(butterknife.OnClick)

Aggregations

ActivityOptionsCompat (android.support.v4.app.ActivityOptionsCompat)92 Intent (android.content.Intent)72 View (android.view.View)31 Pair (android.support.v4.util.Pair)18 ImageView (android.widget.ImageView)15 TextView (android.widget.TextView)14 RecyclerView (android.support.v7.widget.RecyclerView)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