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


Java EdgeEffectCompat.setSize方法代碼示例

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


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

示例1: updateGlowSize

import android.support.v4.widget.EdgeEffectCompat; //導入方法依賴的package包/類
private static void updateGlowSize(RecyclerView rv, EdgeEffectCompat glow, int dir) {
    int width = rv.getMeasuredWidth();
    int height = rv.getMeasuredHeight();

    if (getClipToPadding(rv)) {
        width -= rv.getPaddingLeft() + rv.getPaddingRight();
        height -= rv.getPaddingTop() + rv.getPaddingBottom();
    }

    width = Math.max(0, width);
    height = Math.max(0, height);

    if (dir == EDGE_LEFT || dir == EDGE_RIGHT) {
        int t = width;
        width = height;
        height = t;
    }

    glow.setSize(width, height);
}
 
開發者ID:fabricethilaw,項目名稱:expandable-recyclerview-with-gridlayout,代碼行數:21,代碼來源:BaseEdgeEffectDecorator.java

示例2: drawEdgeEffect

import android.support.v4.widget.EdgeEffectCompat; //導入方法依賴的package包/類
private void drawEdgeEffect(
		Canvas canvas,
		EdgeEffectCompat edgeEffect,
		int degrees) {
	if (canvas == null || edgeEffect == null ||
			edgeEffect.isFinished()) {
		return;
	}

	int restoreCount = canvas.getSaveCount();
	int width = getWidth();
	int height = getHeight() - getPaddingTop() - getPaddingBottom();

	canvas.rotate(degrees);

	if (degrees == 270) {
		canvas.translate(
				(float) -height + getPaddingTop(),
				0);
	} else {
		canvas.translate(
				-getPaddingTop(),
				-width);
	}

	edgeEffect.setSize(height, width);

	if (edgeEffect.draw(canvas)) {
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
			postInvalidateOnAnimation();
		} else {
			postInvalidate();
		}
	}

	canvas.restoreToCount(restoreCount);
}
 
開發者ID:markusfisch,項目名稱:SwipeImageView,代碼行數:38,代碼來源:SwipeImageView.java

示例3: updateGlowSize

import android.support.v4.widget.EdgeEffectCompat; //導入方法依賴的package包/類
private static void updateGlowSize(RecyclerView rv, EdgeEffectCompat topGlow) {
    int width = rv.getMeasuredWidth();
    int height = rv.getMeasuredHeight();

    if (getClipToPadding(rv)) {
        width -= rv.getPaddingLeft() - rv.getPaddingRight();
        height -= rv.getPaddingTop() - rv.getPaddingBottom();
    }

    width = Math.max(0, width);
    height = Math.max(0, height);

    topGlow.setSize(width, height);
}
 
開發者ID:pczhu,項目名稱:android-advancedrecyclerview-master,代碼行數:15,代碼來源:EdgeEffectDecorator.java


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