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


Java TransitionSet.setOrdering方法代码示例

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


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

示例1: initTransitions

import android.transition.TransitionSet; //导入方法依赖的package包/类
@TargetApi(21) private void initTransitions() {

    Window window = getActivity().getWindow();
    window.setEnterTransition(
        new ExplodeFadeEnterTransition(senderNameView, senderMailView, separatorLine));
    window.setExitTransition(new ExcludedExplodeTransition());
    window.setReenterTransition(new ExcludedExplodeTransition());
    window.setReturnTransition(new ExcludedExplodeTransition());

    TransitionSet textSizeSet = new TransitionSet();
    textSizeSet.addTransition(
        TransitionInflater.from(getActivity()).inflateTransition(android.R.transition.move));
    TextSizeTransition textSizeTransition = new TextSizeTransition();
    textSizeTransition.addTarget(R.id.subject);
    textSizeTransition.addTarget(getString(R.string.shared_mail_subject));

    textSizeSet.addTransition(textSizeTransition);
    textSizeSet.setOrdering(TransitionSet.ORDERING_TOGETHER);

    window.setSharedElementEnterTransition(textSizeSet);
    getActivity().setEnterSharedElementCallback(
        new TextSizeEnterSharedElementCallback(getActivity()));
  }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:DetailsFragment.java

示例2: createTransition

import android.transition.TransitionSet; //导入方法依赖的package包/类
private Transition createTransition() {
    TransitionSet set = new TransitionSet();
    set.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);

    Transition tFab = new Scale();
    tFab.setDuration(150);
    tFab.addTarget(fab);

    Transition tTitle = new Fold();
    tTitle.setDuration(150);
    tTitle.addTarget(titlePanel);

    Transition tTrack = new Fold();
    tTrack.setDuration(150);
    tTrack.addTarget(trackPanel);

    set.addTransition(tTrack);
    set.addTransition(tTitle);
    set.addTransition(tFab);

    return set;
}
 
开发者ID:treehouse,项目名称:android-animations-transitions,代码行数:23,代码来源:AlbumDetailActivity.java

示例3: onCheckedChanged

import android.transition.TransitionSet; //导入方法依赖的package包/类
@Override public void onCheckedChanged(final RadioGroup group, int checkedId) {
    switch (checkedId) {
        case R.id.select_scene_1: {
            // You can start an automatic transition with TransitionManager.go().
            TransitionManager.go(mScene1);
            break;
        }
        case R.id.select_scene_2: {
            TransitionSet set = new TransitionSet();
            Slide slide = new Slide(Gravity.LEFT);
            slide.addTarget(R.id.transition_title);
            set.addTransition(slide);
            set.addTransition(new ChangeBounds());
            set.setOrdering(TransitionSet.ORDERING_TOGETHER);
            set.setDuration(350);
            TransitionManager.go(mScene2, set);
            break;
        }
        case R.id.select_scene_3: {
            // You can also start a transition with a custom TransitionManager.
            mTransitionManagerForScene3.transitionTo(mScene3);
            break;
        }
    }
}
 
开发者ID:xu6148152,项目名称:binea_project_for_android,代码行数:26,代码来源:ScenesSample.java

示例4: makeSharedElementEnterTransition

import android.transition.TransitionSet; //导入方法依赖的package包/类
public static Transition makeSharedElementEnterTransition(List<String> textTransitionNames) {
    TransitionSet set = new TransitionSet();
    set.setOrdering(TransitionSet.ORDERING_TOGETHER);

    Transition recolor = new Recolor();
    Transition changeBounds = new ChangeBounds();
    Transition textSize = new TextSizeTransition();

    for (String textTName : textTransitionNames) {
        changeBounds.addTarget(textTName);
        textSize.addTarget(textTName);
        recolor.addTarget(textTName);
    }

    set.addTransition(recolor);
    set.addTransition(changeBounds);
    set.addTransition(textSize);

    ///set.setDuration(3000);
    return set;
}
 
