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


Java AnimatorInflater.loadAnimator方法代碼示例

本文整理匯總了Java中android.animation.AnimatorInflater.loadAnimator方法的典型用法代碼示例。如果您正苦於以下問題:Java AnimatorInflater.loadAnimator方法的具體用法?Java AnimatorInflater.loadAnimator怎麽用?Java AnimatorInflater.loadAnimator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.animation.AnimatorInflater的用法示例。


在下文中一共展示了AnimatorInflater.loadAnimator方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: checkIndicatorConfig

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
private void checkIndicatorConfig(Context context) {
    mIndicatorWidth = (mIndicatorWidth < 0) ? dip2px(DEFAULT_INDICATOR_WIDTH) : mIndicatorWidth;
    mIndicatorHeight =
            (mIndicatorHeight < 0) ? dip2px(DEFAULT_INDICATOR_WIDTH) : mIndicatorHeight;
    mIndicatorMargin =
            (mIndicatorMargin < 0) ? dip2px(DEFAULT_INDICATOR_WIDTH) : mIndicatorMargin;

    mAnimatorResId = (mAnimatorResId == 0) ? R.animator.scale_with_alpha : mAnimatorResId;
    mAnimationOut = AnimatorInflater.loadAnimator(context, mAnimatorResId);
    if (mAnimatorReverseResId == 0) {
        mAnimationIn = AnimatorInflater.loadAnimator(context, mAnimatorResId);
        mAnimationIn.setInterpolator(new ReverseInterpolator());
    } else {
        mAnimationIn = AnimatorInflater.loadAnimator(context, mAnimatorReverseResId);
    }
    mIndicatorBackgroundResId = (mIndicatorBackgroundResId == 0) ? R.drawable.white_radius
            : mIndicatorBackgroundResId;
    mIndicatorUnselectedBackgroundResId =
            (mIndicatorUnselectedBackgroundResId == 0) ? mIndicatorBackgroundResId
                    : mIndicatorUnselectedBackgroundResId;
}
 
開發者ID:SkylineLabs,項目名稱:FindX,代碼行數:22,代碼來源:CircleIndicator.java

示例2: createShowUpAnimator

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
public Animator createShowUpAnimator(final View target) {
    if (mHasCustomAnimationParams) {
        final ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(
                target, View.SCALE_X, mShowUpStartXScale,
                KEY_PREVIEW_SHOW_UP_END_SCALE);
        final ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(
                target, View.SCALE_Y, mShowUpStartYScale,
                KEY_PREVIEW_SHOW_UP_END_SCALE);
        final AnimatorSet showUpAnimator = new AnimatorSet();
        showUpAnimator.play(scaleXAnimator).with(scaleYAnimator);
        showUpAnimator.setDuration(mShowUpDuration);
        showUpAnimator.setInterpolator(DECELERATE_INTERPOLATOR);
        return showUpAnimator;
    }
    final Animator animator = AnimatorInflater.loadAnimator(
            target.getContext(), mShowUpAnimatorResId);
    animator.setTarget(target);
    animator.setInterpolator(DECELERATE_INTERPOLATOR);
    return animator;
}
 
開發者ID:sergeychilingaryan,項目名稱:AOSP-Kayboard-7.1.2,代碼行數:21,代碼來源:KeyPreviewDrawParams.java

示例3: createDismissAnimator

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
public Animator createDismissAnimator(final View target) {
    if (mHasCustomAnimationParams) {
        final ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(
                target, View.SCALE_X, mDismissEndXScale);
        final ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(
                target, View.SCALE_Y, mDismissEndYScale);
        final AnimatorSet dismissAnimator = new AnimatorSet();
        dismissAnimator.play(scaleXAnimator).with(scaleYAnimator);
        final int dismissDuration = Math.min(mDismissDuration, mLingerTimeout);
        dismissAnimator.setDuration(dismissDuration);
        dismissAnimator.setInterpolator(ACCELERATE_INTERPOLATOR);
        return dismissAnimator;
    }
    final Animator animator = AnimatorInflater.loadAnimator(
            target.getContext(), mDismissAnimatorResId);
    animator.setTarget(target);
    animator.setInterpolator(ACCELERATE_INTERPOLATOR);
    return animator;
}
 
開發者ID:rkkr,項目名稱:simple-keyboard,代碼行數:20,代碼來源:KeyPreviewDrawParams.java

