@Override public void onHorizontalDrag(float percentX, int offsetX, int offsetMax) { mWaveOffsetX = offsetX; final View thisView = this; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { thisView.postInvalidateOnAnimation(); } else { thisView.invalidate(); } } //</editor-fold>
@Override public void onAnimationUpdate(ValueAnimator animation) { mCurrentCircleCenterY = (float) animation.getAnimatedValue(); final View thisView = WaveView.this; if (Build.VERSION.SDK_INT >= 16) { thisView.postInvalidateOnAnimation(); } else { thisView.invalidate(); } } });
/** * Original method view.postInvalidateOnAnimation() only supportd in API >= * 16, This is a replica of the code from ViewCompat. * * @param view */ @SuppressLint("NewApi") public static void postInvalidateOnAnimation(View view) { if (Build.VERSION.SDK_INT >= 16) view.postInvalidateOnAnimation(); else view.postInvalidateDelayed(10); }
thisView.postInvalidateOnAnimation(); } else { thisView.invalidate();
thisView.postInvalidateOnAnimation(); } else { thisView.invalidate();
public void beginPhase(float move1) { onPreDragWave(); //円を描画し始める前の引っ張ったら膨れる波の部分の描画 mWavePath.moveTo(0, 0); //左半分の描画 mWavePath.cubicTo(mWidth * BEGIN_PHASE_POINTS[0][0], BEGIN_PHASE_POINTS[0][1], mWidth * BEGIN_PHASE_POINTS[1][0], mWidth * (BEGIN_PHASE_POINTS[1][1] + move1), mWidth * BEGIN_PHASE_POINTS[2][0], mWidth * (BEGIN_PHASE_POINTS[2][1] + move1)); mWavePath.cubicTo(mWidth * BEGIN_PHASE_POINTS[3][0], mWidth * (BEGIN_PHASE_POINTS[3][1] + move1), mWidth * BEGIN_PHASE_POINTS[4][0], mWidth * (BEGIN_PHASE_POINTS[4][1] + move1), mWidth * BEGIN_PHASE_POINTS[5][0], mWidth * (BEGIN_PHASE_POINTS[5][1] + move1)); //右半分の描画 mWavePath.cubicTo(mWidth - mWidth * BEGIN_PHASE_POINTS[4][0], mWidth * (BEGIN_PHASE_POINTS[4][1] + move1), mWidth - mWidth * BEGIN_PHASE_POINTS[3][0], mWidth * (BEGIN_PHASE_POINTS[3][1] + move1), mWidth - mWidth * BEGIN_PHASE_POINTS[2][0], mWidth * (BEGIN_PHASE_POINTS[2][1] + move1)); mWavePath.cubicTo(mWidth - mWidth * BEGIN_PHASE_POINTS[1][0], mWidth * (BEGIN_PHASE_POINTS[1][1] + move1), mWidth - mWidth * BEGIN_PHASE_POINTS[0][0], BEGIN_PHASE_POINTS[0][1], mWidth, 0); final View thisView = this; if (Build.VERSION.SDK_INT >= 16) { thisView.postInvalidateOnAnimation(); } else { thisView.invalidate(); } }
public static void postInvalidateOnAnimation(View view) { view.postInvalidateOnAnimation(); }
/** * Causes an invalidate of the pullable view to happen on the next animation time step. */ private void postInvalidateViewOnAnimation() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { mView.postInvalidateOnAnimation(); } else { final long currentTime = SystemClock.uptimeMillis(); if (currentTime - mLastViewInvalidationTime >= UiConfig.ANIMATION_FRAME_UPDATE_INTERVAL) { mView.postDelayed(INVALIDATE_VIEW, UiConfig.ANIMATION_FRAME_UPDATE_INTERVAL); } this.mLastViewInvalidationTime = currentTime; } }
/** * Causes an invalidate of the pullable view to happen on the next animation time step. */ private void postInvalidateViewOnAnimation() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { mView.postInvalidateOnAnimation(); } else { final long currentTime = SystemClock.uptimeMillis(); if (currentTime - mLastViewInvalidationTime >= UiConfig.ANIMATION_FRAME_UPDATE_INTERVAL) { mView.postDelayed(INVALIDATE_VIEW, UiConfig.ANIMATION_FRAME_UPDATE_INTERVAL); } this.mLastViewInvalidationTime = currentTime; } }
/** * Original method view.postInvalidateOnAnimation() only supportd in API >= * 16, This is a replica of the code from ViewCompat. * * @param view */ @SuppressLint("NewApi") public static void postInvalidateOnAnimation(View view) { if (Build.VERSION.SDK_INT >= 16) view.postInvalidateOnAnimation(); else view.postInvalidateDelayed(10); }
/** * Original method view.postInvalidateOnAnimation() only supportd in API >= * 16, This is a replica of the code from ViewCompat. * * @param view */ @SuppressLint("NewApi") public static void postInvalidateOnAnimation(View view) { if (Build.VERSION.SDK_INT >= 16) view.postInvalidateOnAnimation(); else view.postInvalidateDelayed(10); }
/** * Original method view.postInvalidateOnAnimation() only supportd in API >= * 16, This is a replica of the code from ViewCompat. * * @param view */ @SuppressLint("NewApi") public static void postInvalidateOnAnimation(View view) { if (Build.VERSION.SDK_INT >= 16) view.postInvalidateOnAnimation(); else view.postInvalidateDelayed(10); }
/** * Original method view.postInvalidateOnAnimation() only supportd in API >= * 16, This is a replica of the code from ViewCompat. * * @param view */ @SuppressLint("NewApi") public static void postInvalidateOnAnimation(View view) { if (Build.VERSION.SDK_INT >= 16) view.postInvalidateOnAnimation(); else view.postInvalidateDelayed(10); }
/** * Original method view.postInvalidateOnAnimation() only supportd in API >= * 16, This is a replica of the code from ViewCompat. * * @param view */ @SuppressLint("NewApi") public static void postInvalidateOnAnimation(View view) { if (Build.VERSION.SDK_INT >= 16) { view.postInvalidateOnAnimation(); } else { view.postInvalidateDelayed(10); } }
/** * Invalidates all of the suggestion views in the list. Only applicable when this * is visible. */ public void invalidateSuggestionViews() { if (!isShown()) return; ListView suggestionsList = mSuggestionList; for (int i = 0; i < suggestionsList.getChildCount(); i++) { if (suggestionsList.getChildAt(i) instanceof SuggestionView) { suggestionsList.getChildAt(i).postInvalidateOnAnimation(); } } }
private void setRefineIcon(boolean invalidateIcon) { if (!invalidateIcon && mRefineIcon != null) return; mRefineIcon = TintedDrawable.constructTintedDrawable( getResources(), R.drawable.btn_suggestion_refine); mRefineIcon.setTint(ApiCompatibilityUtils.getColorStateList(getResources(), mUseDarkColors ? R.color.dark_mode_tint : R.color.light_mode_tint)); mRefineIcon.setBounds( 0, 0, mRefineIcon.getIntrinsicWidth(), mRefineIcon.getIntrinsicHeight()); mRefineIcon.setState(mRefineView.getDrawableState()); mRefineView.postInvalidateOnAnimation(); }