ProgressBar Style/Theme Android - android

After modifying the theme for my Activity to display an ActionBar (ActionBarSherlock to be precise), my progress bar changed from:
to:
(Thin blue line). I need to be able to define the height of the progressbar, which I can't with the Holo theme. How can I specify a theme for my progress bar that's not the same as my activity or what's the other way to fix this?
Thanks!

As per i know, You are implementing Android inbuilt progressbar which appear the different in different devices and as per then android version.
If you want to implement the Same for all Devices then put make the custom progressbar. Which appear same for all.
Hope it will help you.
Enjoy.
:)

Related

How to add a custom title bar with an image as background in android studio

I have found several answers on here as to how to change the background color and add a custom icon to the title bar in android studio but am having difficulties finding an answer for how to use a custom image as the background instead of just a color in the title bar. Any help would be much appreciated. Thanks.
sadly you cannot add images as the background on both the header and textView/webView that's why you don't see any apps on android with image backgrounds. you could try using html instead of xml, like:
replace colors.xml, styles.xml, ect with colors.html, styles.html, ect
but i doubt that will work. hopefully they will add this feature later in the android sdk.

What l kind of progress dialog is this and how do I set it up

I have seen this progress bar in apps but I don't know what it's called.
How do I set it up and change it intermediate colors.
Maybe the Swipe-to-Refresh is the one you're referring to.
More info at http://developer.android.com/training/swipe/add-swipe-interface.html
If you only want to change the color of the spinner and not the background, you can try -
progressBar.getIndeterminateDrawable().setColorFilter(
getResources().getColor(R.color.blue),
android.graphics.PorterDuff.Mode.SRC_IN);
Otherwise, to change the background as well, you need to customize your progressbar for this.
The tutorial here may help you.

Change SherlockActionBar line color dynamically

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.

What style is used in gmail app for the indeterminate progressbar android

I am trying to find some hint as to what style is used for the indeterminate progressbar in gmail app for android. The one that's at the bottom right corner of the app. I've managed to change the item in action bar with setActionView... Now I can't find the exact style they used. Can anybody help me?
Thanks
Regards,
Parvaz Bhaskar
The style you're looking for is ?android:attr/progressBarStyle.
Surprisingly, other than ?android:attr/progressBarStyleLarge, it has a white background which is not indicated with the name difference.

Custom Title Bar Similar to this one

I want to create a custom title bar, somewhat like this, in my Android app. Please pardon if my question seems idiotic, I'm a beginner. Can anyone tell me if it is a titlebar or an Action bar? Plus how can I give this Shaded Black color to my titlebar/action bar?
PS: I'm using GingerBread on my Android. My app will require minimum SDK version to be 4 but it targets Jelly bean too. In GingerBread, I can't make use of ActionBars. Please help me with the problem. It would be highly appreciated.
You will want to use the ActionBarSherlock library for this (which will allow you to use this all the way back to SDK version 4).
It is reasonably easy to style, and is for sure the right way to do this. Lots of examples for this, as it is a very popular library.
http://actionbarsherlock.com/
If you are wanting to target min API 4, then as you state you'll be unable to use the ActionBar.
So you could just create your bar as a LinearLayout or something with whatever buttons / icons you want on it and have it at the top of all of your Activities. If you have many of them it would probably be worth it to refactor the Bar (click handlers and such) handling into a subclass of Activity, and then extend that with all of your other activities.
The visual effect could be easily achived with a 9-patch png set as the background of a LinearLayout. Just make the gradient you want in photoshop/Gimp and drop it into draw9Patch to add the pixels on the edge that will allow it to stretch nicely to fit any screen.
Edit: using actionbar sherlock as others suggested is probably a better idea than doing it "manually" as I suggested.

Categories

Resources