當前位置: 首頁>>代碼示例>>Java>>正文


Java Activity.overridePendingTransition方法代碼示例

本文整理匯總了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);
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:28,代碼來源:ImageAutoPlayActivity.java

示例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);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:9,代碼來源:UpgradeActivity.java

示例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);
}
 
開發者ID:lai233333,項目名稱:MyDemo,代碼行數:10,代碼來源:WelfareDetailActivity.java

示例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);
    }
}
 
開發者ID:gsantner,項目名稱:memetastic,代碼行數:12,代碼來源:GsPreferenceFragmentCompat.java

示例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());
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:13,代碼來源:SwitchActivity.java

示例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);
}
 
開發者ID:6ag,項目名稱:LiuAGeAndroid,代碼行數:15,代碼來源:AdWebViewActivity.java

示例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();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:ActivityUtils.java

示例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);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:ActivityUtils.java

示例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);
}
 
開發者ID:huzenan,項目名稱:EasyTransition,代碼行數:15,代碼來源:EasyTransition.java

示例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();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:ActivityUtils.java

示例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);
}
 
開發者ID:6ag,項目名稱:LiuAGeAndroid,代碼行數:16,代碼來源:PhotoBrowserActivity.java

示例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);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:18,代碼來源:ActivityUtils.java

示例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);
}
 
開發者ID:huzenan,項目名稱:EasyTransition,代碼行數:17,代碼來源:EasyTransition.java

示例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);
}
 
開發者ID:6ag,項目名稱:LiuAGeAndroid,代碼行數:11,代碼來源:AgreementActivity.java

示例15: finish

import android.app.Activity; //導入方法依賴的package包/類
private void finish() {
    Activity act = (Activity) getContext();
    act.finish();
    act.overridePendingTransition(0, android.R.anim.fade_out);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:6,代碼來源:SwipeBackLayout.java


注:本文中的android.app.Activity.overridePendingTransition方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。