本文整理汇总了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);
}