本文整理汇总了Java中android.support.v4.app.ActivityCompat.postponeEnterTransition方法的典型用法代码示例。如果您正苦于以下问题:Java ActivityCompat.postponeEnterTransition方法的具体用法?Java ActivityCompat.postponeEnterTransition怎么用?Java ActivityCompat.postponeEnterTransition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.app.ActivityCompat
的用法示例。
在下文中一共展示了ActivityCompat.postponeEnterTransition方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.support.v4.app.ActivityCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
mController = new PlantController(this);
ActivityCompat.postponeEnterTransition(this);
// Setting OnClickListeners
findViewById(R.id.camera_fab).setOnClickListener(this);
findViewById(R.id.height_button).setOnClickListener(this);
findViewById(R.id.poop_button).setOnClickListener(this);
findViewById(R.id.water_button).setOnClickListener(this);
findViewById(R.id.calendar_button).setOnClickListener(this);
findViewById(R.id.care_tips_expand_collapse).setOnClickListener(this);
findViewById(R.id.toxic_warning_expand_collapse).setOnClickListener(this);
findViewById(R.id.noxious_warning_expand_collapse).setOnClickListener(this);
overridePendingTransition(R.anim.slide_up, R.anim.hold);
}
示例2: onCreate
import android.support.v4.app.ActivityCompat; //导入方法依赖的package包/类
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
ActivityCompat.postponeEnterTransition(this);
}
component().inject(this);
setToolbarInitialisation();
comicDetailsPresenter.setView(this);
if (getIntent() != null) {
setIntentParameters();
if (comic != null) {
setInitialTitle();
comicDetailsPresenter.setInfo(comic, this);
} else {
comicDetailsPresenter.errorGettingInfo(this);
}
} else {
comicDetailsPresenter.errorGettingInfo(this);
}
}
示例3: onCreate
import android.support.v4.app.ActivityCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setupLayoutStableFullscreen();
restoreState(savedInstanceState);
if (!shouldUseDataBinding()) {
// set contentView if child activity not use dataBinding
setContentView(getLayout());
initViews();
}
if (shouldPostponeTransition()) {
ActivityCompat.postponeEnterTransition(this);
}
CommonUtils.hideSoftKeyboard(this);
}
示例4: onCreate
import android.support.v4.app.ActivityCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityCompat.postponeEnterTransition(this);
ActivityCompat.setEnterSharedElementCallback(this, enterTransitionCallback);
int mUIFlag = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LOW_PROFILE
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
getWindow().getDecorView().setSystemUiVisibility(mUIFlag);
setContentView(R.layout.activity_view_pager_gallery);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("Gallery");
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
galleryViewPagerAdapter = new GalleryViewPagerAdapter(this);
viewPager = (ViewPager) findViewById(R.id.container);
viewPager.setAdapter(galleryViewPagerAdapter);
int position = selectedIndex = getIntent().getIntExtra(EXTRA_POSITION, 0);
viewPager.setCurrentItem(position);
viewPager.setOnPageChangeListener(pageChangeListener);
viewPager.getViewTreeObserver().addOnGlobalLayoutListener(pagerLayoutListener);
}
示例5: onCreate
import android.support.v4.app.ActivityCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_image_detail);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
getSupportLoaderManager().initLoader(0, null, this);
//Postpone transition here
ActivityCompat.postponeEnterTransition(this);
mPager = (ViewPager) findViewById(R.id.pager);
mPager.setPageTransformer(false, new ParallaxPagerTransformer(R.id.image));
mPagerAdapter = new MyPagerAdapter(getSupportFragmentManager());
mPager.setAdapter(mPagerAdapter);
mPager.setPageMargin((int) TypedValue
.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1, getResources().getDisplayMetrics()));
mPager.setPageMarginDrawable(new ColorDrawable(0x22000000));
mPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageScrollStateChanged(int state) {
super.onPageScrollStateChanged(state);
}
@Override
public void onPageSelected(int position) {
if (mCursor != null) {
mCursor.moveToPosition(position);
}
mSelectedItemId = mCursor.getLong(GalleryLoader.Query.COLUMN_IMAGE_ID);
}
});
if (savedInstanceState == null) {
if (getIntent() != null && getIntent().getData() != null) {
mStartId = GalleryContract.GalleryEntry.getItemId(getIntent().getData());
mSelectedItemId = mStartId;
}
}
}
示例6: onCreate
import android.support.v4.app.ActivityCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_article_detail);
getSupportLoaderManager().initLoader(0, null, this);
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_IMMERSIVE);
//Postpone transition here
ActivityCompat.postponeEnterTransition(this);
mPager = (ViewPager) findViewById(R.id.pager);
mPager.setPageTransformer(false, new ParallaxPagerTransformer(R.id.photo));
mPagerAdapter = new MyPagerAdapter(getSupportFragmentManager());
mPager.setAdapter(mPagerAdapter);
mPager.setPageMargin((int) TypedValue
.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1, getResources().getDisplayMetrics()));
mPager.setPageMarginDrawable(new ColorDrawable(0x22000000));
mPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageScrollStateChanged(int state) {
super.onPageScrollStateChanged(state);
}
@Override
public void onPageSelected(int position) {
if (mCursor != null) {
mCursor.moveToPosition(position);
}
mSelectedItemId = mCursor.getLong(ArticleLoader.Query.COLUMN_ARTICLE_ID);
}
});
if (savedInstanceState == null) {
if (getIntent() != null && getIntent().getData() != null) {
mStartId = ArticleContract.ArticleEntry.getItemId(getIntent().getData());
mSelectedItemId = mStartId;
}
}
}
示例7: postponeEnterTransition
import android.support.v4.app.ActivityCompat; //导入方法依赖的package包/类
private void postponeEnterTransition() {
if (isAfterEnter) return;
ActivityCompat.postponeEnterTransition(activity);
isPostponeEnterTransition = true;
}