本文整理汇总了Java中android.app.Activity.overridePendingTransition方法的典型用法代码示例。如果您正苦于以下问题:Java Activity.overridePendingTransition方法的具体用法?Java Activity.overridePendingTransition怎么用?Java Activity.overridePendingTransition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.Activity
的用法示例。
在下文中一共展示了Activity.overridePendingTransition方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startImageAutoPlay
import android.app.Activity; //导入方法依赖的package包/类
/**
* 启动图片自动播放
*
* @param context 上下文
* @param imageList 图片列表
* @param title 标题/相册名
* @param cacheDir 图片缓存目录
* @param cacheOnDisc 是否需要缓存
* @param position 起始位置
* @param scrollPeriod 图片切换周期
*/
public static void startImageAutoPlay(Activity activity, ArrayList<String> imageList, String title, String cacheDir,
boolean cacheOnDisc, int position, int scrollPeriod)
{
Intent intent = new Intent();
intent.setClass(activity, ImageAutoPlayActivity.class);
intent.putStringArrayListExtra(EXTRA_IMAGE_LIST, imageList);
intent.putExtra(EXTRA_TITLE, title);
intent.putExtra(EXTRA_DIRECTORY, cacheDir);
intent.putExtra(EXTRA_POSITION, position);
intent.putExtra(EXTRA_PERIOD, scrollPeriod);
intent.putExtra(EXTRA_CACHE_ON_DISC, cacheOnDisc);
activity.startActivity(intent);
// Activity切换动画使用淡入淡出的效果
activity.overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
示例2: launchInstance
import android.app.Activity; //导入方法依赖的package包/类
public static void launchInstance(Activity activity, Intent originalIntent) {
Intent intent = new Intent();
intent.setClass(activity, UpgradeActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
intent.putExtra(UpgradeActivity.EXTRA_INTENT_TO_REFIRE, originalIntent);
activity.startActivity(intent);
activity.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
}
示例3: launchActivity
import android.app.Activity; //导入方法依赖的package包/类
public static void launchActivity(Activity context, int position, ArrayList<String> imgList){
Bundle bundle = new Bundle();
bundle.putInt("position",position);
bundle.putStringArrayList("imgList", imgList);
Intent intent = new Intent(context, WelfareDetailActivity.class);
intent.putExtras(bundle);
context.startActivity(intent);
context.overridePendingTransition(R.anim.fade_entry, R.anim.hold);
}
示例4: restartActivity
import android.app.Activity; //导入方法依赖的package包/类
protected void restartActivity() {
Activity activity;
if (isAdded() && (activity = getActivity()) != null) {
Intent intent = getActivity().getIntent();
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION);
activity.overridePendingTransition(0, 0);
activity.finish();
activity.overridePendingTransition(0, 0);
startActivity(intent);
}
}
示例5: startActivity
import android.app.Activity; //导入方法依赖的package包/类
/**
*
* @param activity
* @param intent
* @param switchType
*/
public static void startActivity(Activity activity, Intent intent, SwitchType switchType)
{
intent.putExtra("switch_animation", switchType);
activity.startActivity(intent);
activity.overridePendingTransition(switchType.getOpenEnter(), switchType.getOpenExit());
}
示例6: start
import android.app.Activity; //导入方法依赖的package包/类
/**
* 便捷启动当前activity
*
* @param activity 来源activity
* @param titleurl 网页地址
*/
public static void start(Activity activity, String titleurl, String title, String titlepic) {
Intent intent = new Intent(activity, AdWebViewActivity.class);
intent.putExtra("titleurl_key", titleurl);
intent.putExtra("title_key", title);
intent.putExtra("titlepic_key", titlepic);
activity.startActivity(intent);
activity.overridePendingTransition(R.anim.push_enter, R.anim.push_exit);
}
示例7: skipActivity
import android.app.Activity; //导入方法依赖的package包/类
public void skipActivity(Activity aty, Bundle bundle, int flags, Class clazz) {
Intent i = new Intent(aty, clazz);
i.putExtras(bundle);
i.setFlags(flags);
aty.startActivity(i);
aty.overridePendingTransition(R.anim.zoomin, R.anim.zoomout);
aty.finish();
}
示例8: showActivity
import android.app.Activity; //导入方法依赖的package包/类
public void showActivity(Activity aty, int flags, Bundle bundle, Class clazz) {
Intent i = new Intent(aty, clazz);
i.putExtras(bundle);
i.setFlags(flags);
aty.startActivity(i);
aty.overridePendingTransition(R.anim.zoomin, R.anim.zoomout);
}
示例9: startActivity
import android.app.Activity; //导入方法依赖的package包/类
/**
* Start Activity with transition options
*
* @param intent The intent to start
* @param options Transition options, using {@link EasyTransitionOptions#makeTransitionOptions(Activity, View...)}
* to build your options
*/
public static void startActivity(Intent intent, EasyTransitionOptions options) {
options.update();
intent.putParcelableArrayListExtra(EASY_TRANSITION_OPTIONS, options.getAttrs());
Activity activity = options.getActivity();
activity.startActivity(intent);
activity.overridePendingTransition(0, 0);
}
示例10: skipActivityAnima
import android.app.Activity; //导入方法依赖的package包/类
public void skipActivityAnima(Activity aty, Class clazz, Bundle bundle, int inAnima, int outAnima) {
Intent i = new Intent(aty, clazz);
i.putExtras(bundle);
aty.startActivity(i);
aty.overridePendingTransition(inAnima, outAnima);
aty.finish();
}
示例11: start
import android.app.Activity; //导入方法依赖的package包/类
/**
* 便捷启动当前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);
}
示例12: startActivities
import android.app.Activity; //导入方法依赖的package包/类
/**
* 启动Activity
*
* @param activity activity
* @param intents 意图
* @param enterAnim 入场动画
* @param exitAnim 出场动画
*/
public static void startActivities(@NonNull final Activity activity,
@NonNull final Intent[] intents,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
startActivities(intents, activity, getOptionsBundle(activity, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
activity.overridePendingTransition(enterAnim, exitAnim);
}
}
示例13: startActivityForResult
import android.app.Activity; //导入方法依赖的package包/类
/**
* Start Activity for result, with transition options
*
* @param intent The intent to start
* @param requestCode If >= 0, this code will be returned in onActivityResult() when the activity exits,
* see {@link Activity#startActivityForResult(Intent, int)}
* @param options Transition options, using {@link EasyTransitionOptions#makeTransitionOptions(Activity, View...)}
* to build your options
*/
public static void startActivityForResult(Intent intent, int requestCode, EasyTransitionOptions options) {
options.update();
intent.putParcelableArrayListExtra(EASY_TRANSITION_OPTIONS, options.getAttrs());
Activity activity = options.getActivity();
activity.startActivityForResult(intent, requestCode);
activity.overridePendingTransition(0, 0);
}
示例14: start
import android.app.Activity; //导入方法依赖的package包/类
/**
* 便捷启动当前activity
*
* @param activity 启动当前activity的activity
*/
public static void start(Activity activity) {
Intent intent = new Intent(activity, AgreementActivity.class);
activity.startActivity(intent);
activity.overridePendingTransition(R.anim.push_enter, R.anim.push_exit);
}
示例15: finish
import android.app.Activity; //导入方法依赖的package包/类
private void finish() {
Activity act = (Activity) getContext();
act.finish();
act.overridePendingTransition(0, android.R.anim.fade_out);
}