本文整理汇总了Java中android.transition.Visibility类的典型用法代码示例。如果您正苦于以下问题:Java Visibility类的具体用法?Java Visibility怎么用?Java Visibility使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Visibility类属于android.transition包,在下文中一共展示了Visibility类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.transition.Visibility; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
// getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
super.onCreate(savedInstanceState);
Slide slideIn = new Slide();
slideIn.setDuration(500);
//设置为进入
slideIn.setMode(Visibility.MODE_IN);
//设置从右边进入
slideIn.setSlideEdge(Gravity.RIGHT);
getWindow().setEnterTransition(new ChangeImageTransform().setDuration(3000));
// getWindow().setEnterTransition(new Explode().setDuration(2000));
// getWindow().setExitTransition(new Explode().setDuration(2000));
Slide slideReturn =new Slide();
slideReturn.setDuration(500);
slideReturn.setSlideEdge(Gravity.LEFT);
slideReturn.setMode(Visibility.MODE_OUT);
getWindow().setReturnTransition (slideReturn );
setContentView(R.layout.activity_img_transition);
mImageView = (ImageView) findViewById(R.id.img);
// Transition sharedElementEnterTransition = getWindow().getSharedElementEnterTransition();
}
示例2: setupCardFlipTransition
import android.transition.Visibility; //导入依赖的package包/类
private void setupCardFlipTransition() {
CardFlipTransition flipIn = new CardFlipTransition();
flipIn.setDuration(500);
flipIn.setMode(Visibility.MODE_IN);
flipIn.addTarget(R.id.big_card);
flipIn.excludeTarget(android.R.id.navigationBarBackground, true);
flipIn.excludeTarget(android.R.id.statusBarBackground, true);
getWindow().setEnterTransition(flipIn);
CardFlipTransition flipOut = new CardFlipTransition();
flipOut.setMode(Visibility.MODE_OUT);
flipOut.setDuration(500);
flipOut.addTarget(R.id.big_card);
flipOut.excludeTarget(android.R.id.navigationBarBackground, true);
flipOut.excludeTarget(android.R.id.statusBarBackground, true);
getWindow().setExitTransition(flipOut);
}
示例3: setupCardFlipTransition
import android.transition.Visibility; //导入依赖的package包/类
private void setupCardFlipTransition() {
CardFlipTransition flipOut = new CardFlipTransition();
flipOut.setDuration(500);
flipOut.setMode(Visibility.MODE_OUT);
flipOut.addTarget(R.id.text_card);
flipOut.excludeTarget(android.R.id.navigationBarBackground, true);
flipOut.excludeTarget(android.R.id.statusBarBackground, true);
getWindow().setExitTransition(flipOut);
CardFlipTransition flipIn = new CardFlipTransition();
flipIn.setDuration(500);
flipIn.setMode(Visibility.MODE_IN);
flipIn.addTarget(R.id.text_card);
flipIn.excludeTarget(android.R.id.navigationBarBackground, true);
flipIn.excludeTarget(android.R.id.statusBarBackground, true);
getWindow().setEnterTransition(flipIn);
}
示例4: buildEnterTransition
import android.transition.Visibility; //导入依赖的package包/类
private Visibility buildEnterTransition() {
Fade enterTransition = new Fade();
enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
// This view will not be affected by enter transition animation
enterTransition.excludeTarget(R.id.square_red, true);
return enterTransition;
}
示例5: buildEnterTransition
import android.transition.Visibility; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
protected Visibility buildEnterTransition() {
Slide enterTransition = new Slide();
enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_medium));
enterTransition.setSlideEdge(Gravity.RIGHT); //从右边滑动进入
return enterTransition;
}
示例6: buildEnterTransition
import android.transition.Visibility; //导入依赖的package包/类
private Visibility buildEnterTransition() {
Slide enterTransition = new Slide();
enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
enterTransition.setSlideEdge(Gravity.RIGHT);
return enterTransition;
}
示例7: setupWindowAnimations
import android.transition.Visibility; //导入依赖的package包/类
private void setupWindowAnimations() {
Visibility enterTransition = buildEnterTransition();
getWindow().setEnterTransition(enterTransition);
}
示例8: buildReturnTransition
import android.transition.Visibility; //导入依赖的package包/类
private Visibility buildReturnTransition() {
Visibility enterTransition = new Slide();
enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
return enterTransition;
}