Change android seekbar value without clicking direclty on the seekbar thumb - android

I have an android seekbar that appears on the screen when a user touches a button.
How can I start tracking user touch to move the seekbar immediately after it appears?
To be more clear, essentially I want the user to be able to move the seekbar thumb/progress without clicking directly on it.

Seekbar extends ProgressBar, so just call setProgress on your SeekBar to update it.
See this for reference.

Related

Seekbar progress isn't destroyed when activity is rotated

I place a discrete seekbar in my layout. When I run my code in the emulator and rotate the screen, the activity gets destroyed, but for some reason the seekbar progress stays the same. Why does this happen, shouldn't the progress be reset?
Built-in Android View widgets such as TextView, EditText and SeekBar have their state automatically saved and restored when the device configuration changes (in your case, when you rotate the screen), provided they have an id.
That's why your SeekBar's progress is not reset when the screen is rotated.
If you'd like to disable this behavior, you can add android:saveEnabled="false" to your view definition in XML.

How to get a seekbar after clicking button

I made an application on paint. I want to control the size of brush being used in paint using seek-bar.
In the menu(options) ,I have an option of changing brush size. So, by clicking on it, a seek bar should appear and I should be able to control that using save button (to set) and then use that value inside paint.
How do I do that?
Make seekbar visible inside xml or when you get its reference in onCreate method.
on button click make it visible.
Use latest values by registering OnSeekBarChangeListener on your Seekbar.

How to show Activity overlaying on another Activity?

I want to show a volume bar (SeekBar) when a speaker button is pressed. Changing the whole Activity just for a SeekBar might not be a good decision.
I think overlaying that SeekBar would be the best solution. (But how?)
How would you solve this problem?
You could use your own customized dialog and automatically dismiss it if the user hasn't touched the screen after a short while, but I would like to ask exactly why you need it.
The reason: not all Android devices even have volume buttons.
If you wish, you can easily just set the volume control to be MEDIA instead of the ringtone volume, so that if the user accesses the volume , it will show the control of the MEDIA . Here's how you do it:
setVolumeControlStream(AudioManager.STREAM_MUSIC);
I think you should use a custom Dialog with a SeekBar set as content.
As a side note, remember to get rid of the title requesting the right feature to your window:
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);

Android:appear and disappear seek bar

How i can appear and disappear a seekbar?
I want, when the activity starts seekbar will be dissapeared but when user put his/her finger on the place where is the seekbar, the seekbar appears and user can to interactive with it, and when he finished seekbar disappears again.
Sorry about my bad english!!
Seek bar is the part of the view class in android . so u can do
seekbarObj.setVisibility(View.VISIBLE)//for the visible seekbar
seekbarObj.setVisibility(View.GONE) // for the disappear it

how to create Equalizer Button in Android?

I am new to android i wish to create a button like a Equalizer Button. At the time of track the button i need to do some work.Can any one help me
I think you're looking for the SeekBar. That's a View derived from the ProgressBar, but with a "thumb" so it looks like a slider control. A user can use the thumb to move left or right from min to max. You don't have to use it like a progress bar to track the progress of something, and can receive notifications that the user is touching and moving the thumb using a SeekBar.OnSeekBarChangeListener.

Categories

Resources