/**
* Wraps the given <var>drawable</var> into instance of {@link ScaleDrawable} if it is valid
* and not ScaleDrawable yet.
*
* @param drawable The drawable to wrap and make scaleable.
* @param gravity The gravity determining a pivot along which can be the given drawable scaled.
* @return Instance of ScaleDrawable with the specified drawable wrapped or {@code null}
* if the given drawable was also {@code null}.
*/
static Drawable makeDrawableScaleable(Drawable drawable, int gravity) {
if (drawable == null || drawable instanceof ScaleDrawable) return drawable;
final ScaleDrawable scaleDrawable = new ScaleDrawable(drawable, gravity, 1f, 1f);
scaleDrawable.setLevel(MAX_LEVEL);
return scaleDrawable;
}
SeekBarWidget.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:android_ui
作者:
评论列表
文章目录