Java 类android.transition.Visibility 实例源码

项目:SunmiUI    文件:ImageSharedTransitionActivity.java   
@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();

    }
项目:AndroidFlipCardTransition    文件:BigCardActivity.java   
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);
}
项目:AndroidFlipCardTransition    文件:FlipCardTransitionActivity.java   
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);

}
项目:SunmiUI    文件:ImageSharedTransitionActivity.java   
@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();

    }
项目:AndroidOpen    文件:TransitionActivity1.java   
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;
}
项目:HHComicViewer    文件:OfflineDownloadBaseActivity.java   
@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;
}
项目:Material-Animations    文件:TransitionActivity1.java   
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;
}
项目:AndroidOpen    文件:TransitionActivity3.java   
private Visibility buildEnterTransition() {
    Slide enterTransition = new Slide();
    enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
    enterTransition.setSlideEdge(Gravity.RIGHT);
    return enterTransition;
}
项目:AndroidOpen    文件:TransitionActivity1.java   
private void setupWindowAnimations() {
    Visibility enterTransition = buildEnterTransition();
    getWindow().setEnterTransition(enterTransition);
}
项目:AndroidOpen    文件:TransitionActivity1.java   
private Visibility buildReturnTransition() {
    Visibility enterTransition = new Slide();
    enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
    return enterTransition;
}
项目:Material-Animations    文件:TransitionActivity3.java   
private Visibility buildEnterTransition() {
    Slide enterTransition = new Slide();
    enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
    enterTransition.setSlideEdge(Gravity.RIGHT);
    return enterTransition;
}
项目:Material-Animations    文件:TransitionActivity1.java   
private void setupWindowAnimations() {
    Visibility enterTransition = buildEnterTransition();
    getWindow().setEnterTransition(enterTransition);
}
项目:Material-Animations    文件:TransitionActivity1.java   
private Visibility buildReturnTransition() {
    Visibility enterTransition = new Slide();
    enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
    return enterTransition;
}