本文整理汇总了Java中android.transition.AutoTransition类的典型用法代码示例。如果您正苦于以下问题:Java AutoTransition类的具体用法?Java AutoTransition怎么用?Java AutoTransition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AutoTransition类属于android.transition包,在下文中一共展示了AutoTransition类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tryDelayed
import android.transition.AutoTransition; //导入依赖的package包/类
/**
* {@link TransitionManager#beginDelayedTransition(ViewGroup) Begin a delayed transition} if
* one is not already running.
*/
@UiThread
public static void tryDelayed(ViewGroup sceneRoot) {
if (!sceneRoot.isLaidOut()) { // transition won't run
return;
}
if (sDelayedTransition == null) {
sDelayedTransition = new AutoTransition().addListener(new SimpleTransitionListener() {
@Override
public void onTransitionEnd(Transition transition) {
super.onTransitionEnd(transition);
sDelayedTransitionRunning = false;
}
});
}
if (!sDelayedTransitionRunning) {
sDelayedTransitionRunning = true;
TransitionManager.beginDelayedTransition(sceneRoot, sDelayedTransition);
}
}
示例2: updateLinkText
import android.transition.AutoTransition; //导入依赖的package包/类
void updateLinkText(String link) {
linkTextView.setText(link);
Transition transition = new AutoTransition()
.setDuration(500)
.setStartDelay(300)
.setInterpolator(new AccelerateDecelerateInterpolator());
TransitionManager.beginDelayedTransition(rootView, transition);
linkTextView.setVisibility(View.VISIBLE);
}
示例3: BottomNavigationAnimationHelperKitkat
import android.transition.AutoTransition; //导入依赖的package包/类
BottomNavigationAnimationHelperKitkat() {
mSet = new AutoTransition();
mSet.setOrdering(TransitionSet.ORDERING_TOGETHER);
mSet.setDuration(ACTIVE_ANIMATION_DURATION_MS);
mSet.setInterpolator(new FastOutSlowInInterpolator());
TextScale textScale = new TextScale();
mSet.addTransition(textScale);
}
示例4: DribbbleCommentsAdapter
import android.transition.AutoTransition; //导入依赖的package包/类
public DribbbleCommentsAdapter(Context context, int resource, List<Comment> comments) {
super(context, resource, comments);
inflater = LayoutInflater.from(context);
if (UI.isLollipop()) {
change = new AutoTransition();
change.setDuration(200L);
change.setInterpolator(AnimationUtils.loadInterpolator(context,
android.R.interpolator.fast_out_slow_in));
}
}
示例5: onCreate
import android.transition.AutoTransition; //导入依赖的package包/类
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setSharedElementEnterTransition(new AutoTransition());
// Because we are loading things async, these are really just for exit animations.
setEnterTransition(new TransitionSet()
.addTransition(new AnchorAppBarSlide(R.id.app_bar).addTarget(R.id.types))
.addTransition(new SlideDownAndFadeOut().addTarget(R.id.content)));
}
示例6: DribbbleCommentsAdapter
import android.transition.AutoTransition; //导入依赖的package包/类
public DribbbleCommentsAdapter(Context context, int resource, List<Comment> comments) {
super(context, resource, comments);
inflater = LayoutInflater.from(context);
change = new AutoTransition();
change.setDuration(200L);
change.setInterpolator(getFastOutSlowInInterpolator(context));
}
示例7: onChangeCheese
import android.transition.AutoTransition; //导入依赖的package包/类
@SuppressWarnings("unused")
@OnClick(R.id.image_avatar)
protected void onChangeCheese() {
int iconRes = Cheeses.getRandomCheeseDrawable();
String titleString = Cheeses.getRandomCheeseString();
TransitionManager.beginDelayedTransition(layoutContainer, new AutoTransition());
imageAvatar.setImageResource(iconRes);
textTitle.setText(titleString);
colorize(((BitmapDrawable) imageAvatar.getDrawable()).getBitmap());
}
示例8: withAction
import android.transition.AutoTransition; //导入依赖的package包/类
/**
* Creates a AutoTransition that calls the {@linkplain android.transition.Transition.TransitionListener#onTransitionEnd(Transition)}
* of the passing Listener when complete
*/
public static Transition withAction(TransitionListener finishingAction) {
AutoTransition transition = new AutoTransition();
transition.setDuration(FADE_OUT_DURATION);
transition.addListener(finishingAction);
return transition;
}
示例9: createTransition
import android.transition.AutoTransition; //导入依赖的package包/类
public static Transition createTransition() {
AutoTransition transition = new AutoTransition();
transition.setDuration(FADE_IN_DURATION);
return transition;
}
示例10: withAction
import android.transition.AutoTransition; //导入依赖的package包/类
public static Transition withAction(TransitionListener finishingAction) {
AutoTransition transition = new AutoTransition();
transition.setDuration(FADE_OUT_DURATION);
transition.addListener(finishingAction);
return transition;
}
示例11: createAutoTransition
import android.transition.AutoTransition; //导入依赖的package包/类
static Object createAutoTransition() {
return new AutoTransition();
}
示例12: onCreateView
import android.transition.AutoTransition; //导入依赖的package包/类
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.transitions_xml_frag, null);
ButterKnife.inject(this, view);
mSceneRoot = ButterKnife.findById(view, R.id.transitions_xml_scene_root);
// Inflate some scenes directly from XML
mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.transition_xml_scene1, getActivity());
mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.transition_xml_scene2, getActivity());
// Create a Scene from a ViewGroup that already exists
LinearLayout scene3Layout =
(LinearLayout) inflater.inflate(R.layout.transition_xml_scene3, null);
mScene3 = new Scene(mSceneRoot, scene3Layout);
// Can modify Scene 3's underlying behavior by adding a click listener
scene3Layout.findViewById(R.id.transition_xml_btn).setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
Toast.makeText(getActivity(), "Android Levl=100", Toast.LENGTH_SHORT).show();
}
});
mTransitionManager = new TransitionManager();
mTransitionManager.setTransition(
mScene1,
mScene2,
new ChangeBounds()
);
mTransitionManager.setTransition(
mScene2,
mScene1,
new Fade()
);
mTransitionManager.setTransition(
mScene2,
mScene3,
new AutoTransition()
);
return view;
}