當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。