Android Progress Bar style - android

I am doing application for multimedia. At present i am concentrating on volume control. Is there any possibilities to change the style of progress bar into volume control. (IE) it should be looks like VLC volume control. pls guide me.

I don't exactly know what you want..
If you want a custom look of your ProgressBar need a custom progressDrawable.
<ProgressBar
...
android:progressDrawable="#drawable/progressbar_drawable" />
The easiest way would be to modify the original drawable in your SDK path (look for progressbar_horizontal.xml).

I don't think so. The volume control is a system app, so it's not part of your app. Maybe you could intercept the "volume up" button, but I'm not sure this is possible.

Related

Need to make custom seekbar for music player

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).

i want to set seekbar setSplitTrack under lollipop

i want to setSplitTrack(true) under lollipop, but i can't.
i tried set thumb's padding or margin, but it was not working.
I guess, android seekbar has stack structure, so it through all background.
thanks.
The Material seek bar has split track enabled by default. You need to turn it off.
This link might help you : https://stackoverflow.com/a/27000942/5816000

Disabled Android Button Dimmed

I am creating my first Android App that will be making profit, selling it to a company. I am not very advanced yet in Android App Development.
I have two buttons. I have been able to detect when the bottom of a ScrollView has been reached. Once that happens, one of the buttons becomes clickable, Button.setClickable(true);
When the button is not clickable, I would like it dimmed.
Here is an example from another application I wrote of what I mean. It is written in Java, but it is not an Android App.
Many buttons and other components there are disabled until the one with the diamond (turns on scanning) is toggled on. Those disabled components have a dim look to them. I would like to know how to accomplish the same for Android. I have searched Google but not found anything relevant yet.
P.S. If you would like to know more about the software in that picture I created. It is open source and you can check it out here.
https://github.com/BullShark/JSpeak
Similar answer to Anup Cowkur, but I believe it's cleaner and a better practice to define a single drawable with different states.
dimmable_button.xml (put in your res/drawables folder)
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item state_enabled="true"
android:drawable="#drawable/clickable_image" />
<item state_enabled="false"
android:drawable="#drawable/dimmed_image" />
</selector>
Then, the layout file where your button is defined:
<button
....
android:background="#drawable/dimmable_button" />
Now, when you do button.setEnabled(bool) the button's background will change automatically to a dimmed one.
Simply make another image with whatever look you want and change the background of the image to it when it is not clickable.
When it is dimmed out:
button.setBackgroundResource(R.drawable.dim_image);
When it becomes clickable again:
button.setBackgroundResource(R.drawable.clickable_image);
Did you tried
myButton.setEnabled(false);?
or
android:clickable can be used via xml

How to implement a trackbar

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

Change in seek bar in Android 3.0

I'm just wondering if the seekbar changed in Android 3.0 . I tried to create one but it showing up as a green line with a circle on it instead of the usual yellow rectangle. If so, is there any other option to create a similar seekbar to control volume on 3.0? Thanks guys.
I'm just wondering if the seekbar changed in Android 3.0 .
More accurately, it changed with the "holographic" theme that is the standard for Android 3.0 (and, presumably, beyond).
I tried to create one but it showing up as a green line with a circle on it instead of the usual yellow rectangle.
Correct. That is what your users will expect to see.
If so, is there any other option to create a similar seekbar to control volume on 3.0?
I would recommend that you leave it alone. The objective should be to give the user what they are familiar with. If most other applications with seek bars -- and the OS itself -- are using the new seek bar style, ideally you will too.
Note that the new style only takes effect if you are adopting the holographic theme (e.g., android:targetSdkVersion="11"), which means you are buying into the entire new Honeycomb look and feel (action bar, change to the way a Spinner looks, etc.).
You are welcome to use your own style and substitute in your own graphics, using the styleable portions of ProgressBar and SeekBar (SeekBar inherits from ProgressBar), or in your XML layouts (e.g., android:thumb), or via Java code.

Categories

Resources