private void clickBarOff(FrameLayout frameLayout) {
pins.get((int) frameLayout.getTag()).setVisibility(View.INVISIBLE);
isOldBarClicked = false;
int childCount = frameLayout.getChildCount();
for (int i = 0; i < childCount; i++) {
View childView = frameLayout.getChildAt(i);
if (childView instanceof LinearLayout) {
LinearLayout linearLayout = (LinearLayout) childView;
Bar bar = (Bar) linearLayout.getChildAt(0);
TextView titleTxtView = (TextView) linearLayout.getChildAt(1);
LayerDrawable layerDrawable = (LayerDrawable) bar.getProgressDrawable();
layerDrawable.mutate();
ScaleDrawable scaleDrawable = (ScaleDrawable) layerDrawable.getDrawable(1);
GradientDrawable progressLayer = (GradientDrawable) scaleDrawable.getDrawable();
if (progressLayer != null) {
progressLayer.setColor(ContextCompat.getColor(mContext, mProgressColor));
}
titleTxtView.setTextColor(ContextCompat.getColor(mContext, mBarTitleColor));
}
}
}
ChartProgressBar.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:ChartProgressBar-Android
作者:
评论列表
文章目录