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


Java TransitionSet类代码示例

本文整理汇总了Java中android.support.transition.TransitionSet的典型用法代码示例。如果您正苦于以下问题:Java TransitionSet类的具体用法?Java TransitionSet怎么用?Java TransitionSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: setOnStaggeredTransitionPreparedListener_setsField_whenPassed_nonNull_listener

import android.support.transition.TransitionSet; //导入依赖的package包/类
@Test
public void setOnStaggeredTransitionPreparedListener_setsField_whenPassed_nonNull_listener() {
    //given
    StaggeredAnimationGroup spiedGroup = prepareSpiedGroup();
    StaggeredAnimationGroup.OnTransitionPreparedListener testListener =
            new StaggeredAnimationGroup.OnTransitionPreparedListener() {
                @Override
                public TransitionSet onStaggeredTransitionPrepared(TransitionSet transition, boolean show, boolean inReversedOrder) {
                    return transition;
                }
            };

    //when
    spiedGroup.setOnTransitionPreparedListener(testListener);

    //then
    assertThat(spiedGroup.onPreparedListener).isEqualTo(testListener);
}
 
开发者ID:blipinsk,项目名称:StaggeredAnimationGroup,代码行数:19,代码来源:StaggeredAnimationGroupTest.java

示例2: onResume

import android.support.transition.TransitionSet; //导入依赖的package包/类
@Override
protected void onResume() {
    super.onResume();
    if (mTextView == null)
        return;

    mTextView.postDelayed(new Runnable() {
        @Override
        public void run() {
            if (mTextView != null) {
                TransitionSet transition = (TransitionSet) new TransitionSet().addTransition(new Fade(Fade.OUT)).addTransition(new ChangeBounds()).addTransition(new Fade(Fade.IN)).setDuration(1000);
                TransitionManager.beginDelayedTransition(logoContainer, transition);
                mTextView.setVisibility(View.VISIBLE);
            }
        }
    }, 1000);
}
 
开发者ID:salemoh,项目名称:GoldenQuranAndroid,代码行数:18,代码来源:LanguageActivity.java

示例3: hideWithFadeView

import android.support.transition.TransitionSet; //导入依赖的package包/类
public static void hideWithFadeView(boolean on, ViewGroup rootView, View view) {
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        Fade fade = new Fade();
        fade.setDuration(500);

        ChangeBounds changeBounds = new ChangeBounds();
        changeBounds.setDuration(500);

        TransitionSet transitionSet = new TransitionSet();
        transitionSet.addTransition(fade);
        transitionSet.addTransition(changeBounds);
        transitionSet.setOrdering(TransitionSet.ORDERING_TOGETHER);
        TransitionManager.beginDelayedTransition(rootView, transitionSet);
    }
    view.setVisibility(on ? View.GONE : View.VISIBLE);
}
 
开发者ID:active-citizen,项目名称:android.java,代码行数:17,代码来源:UIhelper.java

示例4: goneSlidingTabs

import android.support.transition.TransitionSet; //导入依赖的package包/类
private void goneSlidingTabs(boolean on) {
    if (!isInvisible) {
        Fade fade = new Fade();
        fade.setDuration(500);

        ChangeBounds changeBounds = new ChangeBounds();
        changeBounds.setDuration(500);

        TransitionSet transitionSet = new TransitionSet();
        transitionSet.addTransition(fade);
        transitionSet.addTransition(changeBounds);
        transitionSet.setOrdering(TransitionSet.ORDERING_TOGETHER);

        TransitionManager.beginDelayedTransition(getBinding().root, transitionSet);
        getBinding().slidingTabs.setVisibility(on ? View.GONE : View.VISIBLE);
    }
}
 
开发者ID:active-citizen,项目名称:android.java,代码行数:18,代码来源:FriendProfileTabFragmentVM.java

示例5: animateForViewGroupTransition

import android.support.transition.TransitionSet; //导入依赖的package包/类
public static void animateForViewGroupTransition(ViewGroup viewGroup) {
    ChangeBounds changeBounds = new ChangeBounds();
    Fade fadeOut = new Fade(Fade.OUT);
    Fade fadeIn = new Fade(Fade.IN);
    TransitionSet transition = new TransitionSet();
    transition.setOrdering(TransitionSet.ORDERING_TOGETHER);
    transition.addTransition(fadeOut)
            .addTransition(changeBounds)
            .addTransition(fadeIn);

    TransitionManager.beginDelayedTransition(viewGroup);
}
 
