Java Code Examples for android.app.Activity#overridePendingTransition()
The following examples show how to use
android.app.Activity#overridePendingTransition() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WUI.java From WhereYouGo with GNU General Public License v3.0 | 6 votes |
public void pushDialog(String[] texts, Media[] media, String button1, String button2, LuaClosure callback) { Logger.w(TAG, "pushDialog(" + Arrays.toString(texts) + ", " + Arrays.toString(media) + ", " + button1 + ", " + button2 + ", " + callback + ")"); Activity activity = getParentActivity(); PushDialogActivity.setDialog(texts, media, button1, button2, callback); Intent intent = new Intent(activity, PushDialogActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); activity.startActivity(intent); activity.overridePendingTransition(0, 0); closeActivity(activity); Vibrator v = (Vibrator) A.getMain().getSystemService(Context.VIBRATOR_SERVICE); v.vibrate(25); }
Example 2
Source File: LoginManager.java From SocialSdkLibrary with Apache License 2.0 | 5 votes |
/** * 开始登录分享,供外面调用 * * @param act 发起登录的 activity * @param listener 分享监听 * @param obj 登录参数 */ private void preLogin( final Activity act, final @Target.LoginTarget int target, final LoginObj obj, final OnLoginStateListener listener) { if (act instanceof LifecycleOwner) { Lifecycle lifecycle = ((LifecycleOwner) act).getLifecycle(); if (lifecycle != null) { lifecycle.addObserver(this); } } listener.onState(act, LoginResult.stateOf(Result.STATE_START)); currentObj = obj; stateListener = listener; currentTarget = target; originActivity = new WeakReference<>(act); IPlatform platform = GlobalPlatform.newPlatformByTarget(act, target); GlobalPlatform.savePlatform(platform); if (target == Target.LOGIN_WX_SCAN) { wrapListener = new OnLoginListenerWrap(stateListener); GlobalPlatform.getCurrentPlatform().login(act, target, obj, wrapListener); return; } if (platform.getUIKitClazz() == null) { wrapListener = new OnLoginListenerWrap(stateListener); GlobalPlatform.getCurrentPlatform().login(act, target, obj, wrapListener); } else { Intent intent = new Intent(act, platform.getUIKitClazz()); intent.putExtra(GlobalPlatform.KEY_ACTION_TYPE, GlobalPlatform.ACTION_TYPE_LOGIN); act.startActivity(intent); act.overridePendingTransition(0, 0); } }
Example 3
Source File: GActivityUtils.java From grouter-android with Apache License 2.0 | 5 votes |
/** * 从底部离开 * 对应 {@linkplain GActivityBuilder#transitionBottomIn} */ public static void finishTransitionBottomOut(Activity activity) { if (!activity.isFinishing()) { activity.finish(); } activity.overridePendingTransition(0, R.anim.activity_top_to_bottom_exit); }
Example 4
Source File: PhotoBrowserActivity.java From BaoKanAndroid with MIT License | 5 votes |
/** * 便捷启动当前activity * * @param activity 来源activity * @param insetPhotoBeanList 插图集合 */ public static void start(Activity activity, List<ArticleDetailBean.InsetPhotoBean> insetPhotoBeanList, int index) { Intent intent = new Intent(activity, PhotoBrowserActivity.class); Bundle bundle = new Bundle(); bundle.putSerializable("insetPhotoBeanList_key", (Serializable) insetPhotoBeanList); intent.putExtras(bundle); intent.putExtra("index_key", index); activity.startActivity(intent); activity.overridePendingTransition(0, 0); }
Example 5
Source File: Utils.java From hipda with GNU General Public License v2.0 | 5 votes |
public static void restartActivity(Activity activity) { ColorHelper.clear(); activity.finish(); Intent intent = new Intent(activity.getApplicationContext(), activity.getClass()); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); activity.startActivity(intent); activity.overridePendingTransition(0, 0); System.exit(0); }
Example 6
Source File: MainActivity.java From LiuAGeAndroid with MIT License | 5 votes |
/** * 快捷启动方法 * * @param activity * @param articleListBean */ public static void start(Activity activity, ArticleListBean articleListBean) { Intent intent = new Intent(activity, MainActivity.class); Bundle bundle = new Bundle(); bundle.putSerializable("articleListBean_key", articleListBean); intent.putExtras(bundle); activity.startActivity(intent); activity.overridePendingTransition(R.anim.column_bottom, R.anim.column_bottom); }
Example 7
Source File: JumpUtils.java From GSYVideoPlayer with Apache License 2.0 | 5 votes |
/** * 跳转到无UI视频播放 * * @param activity * @param view */ public static void goToPlayEmptyControlActivity(Activity activity, View view) { Intent intent = new Intent(activity, PlayEmptyControlActivity.class); intent.putExtra(PlayActivity.TRANSITION, true); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { Pair pair = new Pair<>(view, PlayActivity.IMG_TRANSITION); ActivityOptionsCompat activityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation( activity, pair); ActivityCompat.startActivity(activity, intent, activityOptions.toBundle()); } else { activity.startActivity(intent); activity.overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out); } }
Example 8
Source File: AnimationHelper.java From Focus with GNU General Public License v3.0 | 5 votes |
public static void setFadeTransition(Activity activity) { if (activity == null) { return; } if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) { activity.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out); } }
Example 9
Source File: PaymentTypesActivity.java From px-android with MIT License | 5 votes |
public static void start(@NonNull final Activity activity, final int requestCode, @NonNull final List<PaymentMethod> paymentMethods, @NonNull final List<PaymentType> paymentTypes, final CardInfo cardInfo) { final Intent intent = new Intent(activity, PaymentTypesActivity.class); intent.putParcelableArrayListExtra(EXTRA_PAYMENT_METHODS, new ArrayList<>(paymentMethods)); intent.putParcelableArrayListExtra(EXTRA_PAYMENT_TYPES, new ArrayList<>(paymentTypes)); intent.putExtra(EXTRA_CARD_INFO, cardInfo); activity.startActivityForResult(intent, requestCode); activity.overridePendingTransition(R.anim.px_slide_right_to_left_in, R.anim.px_slide_right_to_left_out); }
Example 10
Source File: LayoutManagerDocumentTabSwitcher.java From delion with Apache License 2.0 | 5 votes |
@Override public void doneHiding() { super.doneHiding(); // Remove transition animation when switching to another tab, in accordance to // moveToFront() in ActivityDelegate. Activity activity = (Activity) mHost.getContext(); if (activity != null) { activity.overridePendingTransition(0, 0); } }
Example 11
Source File: ActivityAnimator.java From UltimateAndroid with Apache License 2.0 | 4 votes |
public void appearBottomRightAnimation(Activity a) { a.overridePendingTransition(R.anim.ac_transition_appear_bottom_right_in, R.anim.ac_transition_appear_bottom_right_out); }
Example 12
Source File: ModifyInfoActivity.java From LiuAGeAndroid with MIT License | 4 votes |
/** * 便捷启动当前activity * * @param activity 启动当前activity的activity */ public static void start(Activity activity) { Intent intent = new Intent(activity, ModifyInfoActivity.class); activity.startActivity(intent); activity.overridePendingTransition(R.anim.push_enter, R.anim.push_exit); }
Example 13
Source File: ActivityAnimator.java From UltimateAndroid with Apache License 2.0 | 4 votes |
public void disappearBottomRightAnimation(Activity a) { a.overridePendingTransition(R.anim.ac_transition_disappear_bottom_right_in, R.anim.ac_transition_disappear_bottom_right_out); }
Example 14
Source File: ActivityAnimator.java From MVPAndroidBootstrap with Apache License 2.0 | 4 votes |
public static void flipHorizontalAnimation(Activity a) { a.overridePendingTransition(R.anim.flip_horizontal_in, R.anim.flip_horizontal_out); }
Example 15
Source File: CommentRecordActivity.java From LiuAGeAndroid with MIT License | 4 votes |
/** * 便捷启动当前activity * * @param activity 启动当前activity的activity */ public static void start(Activity activity) { Intent intent = new Intent(activity, CommentRecordActivity.class); activity.startActivity(intent); activity.overridePendingTransition(R.anim.push_enter, R.anim.push_exit); }
Example 16
Source File: ActivityAnimator.java From UltimateAndroid with Apache License 2.0 | 4 votes |
public void disappearTopLeftAnimation(Activity a) { a.overridePendingTransition(R.anim.ac_transition_disappear_top_left_in, R.anim.ac_transition_disappear_top_left_out); }
Example 17
Source File: DisplayAnimUtils.java From Jide-Note with MIT License | 4 votes |
/** * 滑动,底部退出 */ public static void slideButtomOut(Activity activity){ activity.overridePendingTransition(-1, R.anim.out_to_bottom); }
Example 18
Source File: DynamicLanguage.java From deltachat-android with GNU General Public License v3.0 | 4 votes |
static void invoke(Activity activity) { activity.overridePendingTransition(0, 0); }
Example 19
Source File: ModifySafeInfoActivity.java From LiuAGeAndroid with MIT License | 4 votes |
/** * 便捷启动当前activity * * @param activity 启动当前activity的activity */ public static void start(Activity activity) { Intent intent = new Intent(activity, ModifySafeInfoActivity.class); activity.startActivity(intent); activity.overridePendingTransition(R.anim.push_enter, R.anim.push_exit); }
Example 20
Source File: UCrop.java From Matisse-Kotlin with Apache License 2.0 | 2 votes |
/** * Send the crop Intent from an Activity with a custom request code or animation * * @param activity Activity to receive result * @param requestCode requestCode for result */ public void start(@NonNull Activity activity, int requestCode, @AnimRes int activityCropEnterAnimation) { activity.startActivityForResult(getIntent(activity), requestCode); activity.overridePendingTransition(activityCropEnterAnimation, R.anim.ucrop_anim_fade_in); }