本文整理匯總了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);
}