24
24
import android .graphics .Color ;
25
25
import android .graphics .drawable .GradientDrawable ;
26
26
import android .os .Build ;
27
+ import android .support .annotation .ColorInt ;
28
+ import android .support .annotation .ColorRes ;
27
29
import android .support .v4 .content .ContextCompat ;
28
30
import android .support .v4 .view .ViewCompat ;
29
31
import android .support .v4 .widget .SwipeRefreshLayout ;
@@ -374,7 +376,7 @@ public T setHandleColour(String colour){
374
376
* Provides the ability to programmatically set the colour of the scrollbar handle.
375
377
* @param colour to set the handle.
376
378
*/
377
- public T setHandleColour (int colour ){
379
+ public T setHandleColour (@ ColorInt int colour ){
378
380
handleColour = colour ;
379
381
setHandleColour ();
380
382
return (T )this ;
@@ -384,7 +386,7 @@ public T setHandleColour(int colour){
384
386
* Provides the ability to programmatically set the colour of the scrollbar handle.
385
387
* @param colourResId to set the handle.
386
388
*/
387
- public T setHandleColourRes (int colourResId ){
389
+ public T setHandleColourRes (@ ColorRes int colourResId ){
388
390
handleColour = ContextCompat .getColor (getContext (), colourResId );
389
391
setHandleColour ();
390
392
return (T )this ;
@@ -415,7 +417,7 @@ public T setHandleOffColour(String colour){
415
417
* Provides the ability to programmatically set the colour of the scrollbar handle when unpressed. Only applies if lightOnTouch is true.
416
418
* @param colour to set the handle when unpressed.
417
419
*/
418
- public T setHandleOffColour (int colour ){
420
+ public T setHandleOffColour (@ ColorInt int colour ){
419
421
handleOffColour = colour ;
420
422
if (lightOnTouch ){
421
423
handle .setBackgroundColor (handleOffColour );
@@ -427,7 +429,7 @@ public T setHandleOffColour(int colour){
427
429
* Provides the ability to programmatically set the colour of the scrollbar handle when unpressed. Only applies if lightOnTouch is true.
428
430
* @param colourResId to set the handle when unpressed.
429
431
*/
430
- public T setHandleOffColourRes (int colourResId ){
432
+ public T setHandleOffColourRes (@ ColorRes int colourResId ){
431
433
handleOffColour = ContextCompat .getColor (getContext (), colourResId );
432
434
if (lightOnTouch ){
433
435
handle .setBackgroundColor (handleOffColour );
@@ -448,7 +450,7 @@ public T setBarColour(String colour){
448
450
* Provides the ability to programmatically set the colour of the scrollbar.
449
451
* @param colour to set the bar.
450
452
*/
451
- public T setBarColour (int colour ){
453
+ public T setBarColour (@ ColorInt int colour ){
452
454
background .setBackgroundColor (colour );
453
455
return (T )this ;
454
456
}
@@ -457,7 +459,7 @@ public T setBarColour(int colour){
457
459
* Provides the ability to programmatically set the colour of the scrollbar.
458
460
* @param colourResId to set the bar.
459
461
*/
460
- public T setBarColourRes (int colourResId ){
462
+ public T setBarColourRes (@ ColorRes int colourResId ){
461
463
background .setBackgroundColor (ContextCompat .getColor (getContext (), colourResId ));
462
464
return (T )this ;
463
465
}
@@ -466,7 +468,7 @@ public T setBarColourRes(int colourResId){
466
468
* Provides the ability to programmatically set the text colour of the indicator. Will do nothing if there is no section indicator.
467
469
* @param colour to set the text of the indicator.
468
470
*/
469
- public T setTextColour (int colour ){
471
+ public T setTextColour (@ ColorInt int colour ){
470
472
textColour = colour ;
471
473
if (indicator != null ){
472
474
indicator .setTextColour (textColour );
@@ -479,7 +481,7 @@ public T setTextColour(int colour){
479
481
* Provides the ability to programmatically set the text colour of the indicator. Will do nothing if there is no section indicator.
480
482
* @param colourResId to set the text of the indicator.
481
483
*/
482
- public T setTextColourRes (int colourResId ){
484
+ public T setTextColourRes (@ ColorRes int colourResId ){
483
485
textColour = ContextCompat .getColor (getContext (), colourResId );
484
486
if (indicator != null ){
485
487
indicator .setTextColour (textColour );
0 commit comments