本文整理匯總了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);
}
示例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);
}