本文整理汇总了Java中android.support.v4.view.ViewCompat.postInvalidateOnAnimation方法的典型用法代码示例。如果您正苦于以下问题:Java ViewCompat.postInvalidateOnAnimation方法的具体用法?Java ViewCompat.postInvalidateOnAnimation怎么用?Java ViewCompat.postInvalidateOnAnimation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.view.ViewCompat
的用法示例。
在下文中一共展示了ViewCompat.postInvalidateOnAnimation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onNestedFling
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed) {
Log.i(TAG, "onNestedFling: " + scrolls + "==" + velocityY);
if (myScrollView.canPull(1) && myScrollView.canPull(-1))
return false;
boolean canOverscroll = false;
if (scrolls == 0) {
if ((canOverscrollheader && velocityY < 1000) || (canOverscrollfooter && velocityY > 1000)) {
canOverscroll = true;
if (animator1 != null)
animator1.cancel();
Log.i(TAG, "onNestedFling: " + velocityY);
// scrollerCompat.fling(0, getScrollY(), 0, (int) velocityY, 0, 0, 0, maxFastOverScroll, 0, myScrollView.computeVerticalScrollRange());
scrollerCompat.fling(0, myScrollView.getScrollY(), 0, (int) velocityY, 0, 0, -2 * maxFastOverScroll, myScrollView.computeVerticalScrollRange() + 2 * maxFastOverScroll);
ViewCompat.postInvalidateOnAnimation(this);
}
}
return canOverscroll;
}
示例2: computeScroll
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void computeScroll() {
boolean scrollerWorkNow = SCROLL_STATE_SETTLING == mScrollState;
OverScroller scroller = scrollerWorkNow ? getScroller() : null;
if (scroller != null && scroller.computeScrollOffset()) {
int oldX = getScrollX();
int oldY = getScrollY();
int x = scroller.getCurrX();
int y = scroller.getCurrY();
if (oldX != x || oldY != y) {
scrollTo(x, y);
}
ViewCompat.postInvalidateOnAnimation(this);
} else {
if (scrollerWorkNow) {
markAsWillIdle();
}
}
}
示例3: releaseGlows
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void releaseGlows() {
boolean needsInvalidate = false;
if (this.mLeftGlow != null) {
needsInvalidate = this.mLeftGlow.onRelease();
}
if (this.mTopGlow != null) {
needsInvalidate |= this.mTopGlow.onRelease();
}
if (this.mRightGlow != null) {
needsInvalidate |= this.mRightGlow.onRelease();
}
if (this.mBottomGlow != null) {
needsInvalidate |= this.mBottomGlow.onRelease();
}
if (needsInvalidate) {
ViewCompat.postInvalidateOnAnimation(this);
}
}
示例4: setInterpolatedTextSize
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void setInterpolatedTextSize(float textSize) {
calculateUsingTextSize(textSize);
// Use our texture if the scale isn't 1.0
mUseTexture = USE_SCALING_TEXTURE && mScale != 1f;
if (mUseTexture) {
// Make sure we have an expanded texture if needed
ensureExpandedTexture();
}
ViewCompat.postInvalidateOnAnimation(mView);
}
示例5: setJoiningFraction
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
private void setJoiningFraction(int leftDot, float fraction) {
if (leftDot < joiningFractions.length) {
if (leftDot == 1) {
//Log.d("PageIndicator", "dot 1 fraction:\t" + fraction);
}
joiningFractions[leftDot] = fraction;
ViewCompat.postInvalidateOnAnimation(this);
;
}
}
示例6: setBannerCurrentItemInternal
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
/**
* 切换到指定索引的页面,主要用于自动轮播
*
* @param position
*/
public void setBannerCurrentItemInternal(int position, boolean smoothScroll) {
Class viewpagerClass = ViewPager.class;
try {
Method setCurrentItemInternalMethod = viewpagerClass.getDeclaredMethod("setCurrentItemInternal", int.class, boolean.class, boolean.class);
setCurrentItemInternalMethod.setAccessible(true);
setCurrentItemInternalMethod.invoke(this, position, smoothScroll, true);
ViewCompat.postInvalidateOnAnimation(this);
} catch (Exception e) {
}
}
示例7: reset
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
/**
* 重置状态,外部调用的时候需要调用
* @return true 有移动距离,反之,已经到达该点
*/
public boolean reset() {
boolean isReset = mViewDragHelper.smoothSlideViewTo(mContentView, mOriginX, mOriginY);
if (isReset) {
ViewCompat.postInvalidateOnAnimation(SwipeToRefreshLayout.this);
}
changeState(IDLE);
return isReset;
}
示例8: computeScroll
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void computeScroll() {
if (mDragHelper.continueSettling(true)) {
if (!mCanSlide) {
mDragHelper.abort();
return;
}
ViewCompat.postInvalidateOnAnimation(this);
}
}
示例9: close
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
public void close(boolean animate) {
if (animate) {
if (dragHelper.smoothSlideViewTo(vg_main, 0, 0)) {
ViewCompat.postInvalidateOnAnimation(this);
}
} else {
vg_main.layout(0, 0, width, height);
dispatchDragEvent(0);
}
}
示例10: setScrimAlpha
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
void setScrimAlpha(int alpha) {
if (alpha != mScrimAlpha) {
final Drawable contentScrim = mContentScrim;
if (contentScrim != null && mTopBar != null) {
ViewCompat.postInvalidateOnAnimation(mTopBar);
}
mScrimAlpha = alpha;
ViewCompat.postInvalidateOnAnimation(QMUICollapsingTopBarLayout.this);
}
}
示例11: setCurrentViewportWithAnimation
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void setCurrentViewportWithAnimation(Viewport targetViewport) {
if (null != targetViewport) {
viewportAnimator.cancelAnimation();
viewportAnimator.startAnimation(getCurrentViewport(), targetViewport);
}
ViewCompat.postInvalidateOnAnimation(this);
}
示例12: computeScroll
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void computeScroll() {
if (!mScroller.isFinished() && mScroller.computeScrollOffset()) {
int x = mScroller.getCurrX();
int y = mScroller.getCurrY();
if (getScrollX() != x || getScrollY() != y) {
scrollTo(x, y);
}
ViewCompat.postInvalidateOnAnimation(this);
} else {
super.computeScroll();
}
}
示例13: computeScroll
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void computeScroll() {
mScrimOpacity = 1 - mScrollPercent;
if (mDragHelper.continueSettling(true)) {
ViewCompat.postInvalidateOnAnimation(this);
}
}
示例14: setShimmerTranslate
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
protected void setShimmerTranslate(float shimmerTranslate)
{
if (mIsShimmerAnim && mShimmerTranslate != shimmerTranslate)
{
mShimmerTranslate = shimmerTranslate;
ViewCompat.postInvalidateOnAnimation(this);
}
}
示例15: setCircleFillRatio
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
/**
* Set how much of view area should be taken by chart circle. Value should be between 0 and 1. Default is 1 so
* circle will have radius equals min(View.width, View.height).
*/
public void setCircleFillRatio(float fillRatio) {
pieChartRenderer.setCircleFillRatio(fillRatio);
ViewCompat.postInvalidateOnAnimation(this);
}