Code example for Drawable

Methods: setColorFilter

0
    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
        int warningThreshold = mHw.getWarningThreshold();
        boolean shouldWarn = warningThreshold > 0 && progress >= (warningThreshold - mMin);
 
        if (mProgressDrawable != null) {
            mProgressDrawable.setColorFilter(shouldWarn ? mRedFilter : null);
        } 
        if (mProgressThumb != null) {
            mProgressThumb.setColorFilter(shouldWarn ? mRedFilter : null);
        } 
 
        mHw.setValue(progress + mMin);
        mValue.setText(String.format("%d%%", hwValueToPercent(progress + mMin)));
    } 
 
    @Override 
    public void onStartTrackingTouch(SeekBar seekBar) {
        // Do nothing here 
    } 
 
    @Override