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