本文整理汇总了Java中android.animation.LayoutTransition.setDuration方法的典型用法代码示例。如果您正苦于以下问题:Java LayoutTransition.setDuration方法的具体用法?Java LayoutTransition.setDuration怎么用?Java LayoutTransition.setDuration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.animation.LayoutTransition
的用法示例。
在下文中一共展示了LayoutTransition.setDuration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.animation.LayoutTransition; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_custom_layout_animations);
LayoutTransition layoutTransition = new LayoutTransition();
ObjectAnimator appearingAnim = ObjectAnimator.ofFloat(null, "rotationY", 0f, 90f, 180f, 270f, 359.9999f);
appearingAnim.addListener(new AnimatorListenerAdapter() {
public void onAnimationEnd(Animator anim) {
View view = (View) ((ObjectAnimator) anim).getTarget();
view.setRotationY(0f);
}
});
layoutTransition.setAnimator(LayoutTransition.APPEARING, appearingAnim);
layoutTransition.setDuration(LayoutTransition.APPEARING, 2000L);
layoutTransition.setStartDelay(LayoutTransition.APPEARING, 0);
gridContainer.setLayoutTransition(layoutTransition);
}
示例2: initView
import android.animation.LayoutTransition; //导入方法依赖的package包/类
private void initView(Context context) {
if (mIndicatorType == 0) {
for (int i = 0; i < mPinLength; i++) {
View dot = new View(context);
emptyDot(dot);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(mDotDiameter,
mDotDiameter);
params.setMargins(mDotSpacing, 0, mDotSpacing, 0);
dot.setLayoutParams(params);
addView(dot);
}
} else if (mIndicatorType == 2) {
LayoutTransition layoutTransition = new LayoutTransition();
layoutTransition.setDuration(DEFAULT_ANIMATION_DURATION);
layoutTransition.setStartDelay(layoutTransition.APPEARING, 0);
setLayoutTransition(layoutTransition);
}
}
示例3: init
import android.animation.LayoutTransition; //导入方法依赖的package包/类
private void init() {
setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mPresenter.toggleIsExtended();
}
});
//TODO-beauty: Fix AbilityCard animation so that the image on the card doesn't just jump
// but animates smoothly like the rest of the card
LayoutTransition transition = new LayoutTransition();
transition.enableTransitionType(LayoutTransition.CHANGING);
transition.setDuration(300);
setLayoutTransition(transition);
inflate(getContext(), R.layout.item_ability_info, this);
}
示例4: initHoneyComb
import android.animation.LayoutTransition; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void initHoneyComb() {
if (!isInDrawer()) {
parentView.addOnLayoutChangeListener(new View.OnLayoutChangeListener()
{
int lastWidth = -1;
@Override
public void onLayoutChange(View v, int left, int top, int right,
int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
int width = right - left;
if (width != lastWidth) {
lastWidth = width;
expandSideListWidth(sidelistInFocus);
}
}
});
}
LayoutTransition layoutTransition = new LayoutTransition();
layoutTransition.setDuration(400);
sideListArea.setLayoutTransition(layoutTransition);
}
示例5: a
import android.animation.LayoutTransition; //导入方法依赖的package包/类
private static LayoutTransition a()
{
LayoutTransition layouttransition = new LayoutTransition();
layouttransition.setDuration(90L);
layouttransition.setInterpolator(2, new AccelerateDecelerateInterpolator());
layouttransition.setInterpolator(3, new AccelerateDecelerateInterpolator());
ObjectAnimator objectanimator = ObjectAnimator.ofFloat(null, "rotationX", new float[] {
90F, 0.0F
}).setDuration(layouttransition.getDuration(2));
layouttransition.setAnimator(2, objectanimator);
objectanimator.addListener(new d());
ObjectAnimator objectanimator1 = ObjectAnimator.ofFloat(null, "rotationX", new float[] {
0.0F, -90F
}).setDuration(layouttransition.getDuration(3));
layouttransition.setAnimator(3, objectanimator1);
objectanimator1.addListener(new e());
return layouttransition;
}
示例6: getDefaultTransition
import android.animation.LayoutTransition; //导入方法依赖的package包/类
public static LayoutTransition getDefaultTransition() {
LayoutTransition itemLayoutTransition = new LayoutTransition();
itemLayoutTransition.setStartDelay(LayoutTransition.APPEARING, 0);
itemLayoutTransition.setStartDelay(LayoutTransition.DISAPPEARING, 0);
itemLayoutTransition.setStartDelay(LayoutTransition.CHANGE_APPEARING, 0);
itemLayoutTransition.setStartDelay(LayoutTransition.CHANGE_DISAPPEARING, 0);
itemLayoutTransition.setStartDelay(LayoutTransition.CHANGING, 0);
itemLayoutTransition.setDuration(100);
itemLayoutTransition.setInterpolator(LayoutTransition.CHANGING, new OvershootInterpolator(2f));
Animator scaleUp = ObjectAnimator.ofPropertyValuesHolder((Object) null, PropertyValuesHolder.ofFloat(View.SCALE_X, 1, 1), PropertyValuesHolder.ofFloat(View.SCALE_Y, 0, 1));
scaleUp.setDuration(50);
scaleUp.setStartDelay(50);
Animator scaleDown = ObjectAnimator.ofPropertyValuesHolder((Object) null, PropertyValuesHolder.ofFloat(View.SCALE_X, 1, 1), PropertyValuesHolder.ofFloat(View.SCALE_Y, 1, 0));
scaleDown.setDuration(2);
itemLayoutTransition.setAnimator(LayoutTransition.APPEARING, scaleUp);
itemLayoutTransition.setAnimator(LayoutTransition.DISAPPEARING, null);
itemLayoutTransition.enableTransitionType(LayoutTransition.CHANGING);
return itemLayoutTransition;
}
示例7: FunControl
import android.animation.LayoutTransition; //导入方法依赖的package包/类
public FunControl(Builder builder){
this.funny = builder.funny;
this.funnyButton = builder.funnyButton;
this.funnyContainer = builder.viewGroup;
this.gravityToExpand = builder.gravityToExpand;
this.widthToExpand = builder.width;
LayoutTransition layoutTransition = funny.getLayoutTransition();
layoutTransition.setDuration(builder.animationDuration);
layoutTransition.enableTransitionType(LayoutTransition.CHANGING);
}
示例8: setUpLayoutTransition
import android.animation.LayoutTransition; //导入方法依赖的package包/类
private void setUpLayoutTransition() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
RelativeLayout searchRoot = (RelativeLayout) findViewById(R.id.search_root);
LayoutTransition layoutTransition = new LayoutTransition();
layoutTransition.setDuration(DURATION_LAYOUT_TRANSITION);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN) {
// layoutTransition.enableTransitionType(LayoutTransition.CHANGING);
layoutTransition.enableTransitionType(LayoutTransition.CHANGE_DISAPPEARING);
layoutTransition.setStartDelay(LayoutTransition.CHANGING, 0);
}
layoutTransition.setStartDelay(LayoutTransition.CHANGE_DISAPPEARING, 0);
mSearchCardView.setLayoutTransition(layoutTransition);
}
}
示例9: PageIndicator
import android.animation.LayoutTransition; //导入方法依赖的package包/类
public PageIndicator(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.PageIndicator, defStyle, 0);
mMaxWindowSize = a.getInteger(R.styleable.PageIndicator_windowSize, 15);
mWindowRange[0] = 0;
mWindowRange[1] = 0;
mLayoutInflater = LayoutInflater.from(context);
a.recycle();
// Set the layout transition properties
LayoutTransition transition = getLayoutTransition();
transition.setDuration(175);
}
示例10: setupInAnimations
import android.animation.LayoutTransition; //导入方法依赖的package包/类
private void setupInAnimations() {
mPushInAnimator = (ObjectAnimator) AnimatorInflater.loadAnimator(this, R.animator.slide_in_right);
mPushOutAnimator = (ObjectAnimator) AnimatorInflater.loadAnimator(this, R.animator.fade_out);
mPopInAnimator = (ObjectAnimator) AnimatorInflater.loadAnimator(this, R.animator.fade_in);
ObjectAnimator popOutAnimator = (ObjectAnimator) AnimatorInflater.loadAnimator(this, R.animator.slide_out_right);
mPushOutAnimator.setStartDelay(100);
mPopOutTransition = new LayoutTransition();
mPopOutTransition.setAnimator(LayoutTransition.DISAPPEARING, popOutAnimator);
mPopOutTransition.setDuration(popOutAnimator.getDuration());
}
示例11: initLayoutChangeAnimation
import android.animation.LayoutTransition; //导入方法依赖的package包/类
private void initLayoutChangeAnimation() {
final Animator showAnimation = ObjectAnimator.ofPropertyValuesHolder(PropertyValuesHolder.ofFloat("scaleX", 1, 0));
final Animator hideAnimation = ObjectAnimator.ofPropertyValuesHolder(PropertyValuesHolder.ofFloat("scaleX", 0, 1));
final LayoutTransition layoutTransition = new LayoutTransition();
layoutTransition.setDuration(50);
layoutTransition.setStartDelay(LayoutTransition.CHANGE_APPEARING, 0);
layoutTransition.setStartDelay(LayoutTransition.CHANGE_DISAPPEARING, 0);
layoutTransition.setAnimator(LayoutTransition.APPEARING, hideAnimation);
layoutTransition.setAnimator(LayoutTransition.DISAPPEARING, showAnimation);
setLayoutTransition(layoutTransition);
}
示例12: addAnimForView
import android.animation.LayoutTransition; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void addAnimForView(View rootView) {
ViewGroup vg = null;
if (DeviceUtil.getSDKVersionInt() >= 11 && rootView instanceof ViewGroup) {
vg = (ViewGroup) rootView;
LayoutTransition layoutTransition = new LayoutTransition();
layoutTransition.setDuration(400);
vg.setLayoutTransition(layoutTransition);
}
}
示例13: init
import android.animation.LayoutTransition; //导入方法依赖的package包/类
private void init() {
setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mPresenter.toggleIsExtended();
}
});
LayoutTransition transition = new LayoutTransition();
transition.enableTransitionType(LayoutTransition.CHANGING);
transition.setDuration(300);
setLayoutTransition(transition);
inflate(getContext(), R.layout.item_talents_info, this);
}
示例14: onLayout
import android.animation.LayoutTransition; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
Log.d(TAG, "onLayout: " + changed);
if( changed && !mLayouted ){
mLayouted = true;
ObjectAnimator animator;
LayoutTransition layoutTransition = new LayoutTransition();
animator = mAnimators.getDisappearingAnimator(getContext());
layoutTransition.setAnimator(LayoutTransition.DISAPPEARING, animator);
animator = mAnimators.getAppearingAnimator(getContext());
layoutTransition.setAnimator(LayoutTransition.APPEARING, animator);
layoutTransition.addTransitionListener(mTransitionListener);
if( animator != null )
layoutTransition.setDuration(animator.getDuration());
setLayoutTransition(layoutTransition);
if( mShowInitialAnimation )
runInitialAnimations();
if (mFirstVisibleCardTag != null) {
scrollToCard(mFirstVisibleCardTag);
mFirstVisibleCardTag = null;
}
}
}
示例15: onActivityCreated
import android.animation.LayoutTransition; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
prepareButtonToPanel(R.id.btnCorken, R.id.panelCorken);
prepareButtonToPanel(R.id.btnOncomingTraffic, R.id.panelOncomingTraffic);
prepareButtonToPanel(R.id.btnSlow, R.id.panelSlow);
prepareButtonToPanel(R.id.btnBrake, R.id.panelBrake);
prepareButtonToPanel(R.id.btnFriendly, R.id.panelFriendly);
prepareButtonToPanel(R.id.btnFun, R.id.panelFun);
prepareButtonToPanel(R.id.btnGreen, R.id.panelGreen);
if (savedInstanceState != null) {
Integer activePanelId = (Integer) savedInstanceState.get(KEY_ACTIVE_PANEL_ID);
if (activePanelId != null) {
currentlyShownPanel = findViewById(activePanelId);
LayoutTransition layoutTransition = linearLayout.getLayoutTransition();
long durationAppearing = layoutTransition.getDuration(LayoutTransition.APPEARING);
layoutTransition.setDuration(LayoutTransition.APPEARING, 0);
currentlyShownPanel.setVisibility(View.VISIBLE);
layoutTransition.setDuration(LayoutTransition.APPEARING, durationAppearing);
}
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2) {
final int scrollviewPosition = savedInstanceState.getInt(KEY_SCROLLVIEW_POSITION, 0);
if (scrollviewPosition != 0) {
final ScrollView scrollView = (ScrollView) findViewById(R.id.rules_scrollview);
scrollView.post(new Runnable() {
public void run() {
scrollView.scrollTo(0, scrollviewPosition);
}
});
}
}
}
}