fun customProgressBar(accentColor:Int) {
var progressDrawable = context.resources.getDrawable(R.drawable.lib_video_preview_progress_bg) as LayerDrawable
progressDrawable.colorFilter = PorterDuffColorFilter(accentColor, PorterDuff.Mode.SRC_IN)
mProgress.progressDrawable = progressDrawable
var thumb = ContextCompat.getDrawable(context, R.drawable.lib_video_preview_seek_bar_thumb)
thumb?.colorFilter = PorterDuffColorFilter(accentColor, PorterDuff.Mode.SRC_IN)
(mProgress as SeekBar).thumb = thumb
}
给seekbar换颜色
最新推荐文章于 2024-08-25 03:12:12 发布