Setting Custum background at progress dialog - android

Is it possible to set a background in progress dialog?? I am not using xml files. I am creating and displaying it in andengine activity.

You can do this with the help of custom dialog instead of using progress dialog. Custom dialog will be a better approach to do this . Follow the link. You can also use
android:background="#android:color/transparent"
in the background property of the parent layout in order to make it transparent.
Hope this will solve your problem

Related

Default Alert dialog with different style

I want to use the default Alert dialog with a message an 2 buttons.
However, I want to style it differently. So the buttons text color and size, the title text color, size and background.
Do I need to create a custom dialog or is there a way I can change the default one without having to create a custom dialog?
Thank you
The easiest way to do this is to create a new layout xml file, for example dialog_layout.xml. Design your dialog just like you design any activity. Then, before you create the dialog with the builder, and after builder.create(getActivity()), callbuilder.setView(R.layout.dialog_layout) and it should look exactly the way you want it.
Here is a similar question that you can read through
EDIT: small correction

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.

Android custom ProgressBar with custom progress

Is that possible to have a custom ProgressBar in Android like this:
I mean:
Not spinning (static)
Progress with one color and remaining area with another color
With text in center
If that's not possible, what's the nearest result that I can have? Maybe using XML Shapes? Thanks!
There is not a standard Android component for reaching this result.
However, there is a library that you can use to achieve that effect.
Check this library.
You can customize this component as you like and use it on your xml layouts like a Custom View.
Check this library: https://github.com/wasabeef/awesome-android-ui/blob/master/pages/Progress.md. It does what you want.

How to color a portion of a view in android?

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.

How to customize ProgressDialog in android?

I need to customize the ProgressDialog, need to change message color, animated image and dialog-background color. Can anybody help me on this. I am new to android.
How to change the animated image displayed inside the ProgressDialog, where I need to made changes for this? I saw that such APIs are not there in ProgressDialog class.
Thanks & Regards.
Here is custom dialog example: http://www.mkyong.com/android/android-custom-dialog-example/ .
And here is progress bar example which you can add to custom dialog: http://mfarhan133.wordpress.com/2010/10/13/progress-bar-tutorial-for-android/

Categories

Resources