示例4: onCreate

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_timer);

    tvHour = (TextView) findViewById(R.id.tvHour);
    tvSeparator = (TextView) findViewById(R.id.tvSeparator);
    tvMinute = (TextView) findViewById(R.id.tvMinute);

    tvHour.setText(getHour());
    tvMinute.setText(getMinute());

    // animacion en el separador de horas
    set = (AnimatorSet) AnimatorInflater.loadAnimator(this, R.animator.ticker_tick);
    set.setTarget(tvSeparator);
    set.start();


}
 
開發者ID:gothalo,項目名稱:Android-2017,代碼行數:20,代碼來源:TimerActivity.java

示例5: beginAnimation

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
private void beginAnimation() {
    if (animId > 0) {
        anim = AnimationUtils.loadAnimation(getContext(), animId);
        startAnimation(anim);
    }
    if (animatorId > 0) {
        animator = AnimatorInflater.loadAnimator(getContext(), animatorId);
        animator.setTarget(this);
        animator.start();
    }
    Drawable drawable = getDrawable();
    if (drawable instanceof Animatable2) {
        if (callback != null) {
            ((Animatable2) drawable).registerAnimationCallback(callback);
        }
        ((Animatable2) drawable).start();
    }
}
 
開發者ID:StylingAndroid,項目名稱:PresenterLite,代碼行數:19,代碼來源:AnimatedImageView.java

示例6: init

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
private void init(Context context, AttributeSet attrs) {
    setOrientation(LinearLayout.HORIZONTAL);
    setGravity(Gravity.CENTER);
    handleTypedArray(context, attrs);
    mAnimationOut = AnimatorInflater.loadAnimator(context, mAnimatorResId);
    if (mAnimatorReverseResId == -1) {
        mAnimationIn = AnimatorInflater.loadAnimator(context, mAnimatorResId);
        mAnimationIn.setInterpolator(new ReverseInterpolator());
    } else {
        mAnimationIn = AnimatorInflater.loadAnimator(context, mAnimatorReverseResId);
    }

    setPadding(0, dip2px(TEXT_SIZE + 8), 0, 0);
    setBackgroundColor(0x00000000);

    textPaint = new TextPaint();
    textPaint.setColor(Color.WHITE);
    textPaint.setAntiAlias(true);
    textPaint.setTextSize(dip2px(TEXT_SIZE));
    textPaint.setTextAlign(Paint.Align.CENTER);
}
 
開發者ID:adamin1990,項目名稱:QDNews,代碼行數:22,代碼來源:ToolbarIndicator.java

示例7: checkIndicatorConfig

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
private void checkIndicatorConfig(Context context) {

        mIndicatorWidth = (mIndicatorWidth < 0) ? dip2px(DEFAULT_INDICATOR_WIDTH) : mIndicatorWidth;
        mIndicatorHeight =
                (mIndicatorHeight < 0) ? dip2px(DEFAULT_INDICATOR_WIDTH) : mIndicatorHeight;
        mIndicatorMargin =
                (mIndicatorMargin < 0) ? dip2px(DEFAULT_INDICATOR_WIDTH) : mIndicatorMargin;

        mAnimatorResId = (mAnimatorResId == 0) ? R.animator.scale_with_alpha : mAnimatorResId;
        mAnimationOut = AnimatorInflater.loadAnimator(context, mAnimatorResId);
        if (mAnimatorReverseResId == 0) {
            mAnimationIn = AnimatorInflater.loadAnimator(context, mAnimatorResId);
            mAnimationIn.setInterpolator(new ReverseInterpolator());
        } else {
            mAnimationIn = AnimatorInflater.loadAnimator(context, mAnimatorReverseResId);
        }
        mIndicatorBackgroundResId = (mIndicatorBackgroundResId == 0) ? R.drawable.white_radius
                : mIndicatorBackgroundResId;
        mIndicatorUnselectedBackgroundResId =
                (mIndicatorUnselectedBackgroundResId == 0) ? mIndicatorBackgroundResId
                        : mIndicatorUnselectedBackgroundResId;
    }
 
開發者ID:zwx191044354,項目名稱:RxZhiHu,代碼行數:23,代碼來源:CircleIndicator.java

