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
Related
I want to change the color of the bottomline of the sherlock actionbar.
But I want to change it dynamically.
When the user is offline I want it to appear red, when he is logging on I want it orange and when he is succesfully connected the line should be green.
How can I achieve this?
Thanks.
I found a solution in case anyone wants to do this.
I used this website to make 3 styles and took the 'ab_transparent' resource out of the zip.
To set the actionbar on runtime I used
getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_transparent_connecting));
Sidenote: this worked perfectly on android 4.0+ but on <4.0 I had to call
this.supportInvalidateOptionsMenu();
after setting the backgrounddrawable for it to take effect.
I want to change brightness in color
I implemented this...
Settings.System.putInt(context.getContentResolver(),android.provider.Settings.System.SCREEN_BRIGHTNESS, 200);
this will change my device's brightness in black&white mode.
like above images, I can change brightness but how can I give color?
Is there any other parameter which I don't know?
This can be accomplished using windows of type TYPE_SYSTEM_ALERT.
The idea is that even services can have a Window; so you can use a service, which makes a view and call WindowManager#addView() with a view and layout params. In your case, the view will just have a background color with an alpha value. You can experiment with different layout params to achieve the required effect.
This is also how facebook chat heads works. Check out this link to know more about the implementation details: http://www.piwai.info/chatheads-basics/ This will give you an idea on how to go about implementing this type of screen overlay.
I'm just wondering if the seekbar changed in Android 2.1 . 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 2.1? Thanks
You can use the setThumb() and setProgressDrawable() of SeekBar to customize the UI
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.
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.