本文整理了Java中android.view.Window.setSharedElementsUseOverlay()
方法的一些代码示例,展示了Window.setSharedElementsUseOverlay()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.setSharedElementsUseOverlay()
方法的具体详情如下:
包路径:android.view.Window
类名称:Window
方法名:setSharedElementsUseOverlay
暂无
代码示例来源:origin: jonasbleyl/recurrence
@Override
public void onClick(View view) {
Intent intent = new Intent(context, ViewActivity.class);
intent.putExtra("NOTIFICATION_ID", reminderList.get(viewHolder.getAdapterPosition()).getId());
// Add shared element transition animation if on Lollipop or later
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
CardView cardView = (CardView) view.findViewById(R.id.notification_card);
TransitionSet setExit = new TransitionSet();
Transition transition = new Fade();
transition.excludeTarget(android.R.id.statusBarBackground, true);
transition.excludeTarget(android.R.id.navigationBarBackground, true);
transition.excludeTarget(R.id.fab_button, true);
transition.excludeTarget(R.id.recycler_view, true);
transition.setDuration(400);
setExit.addTransition(transition);
((Activity) context).getWindow().setSharedElementsUseOverlay(false);
((Activity) context).getWindow().setReenterTransition(null);
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(((Activity) context), cardView, "cardTransition");
ActivityCompat.startActivity(((Activity) context), intent, options.toBundle());
((RecyclerListener) context).hideFab();
} else {
context.startActivity(intent);
}
}
});
代码示例来源:origin: lianghuiyong/AndroidBase
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AppManager.getAppManager().addActivity(this);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
getWindow().setSharedElementsUseOverlay(true);
setTransition(getIntent().getIntExtra(TAG_ANIM, 0));
}
binding = DataBindingUtil.setContentView(this, getLayoutId());
EventBus.getDefault().register(this);
ButterKnife.bind(this);
initRecyclerView();
init();
initTabs();
}
代码示例来源:origin: materialos/android-icon-pack
getWindow().setSharedElementsUseOverlay(false);
代码示例来源:origin: materialos/android-icon-pack
private void setUpTransitions() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().setSharedElementsUseOverlay(true);
内容来源于网络,如有侵权,请联系作者删除!