开发者ID:fantasy1022,项目名称:FancyTrendView,代码行数:13,代码来源:UiUtils.java

示例6: onStaggeredTransitionPrepared

import android.support.transition.TransitionSet; //导入依赖的package包/类
@NonNull
@Override
public TransitionSet onStaggeredTransitionPrepared(@NonNull TransitionSet transitionSet,
                                                   boolean isShowing,
                                                   boolean inReversedOrder) {
    return transitionSet;
}
 
开发者ID:blipinsk,项目名称:StaggeredAnimationGroup,代码行数:8,代码来源:StaggeredAnimationGroup.java

示例7: addTransitionToStaggeredTransition

import android.support.transition.TransitionSet; //导入依赖的package包/类
@VisibleForTesting
final void addTransitionToStaggeredTransition(Transition basePartialTransition,
                                              TransitionSet staggeredTransition,
                                              int viewId, int indexInTransition) {
    Transition partialTransition =
            applyStaggeredTransitionParams(basePartialTransition, viewId, indexInTransition);
    staggeredTransition.addTransition(partialTransition);
}
 
开发者ID:blipinsk,项目名称:StaggeredAnimationGroup,代码行数:9,代码来源:StaggeredAnimationGroup.java

示例8: onCreate

import android.support.transition.TransitionSet; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mStaggerCB = (CheckBox) findViewById(R.id.staggerCB);

    mFirstButton = (Button) findViewById(R.id.firstButton);
    mSecondButton = (Button) findViewById(R.id.secondButton);
    mThirdButton = (Button) findViewById(R.id.thirdButton);
    mFourthButton = (Button) findViewById(R.id.fourthButton);

    mSceneRoot = (ViewGroup) findViewById(R.id.activity_main);

    // Create custom transition that 'staggers' the animations by offsetting
    // the individual start times
    mStaggeredTransition = new TransitionSet();
    Transition first = new ChangeBounds();
    Transition second = new ChangeBounds();
    Transition third = new ChangeBounds();
    Transition fourth = new ChangeBounds();

    first.addTarget(mFirstButton);
    second.setStartDelay(50).addTarget(mSecondButton);
    third.setStartDelay(100).addTarget(mThirdButton);
    fourth.setStartDelay(150).addTarget(mFourthButton);

    mStaggeredTransition.addTransition(first).addTransition(second).addTransition(third).
            addTransition(fourth);
}
 
开发者ID:google,项目名称:android-ui-toolkit-demos,代码行数:31,代码来源:MainActivity.java

示例9: BottomNavigationMenuView

import android.support.transition.TransitionSet; //导入依赖的package包/类
public BottomNavigationMenuView(Context context, AttributeSet attrs) {
  super(context, attrs);
  final Resources res = getResources();
  inactiveItemMaxWidth =
      res.getDimensionPixelSize(R.dimen.design_bottom_navigation_item_max_width);
  inactiveItemMinWidth =
      res.getDimensionPixelSize(R.dimen.design_bottom_navigation_item_min_width);
  activeItemMaxWidth =
      res.getDimensionPixelSize(R.dimen.design_bottom_navigation_active_item_max_width);
  activeItemMinWidth =
      res.getDimensionPixelSize(R.dimen.design_bottom_navigation_active_item_min_width);
  itemHeight = res.getDimensionPixelSize(R.dimen.design_bottom_navigation_height);
  itemTextColorDefault = createDefaultColorStateList(android.R.attr.textColorSecondary);

  set = new AutoTransition();
  set.setOrdering(TransitionSet.ORDERING_TOGETHER);
  set.setDuration(ACTIVE_ANIMATION_DURATION_MS);
  set.setInterpolator(new FastOutSlowInInterpolator());
  set.addTransition(new TextScale());

  onClickListener =
      new OnClickListener() {
        @Override
        public void onClick(View v) {
          final BottomNavigationItemView itemView = (BottomNavigationItemView) v;
          MenuItem item = itemView.getItemData();
          if (!menu.performItemAction(item, presenter, 0)) {
            item.setChecked(true);
          }
        }
      };
  tempChildWidths = new int[BottomNavigationMenu.MAX_ITEM_COUNT];
}
 
