Changing step values in seekbar?

Try below code SeekBar seekBar = (SeekBar)layout.findViewById(R.id.seekbar); seekBar.setProgress(0); seekBar.incrementProgressBy(10); seekBar.setMax(200); TextView seekBarValue = (TextView)layout.findViewById(R.id.seekbarvalue); seekBarValue.setText(tvRadius.getText().toString().trim()); seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){ @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { progress = progress / 10; progress = progress * 10; seekBarValue.setText(String.valueOf(progress)); } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onStopTrackingTouch(SeekBar seekBar) { } }); setProgress(int) … Read more

Custom seekbar (thumb size, color and background)

All done in XML (no .png images). The clever bit is border_shadow.xml. All about the vectors these days… Screenshot: This is your SeekBar (res/layout/???.xml): SeekBar <SeekBar android:id=”@+id/seekBar_luminosite” android:layout_width=”300dp” android:layout_height=”wrap_content” android:progress=”@integer/luminosite_defaut” android:progressDrawable=”@drawable/seekbar_style” android:thumb=”@drawable/custom_thumb”/> Let’s make it stylish (so you can easily customize it later): style res/drawable/seekbar_style.xml: <?xml version=”1.0″ encoding=”utf-8″?> <layer-list xmlns:android=”http://schemas.android.com/apk/res/android” > <item android:id=”@android:id/background” android:drawable=”@drawable/border_shadow” > … Read more

Android – styling seek bar

I would extract drawables and xml from Android source code and change its color to red. Here is example how I completed this for mdpi drawables: Custom red_scrubber_control.xml (add to res/drawable): <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:drawable=”@drawable/red_scrubber_control_disabled_holo” android:state_enabled=”false”/> <item android:drawable=”@drawable/red_scrubber_control_pressed_holo” android:state_pressed=”true”/> <item android:drawable=”@drawable/red_scrubber_control_focused_holo” android:state_selected=”true”/> <item android:drawable=”@drawable/red_scrubber_control_normal_holo”/> </selector> Custom: red_scrubber_progress.xml <layer-list xmlns:android=”http://schemas.android.com/apk/res/android” > <item android:id=”@android:id/background” android:drawable=”@drawable/red_scrubber_track_holo_light”/> <item android:id=”@android:id/secondaryProgress”> … Read more