/** * Set the damping effect. * 显示拖动高度/真实拖动高度 比率(默认0.5,阻尼效果) * @param rate ratio = (The drag height of the view)/(The actual drag height of the finger) * 比率 = 视图拖动高度 / 手指拖动高度 * @return RefreshLayout */ RefreshLayout setDragRate(@FloatRange(from = 0,to = 1) float rate);
/** * Set the ratio at which the load more is triggered. * 设置 触发加载距离 与 FooterHeight 的比率 * @param rate 触发加载距离 与 FooterHeight 的比率 * @return RefreshLayout */ RefreshLayout setFooterTriggerRate(@FloatRange(from = 0,to = 1.0) float rate);
/** * Set the ratio of the maximum height to drag header. * 设置下拉最大高度和Header高度的比率(将会影响可以下拉的最大高度) * @param rate ratio = (the maximum height to drag header)/(the height of header) * 比率 = 下拉最大高度 / Header的高度 * @return RefreshLayout */ RefreshLayout setHeaderMaxDragRate(@FloatRange(from = 1,to = 10) float rate);
/** * Set the ratio of the maximum height to drag footer. * 设置上拉最大高度和Footer高度的比率(将会影响可以上拉的最大高度) * @param rate ratio = (the maximum height to drag footer)/(the height of footer) * 比率 = 下拉最大高度 / Footer的高度 * @return RefreshLayout */ RefreshLayout setFooterMaxDragRate(@FloatRange(from = 1,to = 10) float rate);
/** * Set the ratio at which the refresh is triggered. * 设置 触发刷新距离 与 HeaderHeight 的比率 * @param rate 触发刷新距离 与 HeaderHeight 的比率 * @return RefreshLayout */ RefreshLayout setHeaderTriggerRate(@FloatRange(from = 0,to = 1.0) float rate);
public static int mixtureColor(int color, @FloatRange(from = 0.0, to = 1.0) float alpha) { int a = (color & 0xff000000) == 0 ? 0xff : color >>> 24; return (color & 0x00ffffff) | (((int) (a * alpha)) << 24); }
/** * 设置每列的宽度比例,将屏幕分为两列,每列范围为0.0~1.0,如0.5表示占宽度的一半。 */ public void setColumnWeight(@FloatRange(from = 0, to = 1) float firstColumnWeight, @FloatRange(from = 0, to = 1) float secondColumnWeight) { this.firstColumnWeight = firstColumnWeight; this.secondColumnWeight = secondColumnWeight; this.thirdColumnWeight = 0; }
/** * 可用于设置每项的高度,范围为2-4 */ public final void setLineSpaceMultiplier(@FloatRange(from = 2, to = 4) float multiplier) { lineSpaceMultiplier = multiplier; }
/** * 线比例,范围为0-1,0表示最长,1表示最短 */ public DividerConfig setRatio(@FloatRange(from = 0, to = 1) float ratio) { this.ratio = ratio; return this; }
/** * 设置每列的宽度比例,将屏幕分为三列,每列范围为0.0~1.0,如0.3333表示约占宽度的三分之一。 */ public void setColumnWeight(@FloatRange(from = 0, to = 1) float firstColumnWeight, @FloatRange(from = 0, to = 1) float secondColumnWeight, @FloatRange(from = 0, to = 1) float thirdColumnWeight) { this.firstColumnWeight = firstColumnWeight; this.secondColumnWeight = secondColumnWeight; this.thirdColumnWeight = thirdColumnWeight; }
public DividerConfig(@FloatRange(from = 0, to = 1) float ratio) { this.ratio = ratio; }
/** * * @param context Context * @param radius The blur's radius. */ public BlurTransformation(Context context, @FloatRange(from = 0.0f) float radius) { this(context, radius, Color.TRANSPARENT); }
public void setAlpha(@FloatRange(from = 0.0, to = 1.0) final float alpha) { mAlpha = alpha; if(mAlpha>1) mAlpha=1; if(mAlpha<0) mAlpha=0; } }
public void setScreenMappingRatio(@FloatRange(from = -1, to = 1) float ratio) { if (ratio > 1) ratio = 1; if (ratio < -1) ratio = -1; mScreenMapping = ratio; }
@Override public void translate(View view, @FloatRange(from = 0, to = 1.0) float percentage) { } }
/** * 设置触发释放后自动滑动返回的阈值 * * @param threshold 触发释放后自动滑动返回的阈值 */ void setSwipeBackThreshold(@FloatRange(from = 0.0f, to = 1.0f) float threshold) { mSwipeBackThreshold = threshold; }
public CropIwaImageViewConfig setMaxScale(@FloatRange(from = 0.001) float maxScale) { this.maxScale = maxScale; return this; }
public CropIwaImageViewConfig setMinScale(@FloatRange(from = 0.001) float minScale) { this.minScale = minScale; return this; }
public CropIwaImageViewConfig setScale(@FloatRange(from = 0.01, to = 1f) float scale) { this.scale = scale; return this; }
@FloatRange(from = -1, to = 1) public float getScreenMappingRatio() { return mScreenMapping; }