|
26 | 26 |
|
27 | 27 | import androidx.annotation.NonNull; |
28 | 28 | import androidx.annotation.Nullable; |
29 | | -import androidx.appcompat.content.res.AppCompatResources; |
30 | 29 | import androidx.core.util.Consumer; |
31 | 30 | import androidx.core.widget.NestedScrollView; |
32 | 31 | import androidx.recyclerview.widget.RecyclerView; |
@@ -117,17 +116,21 @@ public FastScrollerBuilder setPopupStyle(@NonNull Consumer<TextView> popupStyle) |
117 | 116 | @NonNull |
118 | 117 | public FastScrollerBuilder useDefaultStyle() { |
119 | 118 | Context context = mView.getContext(); |
120 | | - mTrackDrawable = AppCompatResources.getDrawable(context, R.drawable.afs_track); |
121 | | - mThumbDrawable = AppCompatResources.getDrawable(context, R.drawable.afs_thumb); |
| 119 | + mTrackDrawable = Utils.getGradientDrawableWithTintAttr(R.drawable.afs_track, |
| 120 | + R.attr.colorControlNormal, context); |
| 121 | + mThumbDrawable = Utils.getGradientDrawableWithTintAttr(R.drawable.afs_thumb, |
| 122 | + R.attr.colorControlActivated, context); |
122 | 123 | mPopupStyle = PopupStyles.DEFAULT; |
123 | 124 | return this; |
124 | 125 | } |
125 | 126 |
|
126 | 127 | @NonNull |
127 | 128 | public FastScrollerBuilder useMd2Style() { |
128 | 129 | Context context = mView.getContext(); |
129 | | - mTrackDrawable = AppCompatResources.getDrawable(context, R.drawable.afs_md2_track); |
130 | | - mThumbDrawable = AppCompatResources.getDrawable(context, R.drawable.afs_md2_thumb); |
| 130 | + mTrackDrawable = Utils.getGradientDrawableWithTintAttr(R.drawable.afs_md2_track, |
| 131 | + R.attr.colorControlNormal, context); |
| 132 | + mThumbDrawable = Utils.getGradientDrawableWithTintAttr(R.drawable.afs_md2_thumb, |
| 133 | + R.attr.colorControlActivated, context); |
131 | 134 | mPopupStyle = PopupStyles.MD2; |
132 | 135 | return this; |
133 | 136 | } |
|
0 commit comments