當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。