/**
* Returns {@code true} if the target drawable needs to be tileified.
* <p/>
* Note: Copied from android.widget.ProgressBar
*
* @param dr the drawable to check
* @return {@code true} if the target drawable needs to be tileified,
* {@code false} otherwise
*/
private static boolean needsTileify(Drawable dr) {
if (dr instanceof LayerDrawable) {
final LayerDrawable orig = (LayerDrawable) dr;
final int N = orig.getNumberOfLayers();
for (int i = 0; i < N; i++) {
if (needsTileify(orig.getDrawable(i))) {
return true;
}
}
return false;
}
// If there's a bitmap that's not wrapped with a ClipDrawable or
// ScaleDrawable, we'll need to wrap it and apply tiling.
return dr instanceof BitmapDrawable || dr instanceof VectorDrawable;
}
RatingBar.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:RateTheApp-Android
作者:
评论列表
文章目录