@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { updateText(view, nameText + bar.getProgress() + " (" + units + ")"); if (progress < bar.getLower() || progress > bar.getHigher()) { view.setTextColor(context.getResources().getColor(R.color.purple)); } else { view.setTextColor(context.getResources().getColor(R.color.pink)); } }
public SeekBarListener( BarWrapper bar, TextView view, String nameText, String units, Context context) { this.bar = bar; this.view = view; this.nameText = nameText; this.units = units; this.context = context; updateText(view, nameText + bar.getProgress() + " (" + units + ")"); }