本文整理了Java中android.view.Window.getSharedElementEnterTransition()
方法的一些代码示例,展示了Window.getSharedElementEnterTransition()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.getSharedElementEnterTransition()
方法的具体详情如下:
包路径:android.view.Window
类名称:Window
方法名:getSharedElementEnterTransition
暂无
代码示例来源:origin: CarGuo/GSYVideoPlayer
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private boolean addTransitionListener() {
transition = getWindow().getSharedElementEnterTransition();
if (transition != null) {
transition.addListener(new OnTransitionListener(){
@Override
public void onTransitionEnd(Transition transition) {
super.onTransitionEnd(transition);
videoPlayer.startPlayLogic();
transition.removeListener(this);
}
});
return true;
}
return false;
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private boolean addTransitionListener() {
transition = getWindow().getSharedElementEnterTransition();
if (transition != null) {
transition.addListener(new OnTransitionListener(){
@Override
public void onTransitionEnd(Transition transition) {
super.onTransitionEnd(transition);
videoPlayer.startPlayLogic();
transition.removeListener(this);
}
});
return true;
}
return false;
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private boolean addTransitionListener() {
transition = getWindow().getSharedElementEnterTransition();
if (transition != null) {
transition.addListener(new OnTransitionListener(){
@Override
public void onTransitionEnd(Transition transition) {
super.onTransitionEnd(transition);
videoPlayer.startPlayLogic();
transition.removeListener(this);
}
});
return true;
}
return false;
}
代码示例来源:origin: xinghongfei/LookLook
@Override
protected void onDestroy() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().getSharedElementEnterTransition().removeListener(mListener);
}
super.onDestroy();
}
代码示例来源:origin: xinghongfei/LookLook
@Override
protected void onDestroy() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().getSharedElementReturnTransition().removeListener(mReturnHomeListener);
getWindow().getSharedElementEnterTransition().removeListener(mEnterTrasitionListener);
}
mTopNewsDesPresenter.unsubscrible();
super.onDestroy();
}
代码示例来源:origin: xinghongfei/LookLook
getWindow().getSharedElementEnterTransition().addListener(mListener);
getWindow().setSharedElementEnterTransition(new ChangeBounds());
代码示例来源:origin: Ramotion/cardslider-android
loadFullSizeBitmap(smallResId);
} else {
getWindow().getSharedElementEnterTransition().addListener(new Transition.TransitionListener() {
代码示例来源:origin: xinghongfei/LookLook
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.topnews_describe);
ButterKnife.bind(this);
setSupportActionBar(mToolbar);
mDeviceInfo = DensityUtil.getDeviceInfo(this);
width = mDeviceInfo[0];
heigh = width * 3 / 4;
initData();
initView();
getData();
enterAnimation();
chromeFader = new ElasticDragDismissFrameLayout.SystemChromeFader(this);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().getSharedElementReturnTransition().addListener(mReturnHomeListener);
getWindow().getSharedElementEnterTransition().addListener(mEnterTrasitionListener);
}
}
代码示例来源:origin: Ramotion/garland-view-android
getWindow().getSharedElementEnterTransition().addListener(new Transition.TransitionListener() {
代码示例来源:origin: contentful/gallery-app-android
@Override public void onTransitionEnd(Transition transition) {
getWindow().getSharedElementEnterTransition().removeListener(this);
photo.setVisibility(View.GONE);
}
});
代码示例来源:origin: tyrex-team/senslogs
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public EnterSharedElementTextSizeHandler(Activity activity) {
mActivity = activity;
Transition transitionWindow = activity.getWindow().getSharedElementEnterTransition();
if (!(transitionWindow instanceof TransitionSet)) {
mTransitionSet = new TransitionSet();
mTransitionSet.addTransition(transitionWindow);
} else {
mTransitionSet = (TransitionSet) transitionWindow;
}
activity.setEnterSharedElementCallback(this);
}
代码示例来源:origin: madreain/AndroidDream
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private boolean addTransitionListener() {
transition = getWindow().getSharedElementEnterTransition();
if (transition != null) {
transition.addListener(new Transition.TransitionListener() {
@Override
public void onTransitionStart(Transition transition) {
}
@Override
public void onTransitionEnd(Transition transition) {
videoPlayer.startPlayLogic();
transition.removeListener(this);
}
@Override
public void onTransitionCancel(Transition transition) {
}
@Override
public void onTransitionPause(Transition transition) {
}
@Override
public void onTransitionResume(Transition transition) {
}
});
return true;
}
return false;
}
代码示例来源:origin: alexjlockwood/adp-activity-transitions
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_details, container, false);
mAlbumImage = (ImageView) rootView.findViewById(R.id.details_album_image);
final ImageView backgroundImage = (ImageView) rootView.findViewById(R.id.details_background_image);
View textContainer = rootView.findViewById(R.id.details_text_container);
TextView albumTitleText = (TextView) textContainer.findViewById(R.id.details_album_title);
String albumImageUrl = ALBUM_IMAGE_URLS[mAlbumPosition];
String backgroundImageUrl = BACKGROUND_IMAGE_URLS[mAlbumPosition];
String albumName = ALBUM_NAMES[mAlbumPosition];
albumTitleText.setText(albumName);
mAlbumImage.setTransitionName(albumName);
RequestCreator albumImageRequest = Picasso.with(getActivity()).load(albumImageUrl);
RequestCreator backgroundImageRequest = Picasso.with(getActivity()).load(backgroundImageUrl).fit().centerCrop();
if (mIsTransitioning) {
albumImageRequest.noFade();
backgroundImageRequest.noFade();
backgroundImage.setAlpha(0f);
getActivity().getWindow().getSharedElementEnterTransition().addListener(new TransitionListenerAdapter() {
@Override
public void onTransitionEnd(Transition transition) {
backgroundImage.animate().setDuration(mBackgroundImageFadeMillis).alpha(1f);
}
});
}
albumImageRequest.into(mAlbumImage, mImageCallback);
backgroundImageRequest.into(backgroundImage);
return rootView;
}
代码示例来源:origin: googlesamples/android-ActivitySceneTransitionBasic
final Transition transition = getWindow().getSharedElementEnterTransition();
代码示例来源:origin: luhaoaimama1/LollipopTransition
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
imageView = (ImageView) view.findViewById(R.id.iv);
imageView.setTransitionName(FiveShareNormal_LibAcitivty.PIC);
if (!getArguments().getBoolean("havePic")) {
imageView.setImageBitmap(null);
((SharePic_LibAcitivity) getActivity()).go();
final Transition transition = getActivity().getWindow().getSharedElementEnterTransition();
if (transition != null) {
// There is an entering shared element transition so add a listener to it
transition.addListener(new TransitionAdapter() {
@Override
public void onTransitionEnd(Transition transition) {
Glide.with(getActivity())
.load(Images.imageThumbUrls[index = getArguments().getInt("position", 0)]).into(imageView);
}
});
}
} else {
Glide.with(getActivity())
.load(Images.imageThumbUrls[index = getArguments().getInt("position", 0)]).asBitmap().into(target);
}
imageView.setTag(index);
}
代码示例来源:origin: TongmingWu/Manga
HeaderGlide.loadBitmap(this, cover, ivBlur, intent.getStringExtra("source"));
isCover = true;
getWindow().getSharedElementEnterTransition().addListener(new Transition.TransitionListener() {
@Override
public void onTransitionStart(Transition transition) {
代码示例来源:origin: luhaoaimama1/LollipopTransition
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
imageView = (ImageView) view.findViewById(R.id.iv);
imageView.setTransitionName(FiveShareNormalAcitivty.PIC);
if (!getArguments().getBoolean("havePic")) {
imageView.setImageBitmap(null);
((SharePicAcitivity) getActivity()).go();
final Transition transition = getActivity().getWindow().getSharedElementEnterTransition();
if (transition != null) {
// There is an entering shared element transition so add a listener to it
transition.addListener(new TransitionAdapter() {
@Override
public void onTransitionEnd(Transition transition) {
Glide.with(getActivity())
.load(Images.imageThumbUrls[index = getArguments().getInt("position", 0)]).into(imageView);
}
});
}
} else {
Glide.with(getActivity())
.load(Images.imageThumbUrls[index = getArguments().getInt("position", 0)]).asBitmap().into(target);
}
imageView.setTag(index);
}
代码示例来源:origin: contentful/gallery-app-android
private void initializeViews() {
viewPager.setCurrentItem(gallery.images().indexOf(image));
viewPager.setOffscreenPageLimit(getResources().getInteger(
R.integer.gallery_pager_offscreen_limit));
repositionStar();
ViewUtils.setViewHeight(infoContainer, Const.IMAGE_HEIGHT, true);
if (Const.HAS_L && Utils.isPortrait(this)) {
ViewUtils.setViewHeight(photo, Const.IMAGE_HEIGHT, false);
photo.setImageDrawable(Holder.get());
getWindow().getSharedElementEnterTransition().addListener(new TransitionListenerAdapter() {
@Override public void onTransitionEnd(Transition transition) {
getWindow().getSharedElementEnterTransition().removeListener(this);
photo.setVisibility(View.GONE);
}
});
}
}
代码示例来源:origin: kollerlukas/Camera-Roll-Android-App
getWindow().getSharedElementEnterTransition().addListener(transitionListener);
代码示例来源:origin: rubensousa/Transitions
Intent intent = getIntent();
circleView.setTransitionName(intent.getStringExtra("transition"));
Transition transition = getWindow().getSharedElementEnterTransition();
transition.addListener(new Transition.TransitionListener() {
@Override
内容来源于网络,如有侵权,请联系作者删除!