当前位置: 首页>>代码示例>>Java>>正文


Java Slide.setSlideEdge方法代码示例

本文整理汇总了Java中android.transition.Slide.setSlideEdge方法的典型用法代码示例。如果您正苦于以下问题:Java Slide.setSlideEdge方法的具体用法?Java Slide.setSlideEdge怎么用?Java Slide.setSlideEdge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.transition.Slide的用法示例。


在下文中一共展示了Slide.setSlideEdge方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.transition.Slide; //导入方法依赖的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();

    }
 
开发者ID:teisun,项目名称:SunmiUI,代码行数:25,代码来源:ImageSharedTransitionActivity.java

示例2: setupSlideTransition

import android.transition.Slide; //导入方法依赖的package包/类
private void setupSlideTransition() {
    Slide slideEnter = new Slide();
    slideEnter.setSlideEdge(Gravity.LEFT);
    slideEnter.setDuration(500);
    slideEnter.setStartDelay(250);
    slideEnter.excludeTarget(android.R.id.navigationBarBackground, true);
    slideEnter.excludeTarget(android.R.id.statusBarBackground, true);

    getWindow().setEnterTransition(slideEnter);

    Slide slideOut = new Slide();
    slideOut.setSlideEdge(Gravity.RIGHT);
    slideOut.setDuration(500);
    slideOut.setStartDelay(0);
    slideOut.excludeTarget(android.R.id.navigationBarBackground, true);
    slideOut.excludeTarget(android.R.id.statusBarBackground, true);

    getWindow().setExitTransition(slideOut);
}
 
开发者ID:suzp1984,项目名称:AndroidFlipCardTransition,代码行数:20,代码来源:BigCardActivity.java

示例3: setupSlideTransition

import android.transition.Slide; //导入方法依赖的package包/类
private void setupSlideTransition() {
    Slide slideEnter = new Slide();
    slideEnter.addTarget(R.id.text_card);
    slideEnter.setDuration(1000);
    slideEnter.setStartDelay(500);
    slideEnter.setSlideEdge(Gravity.RIGHT);
    slideEnter.excludeTarget(android.R.id.navigationBarBackground, true);
    slideEnter.excludeTarget(android.R.id.statusBarBackground, true);

    getWindow().setEnterTransition(slideEnter);
    // Tips: Cann't set same Transition object to more than one Transition callbacks.
    // getWindow().setReenterTransition(slideEnter);

    Slide slideOut = new Slide();
    slideOut.addTarget(R.id.text_card);
    slideOut.setDuration(500);
    slideOut.setSlideEdge(Gravity.RIGHT);
    slideOut.excludeTarget(android.R.id.navigationBarBackground, true);
    slideOut.excludeTarget(android.R.id.statusBarBackground, true);
    getWindow().setExitTransition(slideOut);
}
 
开发者ID:suzp1984,项目名称:AndroidFlipCardTransition,代码行数:22,代码来源:FlipCardTransitionActivity.java

示例4: click

import android.transition.Slide; //导入方法依赖的package包/类
public void click(View view) {
    /*
     * Slide: this transition tracks changes to the visibility of target views
     *        in the start and end scenes and moves views in or out
     *        from one of the edges of the scene.
     */
    Slide slide = new Slide();
    // Change the edge that Views appear and disappear from.
    slide.setSlideEdge(Gravity.TOP);

    ViewGroup root = (ViewGroup) findViewById(android.R.id.content);
    /*
     * beginDelayedTransition: Convenience method to animate to a new scene
     *                         defined by all changes within the given scene root
     *                         between calling this method and the next rendering frame.
     */
    TransitionManager.beginDelayedTransition(root, slide);
    imageView.setVisibility(View.INVISIBLE);
}
 
开发者ID:george-sp,项目名称:MaterialDesign-Udacity,代码行数:20,代码来源:MainActivity.java

示例5: loadFragment

import android.transition.Slide; //导入方法依赖的package包/类
private void loadFragment(Fragment fragment, Boolean addToBackState) {
    String tag = fragment.getClass().getCanonicalName();
    if (fragmentManager.findFragmentByTag(tag) != null && savedInstance != null) {
        fragmentManager.popBackStack(tag, FragmentManager.POP_BACK_STACK_INCLUSIVE);
        fragmentManager.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
    }
    if (savedInstance == null) {
        Log.i(TAG, "Fragment Loaded (" + tag + ")");
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Slide slideIn = new Slide();
            slideIn.setSlideEdge(Gravity.RIGHT);
            fragment.setEnterTransition(slideIn);
            Slide slideOut = new Slide();
            slideOut.setSlideEdge(Gravity.LEFT);
            fragment.setExitTransition(slideOut);
        }
        FragmentTransaction tran = fragmentManager.beginTransaction()
                .replace(R.id.fragment_container, fragment, tag);

        if (addToBackState)
            tran.addToBackStack(tag);
        tran.commitAllowingStateLoss();
    }
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:25,代码来源:OFragmentUtils.java

示例6: setupWindowAnimations

import android.transition.Slide; //导入方法依赖的package包/类
private void setupWindowAnimations() {
    // Re-enter transition is executed when returning to this activity
    Slide slideTransition = new Slide();
    slideTransition.setSlideEdge(Gravity.LEFT);
    slideTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
    getWindow().setReenterTransition(slideTransition);
    getWindow().setExitTransition(slideTransition);
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:9,代码来源:MainActivity.java

示例7: onInit

import android.transition.Slide; //导入方法依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
protected void onInit(Bundle savedInstanceState) {
    Slide slide = new Slide();
    slide.setSlideEdge(Gravity.LEFT);//滑出的方向
    slide.setInterpolator(new DecelerateInterpolator());
    slide.setDuration(500);//动画持续时间
    getWindow().setExitTransition(slide);
    // init your data and call mLoadingAndRetryManager.xxx to control the view show and gone
    loadData();
    ContextCompat.getColor(this, R.color.colorPrimary);
}
 
开发者ID:Yuphee,项目名称:LoadManager,代码行数:13,代码来源:MainActivity.java

示例8: buildEnterTransition

import android.transition.Slide; //导入方法依赖的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;
}
 
开发者ID:huxizhijian,项目名称:HHComicViewer,代码行数:8,代码来源:OfflineDownloadBaseActivity.java

示例9: buildEnterTransition

import android.transition.Slide; //导入方法依赖的package包/类
private Visibility buildEnterTransition() {
    Slide enterTransition = new Slide();
    enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
    enterTransition.setSlideEdge(Gravity.RIGHT);
    return enterTransition;
}
 
开发者ID:shenhuanet,项目名称:AndroidOpen,代码行数:7,代码来源:TransitionActivity3.java


注:本文中的android.transition.Slide.setSlideEdge方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。