本文整理了Java中android.view.Window.setSharedElementExitTransition()
方法的一些代码示例,展示了Window.setSharedElementExitTransition()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.setSharedElementExitTransition()
方法的具体详情如下:
包路径:android.view.Window
类名称:Window
方法名:setSharedElementExitTransition
暂无
代码示例来源:origin: ongakuer/PhotoDraweeView
@TargetApi(Build.VERSION_CODES.LOLLIPOP) private void initWindowTransitions() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
AutoTransition transition = new AutoTransition();
getWindow().setSharedElementEnterTransition(transition);
getWindow().setSharedElementExitTransition(transition);
ActivityCompat.setEnterSharedElementCallback(this, new SharedElementCallback() {
@Override public void onSharedElementEnd(List<String> sharedElementNames,
List<View> sharedElements, List<View> sharedElementSnapshots) {
for (final View view : sharedElements) {
if (view instanceof PhotoDraweeView) {
((PhotoDraweeView) view).setScale(1f, true);
}
}
}
});
}
}
}
代码示例来源:origin: mohak1712/UberUX
private void setupWindowAnimations() {
ChangeBounds exitTransition = new ChangeBounds();
exitTransition.setDuration(1000);
exitTransition.addListener(exitListener);
getWindow().setSharedElementExitTransition(exitTransition);
ChangeBounds reenterTransition = new ChangeBounds();
reenterTransition.setDuration(1000);
reenterTransition.addListener(reenterListener);
reenterTransition.setInterpolator(new DecelerateInterpolator(4));
getWindow().setSharedElementReenterTransition(reenterTransition);
}
代码示例来源:origin: com.albedinsky.android/ui-transition
/**
* Attaches all transitions for shared elements specified for this navigational transition to
* the given <var>window</var>.
* <p>
* This will attach only transitions of which particular flags are contained within {@link #mTransitions}
* flags.
*
* @param window The window to which should be transitions attached.
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void attachSharedElementTransitions(Window window) {
if ((mTransitions & TRANSITION_SHARED_ELEMENT_ENTER) != 0)
window.setSharedElementEnterTransition(mSharedElementEnterTransition);
if ((mTransitions & TRANSITION_SHARED_ELEMENT_REENTER) != 0)
window.setSharedElementReenterTransition(mSharedElementReenterTransition);
if ((mTransitions & TRANSITION_SHARED_ELEMENT_RETURN) != 0)
window.setSharedElementReturnTransition(mSharedElementReturnTransition);
if ((mTransitions & TRANSITION_SHARED_ELEMENT_EXIT) != 0)
window.setSharedElementExitTransition(mSharedElementExitTransition);
}
代码示例来源:origin: com.albedinsky.android/ui
/**
* Attaches all transitions for shared elements specified for this navigational transition to
* the given <var>window</var>.
* <p>
* This will attach only transitions of which particular flags are contained within {@link #mTransitions}
* flags.
*
* @param window The window to which should be transitions attached.
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void attachSharedElementTransitions(Window window) {
if ((mTransitions & TRANSITION_SHARED_ELEMENT_ENTER) != 0)
window.setSharedElementEnterTransition(mSharedElementEnterTransition);
if ((mTransitions & TRANSITION_SHARED_ELEMENT_REENTER) != 0)
window.setSharedElementReenterTransition(mSharedElementReenterTransition);
if ((mTransitions & TRANSITION_SHARED_ELEMENT_RETURN) != 0)
window.setSharedElementReturnTransition(mSharedElementReturnTransition);
if ((mTransitions & TRANSITION_SHARED_ELEMENT_EXIT) != 0)
window.setSharedElementExitTransition(mSharedElementExitTransition);
}
代码示例来源:origin: lynfogeek/conference-app
/**
* Enable to share views across activities with animation
* on Android 5.0 Lollipop
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void setupLollipop() {
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
getWindow().setSharedElementExitTransition(new ChangeBounds());
getWindow().setSharedElementEnterTransition(new ChangeBounds());
}
代码示例来源:origin: lynfogeek/conference-app
/**
* Enable to share views across activities with animation
* on Android 5.0 Lollipop
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void setupLollipop() {
getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
getWindow().setSharedElementExitTransition(new ChangeBounds());
getWindow().setSharedElementEnterTransition(new ChangeBounds());
}
代码示例来源:origin: shalskar/PeekAndPopDemo
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_example);
if(Build.VERSION.SDK_INT >= 21) {
getWindow().setSharedElementEnterTransition(enterTransition());
getWindow().setSharedElementExitTransition(null);
getWindow().setSharedElementReturnTransition(null);
getWindow().setExitTransition(null);
getWindow().setReturnTransition(null);
}
imageUrl = getIntent().getExtras().getString(Constants.IMAGE_URL);
loadImage();
}
代码示例来源:origin: DingMouRen/DingDingMap
getWindow().setSharedElementExitTransition(new ChangeImageTransform());
getWindow().setSharedElementReenterTransition(new ChangeImageTransform());
代码示例来源:origin: DingMouRen/DingDingMusic
private void setupWindowAnimation() {
Explode explode = new Explode();
explode.setDuration(1000);
Fade fade = new Fade();
fade.setDuration(500);
getWindow().setReenterTransition(fade);
getWindow().setExitTransition(explode);
getWindow().setSharedElementExitTransition(new ChangeImageTransform());
getWindow().setSharedElementReenterTransition(new ChangeImageTransform());
}
代码示例来源:origin: lianghuiyong/AndroidBase
getWindow().setReturnTransition(new Fade());
getWindow().setSharedElementExitTransition(new ChangeBounds());
getWindow().setSharedElementEnterTransition(new ChangeBounds());
getWindow().setSharedElementReenterTransition(new ChangeBounds());
getWindow().setReturnTransition(new Fade());
getWindow().setSharedElementExitTransition(new ChangeClipBounds());
getWindow().setSharedElementEnterTransition(new ChangeClipBounds());
getWindow().setSharedElementReenterTransition(new ChangeClipBounds());
getWindow().setReturnTransition(new Fade());
getWindow().setSharedElementExitTransition(new ChangeTransform());
getWindow().setSharedElementEnterTransition(new ChangeTransform());
getWindow().setSharedElementReenterTransition(new ChangeTransform());
getWindow().setReturnTransition(new Fade());
getWindow().setSharedElementExitTransition(new ChangeImageTransform());
getWindow().setSharedElementEnterTransition(new ChangeImageTransform());
getWindow().setSharedElementReenterTransition(new ChangeImageTransform());
内容来源于网络,如有侵权,请联系作者删除!