本文整理汇总了Java中android.support.transition.Fade类的典型用法代码示例。如果您正苦于以下问题:Java Fade类的具体用法?Java Fade怎么用?Java Fade使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Fade类属于android.support.transition包,在下文中一共展示了Fade类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: transitionToSearch
import android.support.transition.Fade; //导入依赖的package包/类
public void transitionToSearch(){
if (transitioning) {
return;
}
if (supportsTransitions()) {
Transition transition = FadeOutTransition.withAction(navigateToSearchWhenDone());
TransitionManager.beginDelayedTransition(searchView, transition);
expandToolbar();
ViewFader.hideContentOf(searchView);
TransitionManager.beginDelayedTransition(activityContent, new Fade(Fade.OUT));
activityContent.setVisibility(View.GONE);
} else {
TRouter.go(Constants.SEARCH);
}
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:17,代码来源:SearchTransitioner.java
示例2: applyStaggeredTransitionParams_setsPassedViewId_asTarget
import android.support.transition.Fade; //导入依赖的package包/类
@Test
public void applyStaggeredTransitionParams_setsPassedViewId_asTarget() {
//given
StaggeredAnimationGroup spiedGroup = prepareSpiedGroup();
Transition testTransition = new Fade(); //exemplary value
int testIndexInStaggeredTransition = 0; //exemplary value
int viewId = 12345; //exemplary value
//when
Transition resultTransition = spiedGroup.applyStaggeredTransitionParams(testTransition, viewId, testIndexInStaggeredTransition);
//then
List<Integer> targetIds = resultTransition.getTargetIds();
assertThat(targetIds).hasSize(1);
assertThat(targetIds.get(0)).isEqualTo(viewId);
}
开发者ID:blipinsk,项目名称:StaggeredAnimationGroup,代码行数:17,代码来源:StaggeredAnimationGroupTest.java
示例3: onResume
import android.support.transition.Fade; //导入依赖的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
示例4: hideWithFadeView
import android.support.transition.Fade; //导入依赖的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
示例5: goneSlidingTabs
import android.support.transition.Fade; //导入依赖的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
示例6: animateForViewGroupTransition
import android.support.transition.Fade; //导入依赖的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
示例7: onActivityResumed
import android.support.transition.Fade; //导入依赖的package包/类
public void onActivityResumed() {
if (supportsTransitions()) {
TransitionManager.beginDelayedTransition(searchView, FadeInTransition.createTransition());
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) searchView.getLayoutParams();
layoutParams.setMargins(toolbarMargin, toolbarMargin, toolbarMargin, toolbarMargin);
searchView.setLayoutParams(layoutParams);
ViewFader.showContent(searchView);
TransitionManager.beginDelayedTransition(activityContent, new Fade(Fade.IN));
activityContent.setVisibility(View.VISIBLE);
}
}
开发者ID:Zweihui,项目名称:Aurora,代码行数:12,代码来源:SearchTransitioner.java
示例8: createPartialTransition
import android.support.transition.Fade; //导入依赖的package包/类
@NonNull
@Override
public Transition createPartialTransition(boolean isShowing,
int viewId,
int indexInTransition) {
return new Fade();
}
开发者ID:blipinsk,项目名称:StaggeredAnimationGroup,代码行数:8,代码来源:StaggeredAnimationGroup.java
示例9: applyStaggeredTransitionParams_setsDelay
import android.support.transition.Fade; //导入依赖的package包/类
public void applyStaggeredTransitionParams_setsDelay(int indexInStaggeredTransition, int expectedDelay) {
//given
StaggeredAnimationGroup spiedGroup = prepareSpiedGroup();
Transition testTransition = new Fade(); //exemplary value
int testViewId = 0; //exemplary value
//when
Transition resultTransition = spiedGroup.applyStaggeredTransitionParams(testTransition, testViewId, indexInStaggeredTransition);
//then
assertThat(resultTransition.getStartDelay()).isEqualTo(expectedDelay);
}
开发者ID:blipinsk,项目名称:StaggeredAnimationGroup,代码行数:13,代码来源:StaggeredAnimationGroupTest.java
示例10: onCreate
import android.support.transition.Fade; //导入依赖的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
注:本文中的android.support.transition.Fade类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论