开发者ID:material-components,项目名称:material-components-android,代码行数:34,代码来源:BottomNavigationMenuView.java

示例10: BottomNavigationMenuView

import android.support.transition.TransitionSet; //导入依赖的package包/类
public BottomNavigationMenuView(Context context, AttributeSet attrs) {
  super(context, attrs);
  final Resources res = getResources();
  mInactiveItemMaxWidth =
      res.getDimensionPixelSize(R.dimen.design_bottom_navigation_item_max_width);
  mInactiveItemMinWidth =
      res.getDimensionPixelSize(R.dimen.design_bottom_navigation_item_min_width);
  mActiveItemMaxWidth =
      res.getDimensionPixelSize(R.dimen.design_bottom_navigation_active_item_max_width);
  mActiveItemMinWidth =
      res.getDimensionPixelSize(R.dimen.design_bottom_navigation_active_item_min_width);
  mItemHeight = res.getDimensionPixelSize(R.dimen.design_bottom_navigation_height);

  mSet = new AutoTransition();
  mSet.setOrdering(TransitionSet.ORDERING_TOGETHER);
  mSet.setDuration(ACTIVE_ANIMATION_DURATION_MS);
  mSet.setInterpolator(new FastOutSlowInInterpolator());
  mSet.addTransition(new TextScale());

  mOnClickListener =
      new OnClickListener() {
        @Override
        public void onClick(View v) {
          final BottomNavigationItemView itemView = (BottomNavigationItemView) v;
          MenuItem item = itemView.getItemData();
          if (!mMenu.performItemAction(item, mPresenter, 0)) {
            item.setChecked(true);
          }
        }
      };
  mTempChildWidths = new int[BottomNavigationMenu.MAX_ITEM_COUNT];
}
 
开发者ID:google,项目名称:iosched,代码行数:33,代码来源:BottomNavigationMenuView.java

示例11: onCreate

import android.support.transition.TransitionSet; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_transition);

    radioGroup.setOnCheckedChangeListener(this);


    // A Scene can be instantiated from a live view hierarchy.
    mScene1 = new Scene(sceneRoot, sceneRoot.findViewById(R.id.container));

    // You can also inflate a generate a Scene from a layout resource file.
    mScene2 = Scene.getSceneForLayout(sceneRoot, R.layout.scene2, this);


    // Another scene from a layout resource file.
    mScene3 = Scene.getSceneForLayout(sceneRoot, R.layout.scene3, this);


    // We create a custom TransitionManager for Scene 3, in which ChangeBounds and Fade
    // take place at the same time.

    /* Same as:

    mTransitionManagerForScene3 = TransitionInflater.from(this)
            .inflateTransitionManager(R.transition.scene3_transition_manager, sceneRoot);

    + in transition/scene3_transition_manager.xml

            <transitionManager xmlns:android="http://schemas.android.com/apk/res/android">
                <transition
                    android:toScene="@layout/scene3"
                    android:transition="@transition/changebounds_fadein_together"/>
            </transitionManager>

    + in transition/changebounds_fadein_together.xml

    <transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
        <changeBounds/>
        <fade android:fadingMode="fade_in">
            <targets>
                <target android:targetId="@id/transition_title" />
            </targets>
        </fade>
    </transitionSet>
    */

    TransitionSet scene3Transitions = new TransitionSet();
    scene3Transitions
            .addTransition(new ChangeBounds())
            .addTransition(new Fade(Fade.IN).addTarget(R.id.transition_title));
    mTransitionManagerForScene3 = new TransitionManager();
    mTransitionManagerForScene3.setTransition(mScene3, scene3Transitions);
}
 
开发者ID:zawadz88,项目名称:AnimationShowcase,代码行数:55,代码来源:SupportTransitionActivity.java

示例12: onStaggeredTransitionReady

import android.support.transition.TransitionSet; //导入依赖的package包/类
@VisibleForTesting
final TransitionSet onStaggeredTransitionReady(TransitionSet transition, boolean isShowing, boolean inReversedOrder) {
    return onPreparedListener.onStaggeredTransitionPrepared(transition, isShowing, inReversedOrder);
}
 
开发者ID:blipinsk,项目名称:StaggeredAnimationGroup,代码行数:5,代码来源:StaggeredAnimationGroup.java


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