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


Java AnimatorInflater類代碼示例

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


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

示例1: init

import android.animation.AnimatorInflater; //導入依賴的package包/類
@SuppressLint("NewApi")
private void init(Context context, AttributeSet attributeSet) {
    mVisible = true;
    mColorNormal = getColor(R.color.material_blue_500);
    mColorPressed = darkenColor(mColorNormal);
    mColorRipple = lightenColor(mColorNormal);
    mColorDisabled = getColor(android.R.color.darker_gray);
    mType = TYPE_NORMAL;
    mShadow = true;
    mScrollThreshold = getResources().getDimensionPixelOffset(R.dimen.fab_scroll_threshold);
    mShadowSize = getDimension(R.dimen.fab_shadow_size);
    if (hasLollipopApi()) {
        StateListAnimator stateListAnimator = AnimatorInflater.loadStateListAnimator(context,
                R.animator.fab_press_elevation);
        setStateListAnimator(stateListAnimator);
    }
    if (attributeSet != null) {
        initAttributes(context, attributeSet);
    }
    updateBackground();
}
 
開發者ID:zuoweitan,項目名稱:Hitalk,代碼行數:22,代碼來源:FloatingActionButton.java

示例2: 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:mityung,項目名稱:XERUNG,代碼行數:22,代碼來源:CircleIndicator.java

示例3: enterBottomBar

import android.animation.AnimatorInflater; //導入依賴的package包/類
/**
 * 底部導航條進入動畫
 */
public void enterBottomBar() {
    String tab1 = HomeFragment.class.getSimpleName();
    String tab2 = SquareFragment.class.getSimpleName();
    String tab3 = MineFragment.class.getSimpleName();
    String currentTab = getCurrentFragment() != null ? getCurrentFragment().getClass().getSimpleName() : "";
    if (tab1.equals(currentTab) || tab2.equals(currentTab) || tab3.equals(currentTab)) {
        if (mBnvNavigation != null) {
            mBnvNavigation.post(new Runnable() {
                @Override
                public void run() {
                    Animator enterAnimator = AnimatorInflater.loadAnimator(MainContainerActivity.this, R.animator.bottom_enter);
                    enterAnimator.setTarget(mBnvNavigation);
                    enterAnimator.start();
                }
            });
        }
    }
}
 
開發者ID:Sugarya,項目名稱:Closet,代碼行數:22,代碼來源:MainContainerActivity.java

示例4: 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:rkkr,項目名稱:simple-keyboard,代碼行數:21,代碼來源:KeyPreviewDrawParams.java

示例5: 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

示例6: 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

示例7: setupAnimation

import android.animation.AnimatorInflater; //導入依賴的package包/類
private void setupAnimation(View view, final Animator animation, final int animationID) {
    view.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            // If the button is checked, load the animation from the given resource
            // id instead of using the passed-in animation parameter. See the xml files
            // for the details on those animations.
            if (mCheckBox.isChecked()) {
                Animator anim = AnimatorInflater.loadAnimator(PropertyAnimations.this, animationID);
                anim.setTarget(v);
                anim.start();
                return;
            }
            animation.start();
        }
    });
}
 
開發者ID:sdrausty,項目名稱:buildAPKsSamples,代碼行數:17,代碼來源:PropertyAnimations.java

示例8: ViewHolder

import android.animation.AnimatorInflater; //導入依賴的package包/類
ViewHolder(View itemView) {
    super(itemView);
    ButterKnife.bind(this, itemView);
    setCardViewToFlat(card);

    if (!Preferences.get(mContext).isShadowEnabled()) {
        card.setCardElevation(0f);
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        StateListAnimator stateListAnimator = AnimatorInflater
                .loadStateListAnimator(mContext, R.animator.card_lift_long);
        card.setStateListAnimator(stateListAnimator);
    }

    card.setOnClickListener(this);
    card.setOnLongClickListener(this);
    favorite.setOnClickListener(this);
}
 
開發者ID:danimahardhika,項目名稱:wallpaperboard,代碼行數:20,代碼來源:WallpapersAdapter.java

示例9: 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

示例10: 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

示例11: ProgramInfoViewBase

import android.animation.AnimatorInflater; //導入依賴的package包/類
public ProgramInfoViewBase(Context context, AttributeSet attrs) {
	super(context, attrs);

	setOrientation(LinearLayout.VERTICAL);
	setGravity(Gravity.CENTER_VERTICAL);

	LayoutInflater inflater = (LayoutInflater) context
		.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	//noinspection ConstantConditions
	inflater.inflate(getViewId(), this, true);

	ButterKnife.bind(this, this);

	showProgressAnimator = (ObjectAnimator) AnimatorInflater.loadAnimator(context,
		R.animator.view_program_info_show_progress);
	showProgressAnimator.setTarget(progressBarView);
}
 
開發者ID:cemrich,項目名稱:zapp,代碼行數:18,代碼來源:ProgramInfoViewBase.java

示例12: loadResources

import android.animation.AnimatorInflater; //導入依賴的package包/類
static void loadResources(Context context) {
    if (sFocusedNumberEnterAnimator == null) {
        TypedValue outValue = new TypedValue();
        context.getResources().getValue(
                R.dimen.pin_alpha_for_focused_number, outValue, true);
        sAlphaForFocusedNumber = outValue.getFloat();
        context.getResources().getValue(
                R.dimen.pin_alpha_for_adjacent_number, outValue, true);
        sAlphaForAdjacentNumber = outValue.getFloat();

        sFocusedNumberEnterAnimator = AnimatorInflater.loadAnimator(context,
                R.animator.pin_focused_number_enter);
        sFocusedNumberExitAnimator = AnimatorInflater.loadAnimator(context,
                R.animator.pin_focused_number_exit);
        sAdjacentNumberEnterAnimator = AnimatorInflater.loadAnimator(context,
                R.animator.pin_adjacent_number_enter);
        sAdjacentNumberExitAnimator = AnimatorInflater.loadAnimator(context,
                R.animator.pin_adjacent_number_exit);
    }
}
 
開發者ID:trevd,項目名稱:android_packages_apps_tv,代碼行數:21,代碼來源:PinDialogFragment.java

示例13: 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

示例14: 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

示例15: SideFragmentManager

import android.animation.AnimatorInflater; //導入依賴的package包/類
public SideFragmentManager(Activity activity, Runnable preShowRunnable,
        Runnable postHideRunnable) {
    mActivity = activity;
    mFragmentManager = mActivity.getFragmentManager();
    mPreShowRunnable = preShowRunnable;
    mPostHideRunnable = postHideRunnable;

    mPanel = mActivity.findViewById(R.id.side_panel);
    mShowAnimator = AnimatorInflater.loadAnimator(mActivity, R.animator.side_panel_enter);
    mShowAnimator.setTarget(mPanel);
    mHideAnimator = AnimatorInflater.loadAnimator(mActivity, R.animator.side_panel_exit);
    mHideAnimator.setTarget(mPanel);
    mHideAnimator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            // Animation is still in running state at this point.
            hideAllInternal();
        }
    });

    mShowDurationMillis = mActivity.getResources().getInteger(
            R.integer.side_panel_show_duration);
}
 
開發者ID:trevd,項目名稱:android_packages_apps_tv,代碼行數:24,代碼來源:SideFragmentManager.java


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