I want to make a seekbar like the one in the figure for a music player project I'm working on.
Searched everywhere could not find anything helpful, any help will be appreciated
I think it would be easier to implement with ProgressBar with a horizontal style and not SeekBar. I think the most simple way to implement it is to set the android:progressDrawable xml attribute with a drawable of the pattern above (white background and the bars - invisible).
Related
I am wondering if there is a way to create a Seekbar (slider) widget for an app. I know how to create a Seekbar in my app activity but how can I change this Seekbar-value with a widget? I tried to find some information about it in the internet but I couldn't find anything. So I don't know if it is even possible to create Seekbar widgets...
In advance thanks for your answer!
If by "widgets" you mean app widgets, SeekBar is not one of the supported views that you can use in an app widget.
you can use a Progressbar with custom style to show a progress value in your widget.
I know it is possible to change the style of the SeekBar in android apps, but is it possible to change the shape of the progress line of a SeekBar?
I would like it to be like that:
Any ideas on how to achieve this? :)
Similar to this question here How to make custom seek bar in android?
You're not going to be able to do that with the default slider. You're going to have create a custom view. Here's some resources to get you started.
http://www.mokasocial.com/2011/02/create-a-custom-styled-ui-slider-seekbar-in-android/
http://developer.android.com/training/custom-views/create-view.html
Edited to add this other resource the may help you get the curves you want
Give a semi-circular shape to seekbar
I am having troubles with a seek bar, i am trying to create an audio settings fragment but when i customize my seekbar thumb i noticed that the progress does not start and end in where i would like to.
I tried lot of things but i cannot find the solution.
I would also like to add white lines in the background like from 1 to 10.
Thanks for the help
seems like this simple line fixed the thing:
android:thumbOffset="5dp"
Thanks anyway and hope this can help someone.
Now I have this task where I should create a rating bar just like youtube in my app , and so my idea was to have a textview where I set its background to a color but then remove the color according to an equation I will make so it displays only a percentage of it... any idea how can I do this or where to look ?
The simplest way to do this would be to create a selector.xml. You would assign android:background="#drawable/selector". Your selector would decide which background color to show based on what percentage you have assigned.
This link explains how to use selectors with buttons. It should help to get you on the right track...http://developer.android.com/guide/topics/resources/color-list-resource.html
EDIT: You can still accomplish a custom progress bar by xml. It is very similar to the selector. Just think of it as many more selectors based on progress instead of state. Here is a nice example...Custom Drawable for ProgressBar/ProgressDialog
You can also look into xml animations. They are similar.
Is there anyway to implement something like a trackbar on android, so I can explicity specify the values and select it?
Well i recall there were some tutorials on how to add one to a preference activity, so it is certanly possible, other than that there is the seekbar component in the sdk. you can even drag it in layout with the GUI tool.
if you have seen the media player controls and other similar things that can be added that is also a possibility although i don't know if those can be modified.
see this for customizing the seek Bar:
seekBar
also this thing about vertical seekbar can be helpfull:
Vertical seekBar
What you are you looking for is the SeekBar
http://developer.android.com/reference/android/widget/SeekBar.html