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