当前位置: 首页>>代码示例>>Java>>正文


Java ViewCompat.postInvalidateOnAnimation方法代码示例

本文整理汇总了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;
    }
 
开发者ID:While1true,项目名称:JSSample,代码行数:20,代码来源:SScrollview.java

示例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();
        }
    }
}
 
开发者ID:rexyren,项目名称:PageScrollView,代码行数:20,代码来源:PageScrollView.java

示例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);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:19,代码来源:RecyclerView.java

示例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);
}
 
开发者ID:commonsguy,项目名称:cwac-crossport,代码行数:14,代码来源:CollapsingTextHelper.java

示例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);
        ;
    }
}
 
开发者ID:jumaallan,项目名称:AndelaTrackChallenge,代码行数:13,代码来源:InkPageIndicator.java

示例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) {
    }
}
 
开发者ID:devzwy,项目名称:KUtils,代码行数:16,代码来源:BGAViewPager.java

示例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;
}
 
开发者ID:zhouphenix,项目名称:Multi-SwipeToRefreshLayout,代码行数:13,代码来源:SwipeToRefreshLayout.java

示例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);
    }
}
 
开发者ID:zhudongya123,项目名称:WechatChatroomHelper,代码行数:12,代码来源:BGASwipeBackLayout.java

示例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);
    }
}
 
开发者ID:NICOLITE,项目名称:HutHelper,代码行数:11,代码来源:DragLayout.java

示例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);
    }
}
 
开发者ID:coopese,项目名称:qmui,代码行数:11,代码来源:QMUICollapsingTopBarLayout.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:AbstractChartView.java

示例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();
    }
}
 
开发者ID:jakebonk,项目名称:BoardView,代码行数:15,代码来源:BoardView.java

示例13: computeScroll

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void computeScroll() {
    mScrimOpacity = 1 - mScrollPercent;
    if (mDragHelper.continueSettling(true)) {
        ViewCompat.postInvalidateOnAnimation(this);
    }
}
 
开发者ID:longtaoge,项目名称:SelectName,代码行数:8,代码来源:SwipeBackLayout.java

示例14: setShimmerTranslate

import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
protected void setShimmerTranslate(float shimmerTranslate)
{
    if (mIsShimmerAnim && mShimmerTranslate != shimmerTranslate)
    {
        mShimmerTranslate = shimmerTranslate;
        ViewCompat.postInvalidateOnAnimation(this);
    }
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:9,代码来源:AbsFocusBorder.java

示例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);
}
 
开发者ID:huashengzzz,项目名称:SmartChart,代码行数:9,代码来源:PieChartView.java


注:本文中的android.support.v4.view.ViewCompat.postInvalidateOnAnimation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。