当前位置: 首页>>代码示例>>Java>>正文


Java Activity.overridePendingTransition方法代码示例

本文整理汇总了Java中org.holoeverywhere.app.Activity.overridePendingTransition方法的典型用法代码示例。如果您正苦于以下问题:Java Activity.overridePendingTransition方法的具体用法?Java Activity.overridePendingTransition怎么用?Java Activity.overridePendingTransition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.holoeverywhere.app.Activity的用法示例。


在下文中一共展示了Activity.overridePendingTransition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: restartWithTheme

import org.holoeverywhere.app.Activity; //导入方法依赖的package包/类
/**
 * Like {@link #restartWithTheme(Activity, int)}, but if third arg is true -
 * restart activity regardless theme.
 *
 * @param activity Activity
 * @param theme    Theme flags for check
 * @param force    Force restart activity
 */
@SuppressLint("InlinedApi")
public static void restartWithTheme(Activity activity, int theme, boolean force) {
    if (theme < _START_RESOURCES_ID && theme > 0) {
        if (ThemeManager._THEME_MODIFIER > 0) {
            theme |= ThemeManager._THEME_MODIFIER;
        }
        theme &= ThemeManager._THEME_MASK;
    }
    if (force || ThemeManager.getTheme(activity) != theme) {
        Intent intent = new Intent(activity.getIntent());
        intent.setClass(activity, activity.getClass());
        intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
        if (theme > 0) {
            intent.putExtra(ThemeManager._THEME_TAG, theme);
        }
        intent.putExtra(KEY_INSTANCE_STATE, activity.saveInstanceState());
        intent.putExtra(KEY_CREATED_BY_THEME_MANAGER, true);
        if (activity.isRestricted()) {
            Application app = Application.getLastInstance();
            if (app != null && !app.isRestricted()) {
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                app.superStartActivity(intent, -1, null);
            }
        } else {
            if (!activity.isFinishing()) {
                activity.finish();
                activity.overridePendingTransition(0, 0);
            }
            if (activity != null) {
                activity.superStartActivity(intent, -1, null);
            }
        }
    }
}
 
开发者ID:restorer,项目名称:gloomy-dungeons-2,代码行数:44,代码来源:ThemeManager.java

示例2: restartWithTheme

import org.holoeverywhere.app.Activity; //导入方法依赖的package包/类
/**
 * Like {@link #restartWithTheme(Activity, int)}, but if third arg is true -
 * restart activity regardless theme.
 * 
 * @param activity Activity
 * @param theme Theme flags for check
 * @param force Force restart activity
 */
@SuppressLint("InlinedApi")
public static void restartWithTheme(Activity activity, int theme, boolean force) {
    if (theme < _START_RESOURCES_ID && theme > 0) {
        if (ThemeManager._THEME_MODIFIER > 0) {
            theme |= ThemeManager._THEME_MODIFIER;
        }
        theme &= ThemeManager._THEME_MASK;
    }
    if (force || ThemeManager.getTheme(activity) != theme) {
        Intent intent = new Intent(activity.getIntent());
        intent.setClass(activity, activity.getClass());
        intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
        if (theme > 0) {
            intent.putExtra(ThemeManager._THEME_TAG, theme);
        }
        intent.putExtra(KEY_INSTANCE_STATE, activity.saveInstanceState());
        intent.putExtra(KEY_CREATED_BY_THEME_MANAGER, true);
        if (activity.isRestricted()) {
            Application app = Application.getLastInstance();
            if (app != null && !app.isRestricted()) {
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                app.superStartActivity(intent, -1, null);
            }
        } else {
            if (!activity.isFinishing()) {
                activity.finish();
                activity.overridePendingTransition(0, 0);
            }
            if (activity instanceof SuperStartActivity) {
                ((SuperStartActivity) activity).superStartActivity(intent,
                        -1, null);
            } else {
                activity.startActivity(intent);
            }
        }
    }
}
 
开发者ID:WassimBenltaief,项目名称:laposte-android,代码行数:47,代码来源:ThemeManager.java


注:本文中的org.holoeverywhere.app.Activity.overridePendingTransition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。