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

SeekBar and media player in android

To create a ‘connection’ between SeekBar and MediaPlayer you need first to get your current recording max duration and set it to your seek bar. mSeekBar.setMax(mFileDuration/1000); // where mFileDuration is mMediaPlayer.getDuration(); After you initialise your MediaPlayer and for example press play button, you should create handler and post runnable so you can update your SeekBar … 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