android:how to change alertDilog Box Design by Style or Theme? - android

Hi Friends
how to change alertDilog Box Design by Style or Theme?

Transparent AlertDialog : Set Transparent Window in AlertDialog box
You can look at Tutorial here :
http://androidgenuine.com/?tag=custom-alertdialog

Related

change the error message background color not text color customize TextInputLayout in android Kotlin

How to change the error message popup background color not text color customize TextInputLayout in android Kotlin
I want error design like this design
plz help me out for getting this solution. i am new to development android Kotlin.
For TextInputLayout there is a setBoxBackgroundColor function that accepts color(int) parameters. TextInputLayout.setBoxBackgroundColor((colorValue)) you can change your background color with this function.

Setting backgroundcolor in theme gives graphical buggy dialog

In my activity theme in the themes.xml I have set a background color in order to move away from the default (transparent/white?) background color to my own.
<item name="android:background">#color/red</item>
Unfortunately, when the I am showing my loading dialog the color shines halfway through that dialog now. Was this to be expected?
I have tried to use different themes, also defined by own dialog theme subclassing from Holo Light setting the background color explicitly to white, but the problem persists, only the currently still white areas are changed in this case.
What can I do? The only alternative is currently to use the Tradiotional Dialog Theme.
Try to set android:windowBackground instead. android:background attribute is applied to all nested views. Here is the discussion: What's the difference between windowBackground and background for activities style?
It looks like there's some padding or margins to the left and right of the title. If you're using the built-in ProgressDialog I'd suggest creating your own Dialog instead, that way you can change anything you want about it. Just create your own xml layout and create the dialog like this:
protected static Dialog getProgressDialog(Activity activity) {
Dialog dialog = new Dialog(activity);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
LayoutInflater inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View progressDialogView = inflater.inflate(R.layout.custom_progress_dialog, null);
dialog.setContentView(progressDialogView);
dialog.setCancelable(false);
return dialog;
}

Android - styling custom Dialog

I have a custom dialog in an xml layout.
How can I style it so it:
doesn't have a title
in other cases when I do want a title, change the color of the title divider line
has completely square edges instead of those slightly rounded corners that Android dialogs have by default
android customising style link
There is style folder inside res folder. Please take look over it. it basically xml file which has resource tags where you can configure you custom styling. And refer the same styling from style attribute in xml.

Android Custom Dialog Textview and Background Color

I have a custom DialogPreference Dialog that has its layout set out in a relativelayout that contains the following:
Checkbox
Textview
Text Field
This is fine in Android 4.0+, because the theme we are using is Theme.Light so the background color of the dialog is white and the default text is black for the Checkbox label and textview. However, in 2.3.3, the background color is dark grey so it becomes hard to see the text... the theme is still Theme.Light however.
I thought that making a custom dialog would be necessary for this because the checkbox enable/disables the text field. At the moment, I'm making the background color of the relativelayout for this Dialog white... but I don't really like this solution as there maybe cases where some other phones on 2.3.3 may not have white as the default dialog background...
Is there a cleaner way to fix this problem?
I notice this person has the same problem: Custom Support Dialog Fragment text is the wrong color
Another with the problem :Android: Issue with showing dialog from Theme.Light activity
EDIT: Attached screenshot. This is what it looks like on LG Optimus 2X running 2.3.3. On my co-worker's samsung galaxy which runs 2.3.3 also, the background is even darker so you can hardly see the text.
You could make custom dialog theme in style files , such as:
less than API 11:
<style name="MyDialogTheme" parent="android:Theme.Light" >
API 11 and forward:
<style name="MyDialogTheme" parent="android:Theme.Holo.Dialog" >
then use "MyDialogTheme" in your Fragment dialog:
... ...
ContextThemeWrapper context = new ContextThemeWrapper(getActivity(), R.style.MyDialogTheme);
AlertDialog.Builder builder = new AlertDialog.Builder(context);
... ...
hope this help.

Android ICS Dialog Title Color

I want to use a custom color for the Dialog in ICS-Devices. The default one is blue (see image), how can I set this to a color that fits my app color scheme, e.g. red ?
Try this:
alert.setTitle(Html.fromHtml("<font color='#FF0000'>User Agent</font>"));
You can try this:
AlertDialog alert = builder.create();
alert.show();
alert.getListView().setBackgroundColor(Color.RED); //This is for Color
alert.setCancelable(true);

Categories

Resources