本文整理汇总了Java中android.support.transition.ChangeBounds类的典型用法代码示例。如果您正苦于以下问题:Java ChangeBounds类的具体用法?Java ChangeBounds怎么用?Java ChangeBounds使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChangeBounds类属于android.support.transition包,在下文中一共展示了ChangeBounds类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onResume
import android.support.transition.ChangeBounds; //导入依赖的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
示例2: hideWithFadeView
import android.support.transition.ChangeBounds; //导入依赖的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
示例3: goneSlidingTabs
import android.support.transition.ChangeBounds; //导入依赖的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
示例4: animateForViewGroupTransition
import android.support.transition.ChangeBounds; //导入依赖的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
示例5: onCreate
import android.support.transition.ChangeBounds; //导入依赖的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
示例6: onBindViewHolder
import android.support.transition.ChangeBounds; //导入依赖的package包/类
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
ShoppingListItem item = data.get(position);
// Reset values used by animation
holder.itemView.getLayoutParams().height = LinearLayout.LayoutParams.WRAP_CONTENT;
holder.resetBackgroundColor();
holder.resetTextColor();
holder.isExpanded = expandedItemKeys.contains(item.key);
holder.nameTextView.setText(item.name);
holder.createdByTextView.setText(context.getString(R.string.shopping_list_item_created_by, item.createdBy));
holder.priceTextView.setVisibility((item.price > 0) ? View.VISIBLE : View.GONE);
holder.descriptionTextView.setVisibility((item.description.length() > 0) ? View.VISIBLE : View.GONE);
holder.descriptionTextView.setText(item.description);
holder.urgentImageView.setVisibility((item.urgent) ? View.VISIBLE : View.GONE);
holder.data = item;
String formattedPrice = currencyFormatter.format((double) item.price / 100.0);
if (viewSize == VIEW_SIZE_COMPACT) {
holder.detailsView.setVisibility((holder.isExpanded) ? View.VISIBLE : View.GONE);
holder.priceTextView.setText(context.getString(R.string.shopping_list_item_price_compact, formattedPrice));
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean expand = holder.detailsView.getVisibility() == View.GONE;
holder.isExpanded = expand;
if (expand) {
expandedItemKeys.add(holder.data.key);
} else {
expandedItemKeys.remove(holder.data.key);
}
holder.detailsView.setVisibility((expand) ? View.VISIBLE : View.GONE);
ChangeBounds transition = new ChangeBounds();
transition.setDuration(200);
TransitionManager.beginDelayedTransition(recyclerView, transition);
holder.itemView.setActivated(expand);
}
});
} else if (viewSize == VIEW_SIZE_COZY) {
holder.priceTextView.setText(context.getString(R.string.shopping_list_item_price_cozy, formattedPrice));
holder.itemView.setOnClickListener(null);
}
}
开发者ID:david-szabo97,项目名称:Android-Open-Shopping-List,代码行数:53,代码来源:ShoppingListAdapter.java
示例7: onCreate
import android.support.transition.ChangeBounds; //导入依赖的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.ChangeBounds类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论