开发者ID:ndorigatti,项目名称:RevealPathMotion,代码行数:22,代码来源:TransitionUtils.java

示例5: onGoClicked

import android.transition.TransitionSet; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@OnClick(R.id.next)
protected void onGoClicked(View view) {

    AccelerateInterpolator interpolator = new AccelerateInterpolator(1.5f);
    Slide right = new Slide(Gravity.END);
    right.setInterpolator(interpolator);
    right.addTarget(R.id.text);

    Slide left = new Slide(Gravity.START);
    left.setInterpolator(interpolator);
    left.addTarget(R.id.icon);

    TransitionSet set = new TransitionSet();
    set.setOrdering(TransitionSet.ORDERING_TOGETHER);
    set.addTransition(right).addTransition(left);
    setExitTransition(set);


    AppListFragment fragment = new AppListFragment();
    Bundle args = new Bundle();
    int cX = (int) (view.getX() + view.getWidth() / 2);
    int cY = (int) (view.getY() + view.getHeight() / 2);
    args.putInt("cX", cX);
    args.putInt("cY", cY);
    fragment.setArguments(args);
    fragment.setEnterTransition(new Fade());
    getActivity().getFragmentManager().beginTransaction()
            .replace(R.id.root, fragment)
            .addToBackStack(null)
            .commit();
}
 
开发者ID:fzymek,项目名称:FunWithAndroid,代码行数:33,代码来源:WelcomeFragmentStep2.java

示例6: getAudioTransition

import android.transition.TransitionSet; //导入方法依赖的package包/类
@Override public Object getAudioTransition() {
    final ChangeText tc = new ChangeText();
    tc.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT_IN);
    final TransitionSet inner = new TransitionSet();
    inner.addTransition(tc).addTransition(new ChangeBounds());
    final TransitionSet tg = new TransitionSet();
    tg.addTransition(new Fade(Fade.OUT)).addTransition(inner).
            addTransition(new Fade(Fade.IN));
    tg.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
    tg.setDuration(TRANSITION_DURATION);
    return tg;
}
 
开发者ID:Tombarr,项目名称:Noyze,代码行数:13,代码来源:TransitionKitKat.java

示例7: setupTransitions

import android.transition.TransitionSet; //导入方法依赖的package包/类
private void setupTransitions() {
//        Slide slide = new Slide(Gravity.BOTTOM);
//        slide.excludeTarget(android.R.id.statusBarBackground, true);
//        getWindow().setEnterTransition(slide);
//        getWindow().setSharedElementsUseOverlay(false);

        mTransitionManager = new TransitionManager();
        ViewGroup transitionRoot = detailContainer;

        // Expanded scene
        mExpandedScene = Scene.getSceneForLayout(transitionRoot,
                R.layout.activity_album_detail_expanded, this);

        mExpandedScene.setEnterAction(new Runnable() {
            @Override
            public void run() {
                ButterKnife.bind(AlbumDetailActivity.this);
                populate();
                mCurrentScene = mExpandedScene;
            }
        });

        TransitionSet expandTransitionSet = new TransitionSet();
        expandTransitionSet.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
        ChangeBounds changeBounds = new ChangeBounds();
        changeBounds.setDuration(200);
        expandTransitionSet.addTransition(changeBounds);

        Fade fadeLyrics = new Fade();
        fadeLyrics.addTarget(R.id.lyrics);
        fadeLyrics.setDuration(150);
        expandTransitionSet.addTransition(fadeLyrics);

        // Collapsed scene
        mCollapsedScene = Scene.getSceneForLayout(transitionRoot,
                R.layout.activity_album_detail, this);

        mCollapsedScene.setEnterAction(new Runnable() {
            @Override
            public void run() {
                ButterKnife.bind(AlbumDetailActivity.this);
                populate();
                mCurrentScene = mCollapsedScene;
            }
        });

        TransitionSet collapseTransitionSet = new TransitionSet();
        collapseTransitionSet.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);

        Fade fadeOutLyrics = new Fade();
        fadeOutLyrics.addTarget(R.id.lyrics);
        fadeOutLyrics.setDuration(150);
        collapseTransitionSet.addTransition(fadeOutLyrics);

        ChangeBounds resetBounds = new ChangeBounds();
        resetBounds.setDuration(200);
        collapseTransitionSet.addTransition(resetBounds);

        mTransitionManager.setTransition(mExpandedScene, mCollapsedScene, collapseTransitionSet);
        mTransitionManager.setTransition(mCollapsedScene, mExpandedScene, expandTransitionSet);
        mCollapsedScene.enter();

