本文整理汇总了Java中android.support.v7.app.AppCompatActivity.overridePendingTransition方法的典型用法代码示例。如果您正苦于以下问题:Java AppCompatActivity.overridePendingTransition方法的具体用法?Java AppCompatActivity.overridePendingTransition怎么用?Java AppCompatActivity.overridePendingTransition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.app.AppCompatActivity
的用法示例。
在下文中一共展示了AppCompatActivity.overridePendingTransition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: navigateToDetailsActivity
import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
public static void navigateToDetailsActivity(AppCompatActivity activity, String sku,
String pathRates, String pathTransactions) {
Intent intent = new Intent(activity, ProductsTransactionsActivity.class);
Bundle data = new Bundle();
data.putString(KEY_PRODUCT_SKU, sku);
data.putString(KEY_TRANSACTIONS_PATH, pathTransactions);
data.putString(KEY_RATES_PATH, pathRates);
intent.putExtras(data);
activity.startActivity(intent);
activity.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
}
示例2: navigateToDetailsActivity
import android.support.v7.app.AppCompatActivity; //导入方法依赖的package包/类
/**
* Navigate To details of the comic using different animations depending on the Android version
*/
public static void navigateToDetailsActivity(AppCompatActivity activity, ComicUI comic, View view) {
Intent intent = new Intent(activity, ComicDetailsActivity.class);
Bundle data = new Bundle();
data.putParcelable(KEY_COMIC, comic);
intent.putExtras(data);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
ActivityOptionsCompat optionsCompat = ActivityOptionsCompat.makeSceneTransitionAnimation(activity,
view, IMG_TRANSITION_TAG);
ActivityCompat.startActivity(activity, intent, optionsCompat.toBundle());
} else {
activity.startActivity(intent);
activity.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
}
}