當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewCompat.postOnAnimation方法代碼示例

本文整理匯總了Java中com.handmark.pulltorefresh.library.internal.ViewCompat.postOnAnimation方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewCompat.postOnAnimation方法的具體用法?Java ViewCompat.postOnAnimation怎麽用?Java ViewCompat.postOnAnimation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.handmark.pulltorefresh.library.internal.ViewCompat的用法示例。


在下文中一共展示了ViewCompat.postOnAnimation方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: run

import com.handmark.pulltorefresh.library.internal.ViewCompat; //導入方法依賴的package包/類
public void run() {
    if (this.mStartTime == -1) {
        this.mStartTime = System.currentTimeMillis();
    } else {
        this.mCurrentY = this.mScrollFromY - Math.round(((float) (this.mScrollFromY -
                this.mScrollToY)) * this.mInterpolator.getInterpolation(((float) Math.max
                (Math.min(((System.currentTimeMillis() - this.mStartTime) * 1000) / this
                        .mDuration, 1000), 0)) / 1000.0f));
        PullToRefreshBase.this.setHeaderScroll(this.mCurrentY);
    }
    if (this.mContinueRunning && this.mScrollToY != this.mCurrentY) {
        ViewCompat.postOnAnimation(PullToRefreshBase.this, this);
    } else if (this.mListener != null) {
        this.mListener.onSmoothScrollFinished();
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:17,代碼來源:PullToRefreshBase.java

示例2: run

import com.handmark.pulltorefresh.library.internal.ViewCompat; //導入方法依賴的package包/類
public void run()
{
    if (h == -1L)
    {
        h = System.currentTimeMillis();
    } else
    {
        long l = Math.max(Math.min((1000L * (System.currentTimeMillis() - h)) / e, 1000L), 0L);
        int j = Math.round((float)(d - c) * b.getInterpolation((float)l / 1000F));
        i = d - j;
        a.setHeaderScroll(i);
    }
    if (g && c != i)
    {
        ViewCompat.postOnAnimation(a, this);
    } else
    if (f != null)
    {
        f.a();
        return;
    }
}
 
開發者ID:vishnudevk,項目名稱:MiBandDecompiled,代碼行數:23,代碼來源:h.java

示例3: run

import com.handmark.pulltorefresh.library.internal.ViewCompat; //導入方法依賴的package包/類
@Override
public void run() {

	/**
	 * Only set mStartTime if this is the first time we're starting,
	 * else actually calculate the Y delta
	 */
	if (mStartTime == -1) {
		mStartTime = System.currentTimeMillis();
	} else {

		/**
		 * We do do all calculations in long to reduce software float
		 * calculations. We use 1000 as it gives us good accuracy and
		 * small rounding errors
		 */
		long normalizedTime = (1000 * (System.currentTimeMillis() - mStartTime)) / mDuration;
		normalizedTime = Math.max(Math.min(normalizedTime, 1000), 0);

		final int deltaY = Math.round((mScrollFromY - mScrollToY)
				* mInterpolator.getInterpolation(normalizedTime / 1000f));
		mCurrentY = mScrollFromY - deltaY;
		setHeaderScroll(mCurrentY);
	}

	// If we're not at the target Y, keep going...
	if (mContinueRunning && mScrollToY != mCurrentY) {
		ViewCompat.postOnAnimation(PullToRefreshBase.this, this);
	} else {
		if (null != mListener) {
			mListener.onSmoothScrollFinished();
		}
	}
}
 
開發者ID:ultrasonic,項目名稱:ultrasonic,代碼行數:35,代碼來源:PullToRefreshBase.java

示例4: run

import com.handmark.pulltorefresh.library.internal.ViewCompat; //導入方法依賴的package包/類
@Override
public void run() {

    /**
     * Only set mStartTime if this is the first time we're starting,
     * else actually calculate the Y delta
     */
    if (mStartTime == -1) {
        mStartTime = System.currentTimeMillis();
    } else {

        /**
         * We do do all calculations in long to reduce software float
         * calculations. We use 1000 as it gives us good accuracy and
         * small rounding errors
         */
        long normalizedTime = (1000 * (System.currentTimeMillis() - mStartTime)) / mDuration;
        normalizedTime = Math.max(Math.min(normalizedTime, 1000), 0);

        final int deltaY = Math.round((mScrollFromY - mScrollToY)
                * mInterpolator.getInterpolation(normalizedTime / 1000f));
        mCurrentY = mScrollFromY - deltaY;
        setHeaderScroll(mCurrentY);
    }

    // If we're not at the target Y, keep going...
    if (mContinueRunning && mScrollToY != mCurrentY) {
        ViewCompat.postOnAnimation(PullToRefreshBase.this, this);
    } else {
        if (null != mListener) {
            mListener.onSmoothScrollFinished();
        }
    }
}
 
開發者ID:BigAppOS,項目名稱:BigApp_Discuz_Android,代碼行數:35,代碼來源:PullToRefreshBase.java

示例5: run

import com.handmark.pulltorefresh.library.internal.ViewCompat; //導入方法依賴的package包/類
@Override
public void run() {

    /**
     * Only set mStartTime if this is the first time we're starting,
     * else actually calculate the Y delta
     */
    if (mStartTime == -1) {
        mStartTime = System.currentTimeMillis();
    } else {

        /**
         * We do do all calculations in long to reduce software float
         * calculations. We use 1000 as it gives us good accuracy and
         * small rounding errors
         */
        long normalizedTime = (1000 * (System.currentTimeMillis() - mStartTime))
                / mDuration;
        normalizedTime = Math.max(Math.min(normalizedTime, 1000), 0);

        final int deltaY = Math.round((mScrollFromY - mScrollToY)
                * mInterpolator
                .getInterpolation(normalizedTime / 1000f));
        mCurrentY = mScrollFromY - deltaY;
        setHeaderScroll(mCurrentY);
    }

    // If we're not at the target Y, keep going...
    if (mContinueRunning && mScrollToY != mCurrentY) {
        ViewCompat.postOnAnimation(PullToRefreshBase.this, this);
    } else {
        if (null != mListener) {
            mListener.onSmoothScrollFinished();
        }
    }
}
 
開發者ID:BigAppOS,項目名稱:BigApp_WordPress_Android,代碼行數:37,代碼來源:PullToRefreshBase.java

示例6: run

import com.handmark.pulltorefresh.library.internal.ViewCompat; //導入方法依賴的package包/類
@Override
public void run() {

	/**
	 * Only set mStartTime if this is the first time we're starting,
	 * else actually calculate the Y delta
	 */
	if (mStartTime == -1) {
		mStartTime = System.currentTimeMillis();
	} else {

		/**
		 * We do do all calculations in long to reduce software float
		 * calculations. We use 1000 as it gives us good accuracy and
		 * small rounding errors
		 */
		long normalizedTime = (1000 * (System.currentTimeMillis() - mStartTime))
				/ mDuration;
		normalizedTime = Math.max(Math.min(normalizedTime, 1000), 0);

		final int deltaY = Math.round((mScrollFromY - mScrollToY)
				* mInterpolator
						.getInterpolation(normalizedTime / 1000f));
		mCurrentY = mScrollFromY - deltaY;
		setHeaderScroll(mCurrentY);
	}

	// If we're not at the target Y, keep going...
	if (mContinueRunning && mScrollToY != mCurrentY) {
		ViewCompat.postOnAnimation(PullToRefreshBase.this, this);
	} else {
		if (null != mListener) {
			mListener.onSmoothScrollFinished();
		}
	}
}
 
開發者ID:MadKauz,項目名稱:starcitizeninfoclient,代碼行數:37,代碼來源:PullToRefreshBase.java

示例7: run

import com.handmark.pulltorefresh.library.internal.ViewCompat; //導入方法依賴的package包/類
@Override
public void run() {

    /**
     * Only set mStartTime if this is the first time we're starting,
     * else actually calculate the Y delta
     */
    if (mStartTime == -1) {
        mStartTime = System.currentTimeMillis();
    } else {

        /**
         * We do do all calculations in long to reduce software float
         * calculations. We use 1000 as it gives us good accuracy and
         * small rounding errors
         */
        long normalizedTime = (1000 * (System.currentTimeMillis() - mStartTime)) / mDuration;
        normalizedTime = Math.max(Math.min(normalizedTime, 1000), 0);

        final int deltaY = Math.round((mScrollFromY - mScrollToY) * mInterpolator.getInterpolation(normalizedTime / 1000f));
        mCurrentY = mScrollFromY - deltaY;
        setHeaderScroll(mCurrentY);
    }

    // If we're not at the target Y, keep going...
    if (mContinueRunning && mScrollToY != mCurrentY) {
        ViewCompat.postOnAnimation(PullToRefreshBase.this, this);
    } else {
        if (null != mListener) {
            mListener.onSmoothScrollFinished();
        }
    }
}
 
開發者ID:GMAndroidTeam,項目名稱:Android-PullToRefresh,代碼行數:34,代碼來源:PullToRefreshBase.java

示例8: run

import com.handmark.pulltorefresh.library.internal.ViewCompat; //導入方法依賴的package包/類
@Override
public void run() {

    /**
     * Only set mStartTime if this is the first time we're starting,
     * else actually calculate the Y delta
     */
    if (mStartTime == -1) {
        mStartTime = System.currentTimeMillis();
    } else {

        /**
         * We do do all calculations in long to reduce software float
         * calculations. We use 1000 as it gives us good accuracy and
         * small rounding errors
         */
        long normalizedTime = (1000 * (System.currentTimeMillis() - mStartTime))
                / mDuration;
        normalizedTime = Math.max(Math.min(normalizedTime, 1000), 0);

        final int deltaY = Math.round((mScrollFromY - mScrollToY)
                * mInterpolator
                        .getInterpolation(normalizedTime / 1000f));
        mCurrentY = mScrollFromY - deltaY;
        setHeaderScroll(mCurrentY);
    }

    // If we're not at the target Y, keep going...
    if (mContinueRunning && mScrollToY != mCurrentY) {
        ViewCompat.postOnAnimation(PullToRefreshBase.this, this);
    } else {
        if (null != mListener) {
            mListener.onSmoothScrollFinished();
        }
    }
}
 
開發者ID:jiangerji,項目名稱:danmaku-project,代碼行數:37,代碼來源:PullToRefreshBase.java


注:本文中的com.handmark.pulltorefresh.library.internal.ViewCompat.postOnAnimation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。