//        postponeEnterTransition();
    }
 
开发者ID:treehouse,项目名称:android-animations-transitions,代码行数:65,代码来源:AlbumDetailActivity.java

示例8: onCreate

import android.transition.TransitionSet; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
    getWindow().setAllowEnterTransitionOverlap(true);
    getWindow().setAllowReturnTransitionOverlap(true);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_ending);

    TextView bigtitle = (TextView) findViewById(R.id.title_big);
    bigtitle.setText(getIntent().getStringExtra("bigtitle"));
    //ViewCompat.setTransitionName(bigtitle, "bigtitle");

    TextView subtitle = (TextView) findViewById(R.id.subtitle);
    subtitle.setText(getIntent().getStringExtra("subtitle"));
    //ViewCompat.setTransitionName(subtitle, "subtitle");

   // ImageView image = (ImageView) findViewById(R.id.thumbnail);
 //   ViewCompat.setTransitionName(image, "thumbnail");

    List<String> textNames = new ArrayList<>();
    textNames.add("bigtitle");
    textNames.add("subtitle");
    getWindow().setEnterTransition(TransitionUtils.makeEnterTransition());
    /** --------------------- ENTER TRANSITION ------------------------------ */
    //Get the "Text" transition
    Transition textTransition = TransitionUtils.makeSharedElementEnterTransition(textNames);
    textTransition.setDuration(900);
    //Get the "Reveal" transition
    Transition revealTransition = TransitionInflater.from(this).inflateTransition(R.transition.shared_element_enter);
    revealTransition.setDuration(800);
    //Create a set for both transitions
    TransitionSet set = new TransitionSet();
    set.setOrdering(TransitionSet.ORDERING_TOGETHER);
    set.addTransition(revealTransition);
    set.addTransition(textTransition);
    //Set shared element enter transition
    getWindow().setSharedElementEnterTransition(set);
    /** --------------------- RETURN TRANSITION ------------------------------ */
    // Get the "Reveal" return transition
    Transition returnTransition = TransitionInflater.from(this).inflateTransition(R.transition.shared_element_return);
    returnTransition.setDuration(800);
    //Create a set for the return
    TransitionSet returnSet = new TransitionSet();
    returnSet.setOrdering(TransitionSet.ORDERING_TOGETHER);
    returnSet.addTransition(returnTransition);
    returnSet.addTransition(textTransition);
    getWindow().setSharedElementReturnTransition(returnSet);

    //---------------------- SHARED ELEMENT CALLBACK
    // setEnterSharedElementCallback(new EnterSharedElementTextCallback(this));// Use this for "TextSmooth" only
    // setEnterSharedElementCallback(new EnterSharedElementRevealCallback(this)); // Use this for "ImageReveal" only
    setEnterSharedElementCallback(new EnterSharedElementRevealAndTextCallback(this)); // this should animate both!
}
 
开发者ID:ndorigatti,项目名称:RevealPathMotion,代码行数:54,代码来源:EndingActivity.java

示例9: createTransitionSet

import android.transition.TransitionSet; //导入方法依赖的package包/类
static Object createTransitionSet(boolean sequential) {
    TransitionSet set = new TransitionSet();
    set.setOrdering(sequential ? TransitionSet.ORDERING_SEQUENTIAL :
        TransitionSet.ORDERING_TOGETHER);
    return set;
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:7,代码来源:TransitionHelperKitkat.java


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