示例8: createAnimator

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
private Animator createAnimator(int sidePanelAnimResId, int sidePanelGridAnimResId,
        int tableAnimResId) {
    List<Animator> animatorList = new ArrayList<>();

    Animator sidePanelAnimator = AnimatorInflater.loadAnimator(mActivity, sidePanelAnimResId);
    sidePanelAnimator.setTarget(mSidePanel);
    animatorList.add(sidePanelAnimator);

    if (sidePanelGridAnimResId != 0) {
        Animator sidePanelGridAnimator = AnimatorInflater.loadAnimator(mActivity,
                sidePanelGridAnimResId);
        sidePanelGridAnimator.setTarget(mSidePanelGridView);
        sidePanelGridAnimator.addListener(
                new HardwareLayerAnimatorListenerAdapter(mSidePanelGridView));
        animatorList.add(sidePanelGridAnimator);
    }
    Animator tableAnimator = AnimatorInflater.loadAnimator(mActivity, tableAnimResId);
    tableAnimator.setTarget(mTable);
    tableAnimator.addListener(new HardwareLayerAnimatorListenerAdapter(mTable));
    animatorList.add(tableAnimator);

    AnimatorSet set = new AnimatorSet();
    set.playTogether(animatorList);
    return set;
}
 
開發者ID:trevd,項目名稱:android_packages_apps_tv,代碼行數:26,代碼來源:ProgramGuide.java

示例9: onFinishInflate

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mContainerView = findViewById(R.id.block_screen_container);
    mImageContainer = findViewById(R.id.image_container);
    mNormalImageView = (ImageView) findViewById(R.id.block_screen_icon);
    mShrunkenImageView = (ImageView) findViewById(R.id.block_screen_shrunken_icon);
    mSpace = findViewById(R.id.space);
    mTextView = (TextView) findViewById(R.id.block_screen_text);
    mFadeIn = AnimatorInflater.loadAnimator(getContext(),
            R.animator.tvview_block_screen_fade_in);
    mFadeIn.setTarget(mContainerView);
    mFadeOut = AnimatorInflater.loadAnimator(getContext(),
            R.animator.tvview_block_screen_fade_out);
    mFadeOut.setTarget(mContainerView);
    mFadeOut.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            mContainerView.setVisibility(GONE);
            mContainerView.setAlpha(1f);
        }
    });
}
 
開發者ID:trevd,項目名稱:android_packages_apps_tv,代碼行數:24,代碼來源:BlockScreenView.java

示例10: animateContainer

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
void animateContainer(final View container, final boolean dismiss) {
    container.setVisibility(View.VISIBLE);
    Animator animator = dismiss ? AnimatorInflater.loadAnimator(this, R.animator.exit_to_left) :
            AnimatorInflater.loadAnimator(this, R.animator.enter_from_right);
    animator.setTarget(container);
    animator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            if (dismiss) {
                container.setVisibility(View.GONE);
                UIUtils.dismissKeyboard(LWQSettingsActivity.this);
            } else {
                UIUtils.revealKeyboard(container == addEditQuote ? editableQuote : editableQuery);
            }
        }
    });
    animator.start();
}
 
開發者ID:stanidesis,項目名稱:quotograph,代碼行數:19,代碼來源:LWQSettingsActivity.java

示例11: checkIndicatorConfig

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
private void checkIndicatorConfig(Context context) {
	mIndicatorWidth = (mIndicatorWidth < 0) ? dip2px(DEFAULT_INDICATOR_WIDTH) : mIndicatorWidth;
	mIndicatorHeight =
			(mIndicatorHeight < 0) ? dip2px(DEFAULT_INDICATOR_WIDTH) : mIndicatorHeight;
	mIndicatorMargin =
			(mIndicatorMargin < 0) ? dip2px(DEFAULT_INDICATOR_WIDTH) : mIndicatorMargin;

	mAnimatorResId = (mAnimatorResId == 0) ? R.animator.scale_with_alpha : mAnimatorResId;
	mAnimationOut = AnimatorInflater.loadAnimator(context, mAnimatorResId);
	if (mAnimatorReverseResId == 0) {
		mAnimationIn = AnimatorInflater.loadAnimator(context, mAnimatorResId);
		mAnimationIn.setInterpolator(new ReverseInterpolator());
	} else {
		mAnimationIn = AnimatorInflater.loadAnimator(context, mAnimatorReverseResId);
	}
	mIndicatorBackgroundResId = (mIndicatorBackgroundResId == 0) ? R.drawable.white_radius
			: mIndicatorBackgroundResId;
	mIndicatorUnselectedBackgroundResId =
			(mIndicatorUnselectedBackgroundResId == 0) ? mIndicatorBackgroundResId
					: mIndicatorUnselectedBackgroundResId;
}
 
開發者ID:fython,項目名稱:BiliNyan-Android,代碼行數:22,代碼來源:CircleIndicator.java

示例12: initAnim

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
/**
 * 初始化動畫
 */
