@@ -98,9 +98,9 @@ abstract class MaterialScrollBar<T> extends RelativeLayout {
98
98
programmatic = false ;
99
99
addView (setUpBackground (context ));
100
100
setUpProps (context , attributeSet );
101
- addView (setUpHandle (context , a .getBoolean (R .styleable .MaterialScrollBar_lightOnTouch , true )));
101
+ addView (setUpHandle (context , a .getBoolean (R .styleable .MaterialScrollBar_msb_lightOnTouch , true )));
102
102
if (!isInEditMode ()){
103
- seekId = a .getResourceId (R .styleable .MaterialScrollBar_recyclerView , 0 );
103
+ seekId = a .getResourceId (R .styleable .MaterialScrollBar_msb_recyclerView , 0 );
104
104
}
105
105
implementPreferences ();
106
106
a .recycle ();
@@ -133,11 +133,11 @@ void setUpProps(Context context, AttributeSet attrs){
133
133
0 , 0 );
134
134
ArrayList <String > missing = new ArrayList <>();
135
135
//Ensures that a recyclerView is associated with the bar.
136
- if (!a .hasValue (R .styleable .MaterialScrollBar_recyclerView )){
136
+ if (!a .hasValue (R .styleable .MaterialScrollBar_msb_recyclerView )){
137
137
missing .add ("recyclerView" );
138
138
}
139
139
//Ensures that a preference is expressed for lightOnTouch.
140
- if (!a .hasValue (R .styleable .MaterialScrollBar_lightOnTouch )){
140
+ if (!a .hasValue (R .styleable .MaterialScrollBar_msb_lightOnTouch )){
141
141
missing .add ("lightOnTouch" );
142
142
}
143
143
if (missing .size () != 0 ){
@@ -182,20 +182,20 @@ Handle setUpHandle(Context context, Boolean lightOnTouch){
182
182
183
183
//XML case only. Implements optional attributes.
184
184
void implementPreferences (){
185
- if (a .hasValue (R .styleable .MaterialScrollBar_barColour )){
186
- setBarColour (a .getColor (R .styleable .MaterialScrollBar_barColour , 0 ));
185
+ if (a .hasValue (R .styleable .MaterialScrollBar_msb_barColour )){
186
+ setBarColour (a .getColor (R .styleable .MaterialScrollBar_msb_barColour , 0 ));
187
187
}
188
- if (a .hasValue (R .styleable .MaterialScrollBar_handleColour )){
189
- setHandleColour (a .getColor (R .styleable .MaterialScrollBar_handleColour , 0 ));
188
+ if (a .hasValue (R .styleable .MaterialScrollBar_msb_handleColour )){
189
+ setHandleColour (a .getColor (R .styleable .MaterialScrollBar_msb_handleColour , 0 ));
190
190
}
191
- if (a .hasValue (R .styleable .MaterialScrollBar_handleOffColour )){
192
- setHandleOffColour (a .getColor (R .styleable .MaterialScrollBar_handleOffColour , 0 ));
191
+ if (a .hasValue (R .styleable .MaterialScrollBar_msb_handleOffColour )){
192
+ setHandleOffColour (a .getColor (R .styleable .MaterialScrollBar_msb_handleOffColour , 0 ));
193
193
}
194
- if (a .hasValue (R .styleable .MaterialScrollBar_textColour )){
195
- setTextColour (a .getColor (R .styleable .MaterialScrollBar_textColour , 0 ));
194
+ if (a .hasValue (R .styleable .MaterialScrollBar_msb_textColour )){
195
+ setTextColour (a .getColor (R .styleable .MaterialScrollBar_msb_textColour , 0 ));
196
196
}
197
- if (a .hasValue (R .styleable .MaterialScrollBar_barThickness )){
198
- setBarThickness (a .getInteger (R .styleable .MaterialScrollBar_barThickness , 0 ));
197
+ if (a .hasValue (R .styleable .MaterialScrollBar_msb_barThickness )){
198
+ setBarThickness (a .getDimensionPixelSize (R .styleable .MaterialScrollBar_msb_barThickness , 0 ));
199
199
}
200
200
implementFlavourPreferences (a );
201
201
}
@@ -541,7 +541,6 @@ public void onLayoutChange(View v, int left, int top, int right, int bottom, int
541
541
* @param thickness The desired bar thickness.
542
542
*/
543
543
public T setBarThickness (int thickness ){
544
- thickness = Utils .getDP (thickness , this );
545
544
LayoutParams layoutParams = (LayoutParams ) handle .getLayoutParams ();
546
545
layoutParams .width = thickness ;
547
546
handle .setLayoutParams (layoutParams );
0 commit comments