@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(); }
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; }
/** * 底部导航条进入动画 */ 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(); } }); } } }
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; }
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; }
@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(); }
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(); } }); }
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); }
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(); } }
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); }
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); } }
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; }
@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); } }); }
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); }
/** * Hide the side panel. This method just hide the panel and preserves the back * stack. If you want to empty the back stack, call {@link #hideAll}. */ public void hideSidePanel(boolean withAnimation) { mHandler.removeCallbacks(mHideAllRunnable); if (withAnimation) { Animator hideAnimator = AnimatorInflater.loadAnimator(mActivity, R.animator.side_panel_exit); hideAnimator.setTarget(mPanel); hideAnimator.start(); hideAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mPanel.setVisibility(View.GONE); } }); } else { mPanel.setVisibility(View.GONE); } }
private void startIntroTextAnimation() { if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { Animator introAnimator = AnimatorInflater.loadAnimator(this, R.animator.intro); introAnimator.setTarget(introTextView); introAnimator.start(); } else { Keyframe kf0 = Keyframe.ofFloat(0f, 0); Keyframe kf1 = Keyframe.ofFloat(.2f, 1); Keyframe kf2 = Keyframe.ofFloat(.9f, 1); Keyframe kf3 = Keyframe.ofFloat(1f, 0); PropertyValuesHolder pvh = PropertyValuesHolder.ofKeyframe("alpha", kf0, kf1, kf2, kf3); ObjectAnimator alphaAnimator = ObjectAnimator.ofPropertyValuesHolder(introTextView, pvh); alphaAnimator.setInterpolator(new DecelerateInterpolator()); alphaAnimator.setDuration(6000).setStartDelay(1000); alphaAnimator.start(); } }
private void startLogoAnimation() { if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { Animator logoAnimator = AnimatorInflater.loadAnimator(this, R.animator.logo); logoAnimator.setTarget(logoView); logoAnimator.start(); } else { AnimatorSet animatorSet = new AnimatorSet(); PropertyValuesHolder pvh = PropertyValuesHolder.ofKeyframe("alpha", Keyframe.ofFloat(0f, 1), Keyframe.ofFloat(.5f, 1), Keyframe.ofFloat(1f, 0)); ObjectAnimator alphaAnimator = ObjectAnimator.ofPropertyValuesHolder(logoView, pvh); pvh = PropertyValuesHolder.ofKeyframe("scaleX", Keyframe.ofFloat(0f, 2.75f), Keyframe.ofFloat(1f, .1f)); ObjectAnimator scaleXAnimator = ObjectAnimator.ofPropertyValuesHolder(logoView, pvh); pvh = PropertyValuesHolder.ofKeyframe("scaleY", Keyframe.ofFloat(0f, 2.75f), Keyframe.ofFloat(1f, .1f)); ObjectAnimator scaleYAnimator = ObjectAnimator.ofPropertyValuesHolder(logoView, pvh); animatorSet.setInterpolator(new DecelerateInterpolator()); animatorSet.setDuration(9000).setStartDelay(9000); animatorSet.playTogether(alphaAnimator, scaleXAnimator, scaleYAnimator); animatorSet.start(); } }
public RecorderButton(Context context, AttributeSet attrs) { super(context, attrs); mBtnAnim = AnimatorInflater.loadAnimator(getContext(), R.animator.recorder_btn_press_anim); mBtnAnim.setTarget(this); mDialogManager = new RecorderDialogManager(context); mAudioManager = AudioManager.getInstance(); this.setOnLongClickListener(new OnLongClickListener() { @Override public boolean onLongClick(View v) { // Log.e("TAG", "long click"); mBtnAnim.start(); isRecording = true; mAudioManager.prepareAudio(); return false; } }); mAudioManager.setAudioStateListener(this); }
/** Inflates an instance of MotionSpec from the given animator resource. */ @Nullable public static MotionSpec createFromResource(Context context, @AnimatorRes int id) { try { Animator animator = AnimatorInflater.loadAnimator(context, id); if (animator instanceof AnimatorSet) { AnimatorSet set = (AnimatorSet) animator; return createSpecFromAnimators(set.getChildAnimations()); } else if (animator != null) { List<Animator> animators = new ArrayList<>(); animators.add(animator); return createSpecFromAnimators(animators); } else { return null; } } catch (Exception e) { Log.w(TAG, "Can't load animation resource ID #0x" + Integer.toHexString(id), e); return null; } }
@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.anim.fab_press_elevation); setStateListAnimator(stateListAnimator); } if (attributeSet != null) { initAttributes(context, attributeSet); } updateBackground(); }
public TagViewHolder(View view) { itemView = view; ButterKnife.bind(this, view); tvTag.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Animator animator = AnimatorInflater.loadAnimator(getContext(), R.animator.zoom_in_out); animator.setTarget(itemView); animator.setDuration(100); animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { Toast.makeText(getContext(), "Successfully", Toast.LENGTH_SHORT).show(); } }); animator.start(); v.setSelected(!v.isSelected()); } }); }
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); }
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(); }
@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.anim.fab_press_elevation); setStateListAnimator(stateListAnimator); } if (attributeSet != null) { initAttributes(context, attributeSet); } updateBackground(); }
private void hideSkipAreaWhenScrolling(int state) { if (state == 1 && mMouseMoving) { mSkipArea.setVisibility(View.INVISIBLE); } else { if (mSkipArea.getVisibility() == View.VISIBLE) { return; } if (mSkipButtonShow != null && mSkipButtonShow.isRunning()) { return; } mSkipButtonShow = (AnimatorSet) AnimatorInflater .loadAnimator(NavigationWelcomeActivity.this, R.anim.nav_2_everything_show); mSkipArea.setVisibility(View.VISIBLE); mSkipButtonShow .setTarget(mSkipArea); mSkipButtonShow.start(); } }
public 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); } }
@Override protected void registerAnimators() { mElevateAnimator = AnimatorInflater.loadAnimator(mContext, R.animator.elevate); mElevateAnimator.addListener(this); mElevateAnimator.setTarget(mView); mElevateAnimator.setDuration(1); mFlyOutAnimator = AnimatorInflater.loadAnimator(mContext, R.animator.fly_out_south); mFlyOutAnimator.addListener(this); mFlyOutAnimator.setTarget(mView); mFlyInAnimator = AnimatorInflater.loadAnimator(mContext, R.animator.fly_in_north); mFlyInAnimator.addListener(this); mFlyInAnimator.setTarget(mView); mLowerAnimator = AnimatorInflater.loadAnimator(mContext, R.animator.lower); mLowerAnimator.addListener(this); mLowerAnimator.setTarget(mView); mTeleportOutAnimator = AnimatorInflater.loadAnimator(mContext, R.animator.teleport_north); mTeleportOutAnimator.addListener(this); mTeleportOutAnimator.setTarget(mView); }
@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); }
@Override public void onResume() { super.onResume(); addToDelete = (AnimatorSet) AnimatorInflater.loadAnimator(getActivity(), R.animator.add_to_delete); deleteToAdd = (AnimatorSet) AnimatorInflater.loadAnimator(getActivity(), R.animator.delete_to_add); viewCreateDeleteEntities = ButterKnife.findById(getActivity(), getViewCreateEntity()); viewCreateDeleteEntities.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (hasPendencies()) { removeEntities(); } else { openEntityForm(v); } } }); }
/** 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; }
public Topbar(Context context, AttributeSet attrs) { super(context, attrs); // Styleables from XML TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.Topbar); if (a.hasValue(R.styleable.Topbar_title)) { mTitle = a.getString(R.styleable.Topbar_title); } else { mTitle = new String(); } isShowBackButton = a.getBoolean(R.styleable.Topbar_showBackButton, true); ((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.topbar, this); mShowAnimator = AnimatorInflater.loadAnimator(getContext(), R.animator.topbar_show); mShowAnimator.setTarget(this); mShowAnimator.addListener(mShowAnimatorListener); mHideAnimator = AnimatorInflater.loadAnimator(getContext(), R.animator.topbar_hide); mHideAnimator.setTarget(this); mHideAnimator.addListener(mHideAnimatorListener); }