private void initAnim() {
    Animator card_flip_left_out = AnimatorInflater.loadAnimator(getContext(), R.animator.card_flip_left_out);
    card_flip_left_out.setTarget(mForegroundView);

    Animator card_flip_left_in = AnimatorInflater.loadAnimator(getContext(), R.animator.card_flip_left_in);
    card_flip_left_in.setTarget(mBackgroundView);

    mLeftSet = new AnimatorSet();
    mLeftSet.playTogether(card_flip_left_out, card_flip_left_in);

    Animator card_flip_right_out = AnimatorInflater.loadAnimator(getContext(), R.animator.card_flip_right_out);
    card_flip_right_out.setTarget(mBackgroundView);

    Animator card_flip_right_in = AnimatorInflater.loadAnimator(getContext(), R.animator.card_flip_right_in);
    card_flip_right_in.setTarget(mForegroundView);

    mRightSet = new AnimatorSet();
    mRightSet.playTogether(card_flip_right_out, card_flip_right_in);
}
 
開發者ID:wuapnjie,項目名稱:Timer,代碼行數:23,代碼來源:CardFlipLayout.java

示例13: defineValueAnimatorTests

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
private static void defineValueAnimatorTests(TestActivity act, View rootView,InflatedLayout layout)
{
    final TextView textView = (TextView) rootView.findViewById(R.id.valueAnimatorTestId1);

    ValueAnimator valueAnimator;
    if (layout == null)
        valueAnimator = (ValueAnimator)AnimatorInflater.loadAnimator(act,R.animator.test_value_animator_compiled);
    else
        valueAnimator = (ValueAnimator)layout.getItsNatResources().getAnimator("@assets:animator/res/animator/test_value_animator_asset.xml");

    valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener()
    {
        public void onAnimationUpdate(ValueAnimator animation)
        {
            Integer value = (Integer) animation.getAnimatedValue();
            textView.setBackgroundColor(value);
        }
    });

    valueAnimator.start();

    Assert.assertEquals(valueAnimator.getDuration(), 2000);
    Assert.assertEquals(valueAnimator.getRepeatCount(), -1);
    Assert.assertEquals(valueAnimator.getRepeatMode(), 2);
    Assert.assertEquals(valueAnimator.getStartDelay(), 10);
}
 
開發者ID:jmarranz,項目名稱:itsnat_droid,代碼行數:27,代碼來源:TestSetupAssetLayoutAnimations1.java

示例14: registerAnimators

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
@Override
protected void registerAnimators() {
    mElevateAnimator = AnimatorInflater.loadAnimator(mContext, R.animator.elevate);
    mElevateAnimator.addListener(this);
    mElevateAnimator.setTarget(mView);
    mElevateAnimator.setDuration(500);

    mFlipLeftOutAnimator = AnimatorInflater.loadAnimator(mContext, R.animator.flip_left_out);
    mFlipLeftOutAnimator.addListener(this);
    mFlipLeftOutAnimator.setTarget(mView);

    mFlipLeftInAnimator = AnimatorInflater.loadAnimator(mContext, R.animator.flip_left_in);
    mFlipLeftInAnimator.addListener(this);
    mFlipLeftInAnimator.setTarget(mView);

    mLowerAnimator = AnimatorInflater.loadAnimator(mContext, R.animator.lower);
    mLowerAnimator.addListener(this);
    mLowerAnimator.setTarget(mView);
    mLowerAnimator.setDuration(500);
}
 
開發者ID:informatik-mannheim,項目名稱:gesture-framework,代碼行數:21,代碼來源:FlipSelectAnimator.java

示例15: doAnimationToGridLayout

import android.animation.AnimatorInflater; //導入方法依賴的package包/類
/** GridLayout のアニメーション */
private void doAnimationToGridLayout() {
    for (int i = 0, iL = mGridLayout.getChildCount(); i < iL; i++) {
        // 左上を基準として、距離を計算する。
        int vi = i % mGridLayout.getColumnCount();
        int hi = i / mGridLayout.getRowCount();
        int dist = vi + hi;

        // childを読み込み
        View childAt = mGridLayout.getChildAt(i);

        // アニメーション読み込み、設定
        Animator anim = (isShowingGridLayout)
                ? AnimatorInflater.loadAnimator(this, R.animator.activity_property_animation_grid_hide)
                : AnimatorInflater.loadAnimator(this, R.animator.activity_property_animation_grid_show);
        anim.setTarget(childAt);
        anim.setStartDelay(dist * 60);
        anim.start();
    }
    isShowingGridLayout = !isShowingGridLayout;
}
 
開發者ID:yokmama,項目名稱:honki_android,代碼行數:22,代碼來源:PropertyAnimationActivity.java


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