當前位置: 首頁>>代碼示例>>Java>>正文


Java LayoutTransition.setDuration方法代碼示例

本文整理匯總了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);
}
 
開發者ID:zawadz88,項目名稱:AnimationShowcase,代碼行數:23,代碼來源:CustomLayoutAnimationsActivity.java

示例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);
    }
}
 
開發者ID:amirarcane,項目名稱:lock-screen,代碼行數:21,代碼來源:IndicatorDots.java

示例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);
}
 
開發者ID:dbdkmezz,項目名稱:true-sight-dota,代碼行數:19,代碼來源:AbilityCardView.java

示例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);
}
 
開發者ID:vuze,項目名稱:vuze-remote-for-android,代碼行數:25,代碼來源:SideListHelper.java

示例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;
}
 
開發者ID:vishnudevk,項目名稱:MiBandDecompiled,代碼行數:19,代碼來源:AnimUtil.java

示例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;
}
 
開發者ID:breadwallet,項目名稱:breadwallet-android,代碼行數:20,代碼來源:BRAnimator.java

示例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);
}
 
開發者ID:PHELAT,項目名稱:Fun,代碼行數:12,代碼來源:FunControl.java

示例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);
    }
}
 
開發者ID:aliumujib,項目名稱:Nibo,代碼行數:15,代碼來源:NiboPlacesAutoCompleteSearchView.java

示例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);
}
 
開發者ID:Mr-lin930819,項目名稱:SimplOS,代碼行數:15,代碼來源:PageIndicator.java

示例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());
}
 
開發者ID:ShaolinZhang,項目名稱:HACKxFDU-CrisisProbingUAV,代碼行數:13,代碼來源:MainActivity.java

示例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);
}
 
開發者ID:toshiapp,項目名稱:toshi-android-client,代碼行數:12,代碼來源:ChatInputView.java

示例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);
    }
}
 
開發者ID:bestarandyan,項目名稱:ShoppingMall,代碼行數:12,代碼來源:ReleaseFragment.java

示例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);
}
 
開發者ID:dbdkmezz,項目名稱:true-sight-dota,代碼行數:15,代碼來源:TalentsCardView.java

示例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;
        }
    }
}
 
開發者ID:googlesamples,項目名稱:android-play-places,代碼行數:35,代碼來源:CardStreamLinearLayout.java

示例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);
                    }
                });
            }
        }
    }
}
 
開發者ID:criticalmaps,項目名稱:criticalmaps-android,代碼行數:39,代碼來源:RulesFragment.java


注:本文中的android.animation.LayoutTransition.setDuration方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。