Search in sources :

Example 16 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project FastHub by k0shk0sh.

the class ActivityHelper method startReveal.

public static void startReveal(@NonNull Fragment fragment, Intent intent, @NonNull View sharedElement, int requestCode) {
    if (!PrefGetter.isAppAnimationDisabled()) {
        ActivityOptionsCompat options = ActivityOptionsCompat.makeClipRevealAnimation(sharedElement, sharedElement.getWidth() / 2, sharedElement.getHeight() / 2, sharedElement.getWidth(), sharedElement.getHeight());
        fragment.startActivityForResult(intent, requestCode, options.toBundle());
    } else {
        fragment.startActivityForResult(intent, requestCode);
    }
}
Also used : ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Example 17 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project FastHub by k0shk0sh.

the class ActivityHelper method startReveal.

public static void startReveal(@NonNull Activity activity, Intent intent, @NonNull View sharedElement, int requestCode) {
    if (!PrefGetter.isAppAnimationDisabled()) {
        ActivityOptionsCompat options = ActivityOptionsCompat.makeClipRevealAnimation(sharedElement, sharedElement.getWidth() / 2, sharedElement.getHeight() / 2, sharedElement.getWidth(), sharedElement.getHeight());
        activity.startActivityForResult(intent, requestCode, options.toBundle());
    } else {
        activity.startActivityForResult(intent, requestCode);
    }
}
Also used : ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Example 18 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project butter-android by butterproject.

the class TVStreamLoadingActivity method startActivity.

public static Intent startActivity(Activity activity, StreamInfo info, Pair<View, String>... elements) {
    Intent intent = new Intent(activity, TVStreamLoadingActivity.class);
    intent.putExtra(EXTRA_STREAM_INFO, info);
    ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, elements);
    ActivityCompat.startActivity(activity, intent, options.toBundle());
    return intent;
}
Also used : Intent(android.content.Intent) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Example 19 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project Ruisi by freedom10086.

the class UserDetailActivity method openWithAnimation.

public static void openWithAnimation(Activity activity, String username, ImageView imgAvatar, String uid) {
    Intent intent = new Intent(activity, UserDetailActivity.class);
    intent.putExtra("loginName", username);
    intent.putExtra("avatarUrl", UrlUtils.getAvaterurlm(uid));
    needAnimate = true;
    ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, imgAvatar, NAME_IMG_AVATAR);
    ActivityCompat.startActivity(activity, intent, options.toBundle());
}
Also used : Intent(android.content.Intent) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

Example 20 with ActivityOptionsCompat

use of android.support.v4.app.ActivityOptionsCompat in project Ruisi by freedom10086.

the class LaunchActivity method enterHome.

private void enterHome() {
    if (isForeGround) {
        ActivityOptionsCompat compat = ActivityOptionsCompat.makeCustomAnimation(this, R.anim.fade_in, R.anim.fade_out);
        Intent i = new Intent();
        ActivityCompat.startActivity(this, new Intent(this, HomeActivity.class), compat.toBundle());
        new Handler().postDelayed(() -> finish(), 305);
    }
}
Also used : Handler(android.os.Handler) Intent(android.content.Intent) ActivityOptionsCompat(android.support.v4.app.ActivityOptionsCompat)

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