Android change Alert Dialog underlay height - android

I've got an AlertDialog and I would like to change the height of the underlaying background, not the dialog itself. Haven't been able to find any source online showing if this is possible or which attributes in the alert dialog theme to manipulate. The only attribute that seems to change anything with the underlaying background is dimAmount. Here is what I have:
Here's what I would like to have:
As you can see the action bar and bottom navigation buttons are no longer being covered by the AlertDialog underlay.

Related

Material Date Picker Custom Styling in white style

I want to implement a white theme, mean that toolbar and status bar should be in white also bottom sheet etc.
i implement theme correctly and it worksMaterialDatePicker dialog i try many solutions here to customize theme for dialog and it never work form
as you can see in the image the buttons for dialog doesn't appear

How dialog create dividers between action buttons

I have a problem while trying to create a dialog with custom actions button. To create a divider between actions, currently, I added one view as a divider as image below, but when inspecting layout of system alert dialog, they don't do like that. I tried to find the source code of AlertDialog but haven't found the way they created a divider.
So, I hope someone can show me the way to create gray dividers between actions button like the system does.
Thank you so much,

Is it possible to style AlertDialog independently of activity's theme?

I realize the question is kind of weird, but I want to stop using deprecated options menu and switch to action bar. Unfortunately, to do that I must use Holo theme, which comes with a different AlertDialog design that was before.
This new design breaks my UI appearance. Is it possible to create an old-styled dialog in a Holo-styled activity?
Arelated question: is there any thing other than AlertDialog that is a pop-up window capable of showing my own layout, and that doesn't have borders and other theme-defined stuff around my custom layout?
Depending on the minSDKVersion set in your AndroidManifest file you can choose a theme for your dialog. You can set them to Holo / Device Default but to do that your minSdk value should be 10+ even I think that to use DeviceDefault it should be JellyBean.
If you want to create your own layout and use it without any borders and etc which will break your design you should use Dialog instead of AlertDialog and customize it. You can do something like this :
final Dialog alert = new Dialog(FingerPaintActivity.this, android.R.style.Theme_Light_Panel);
alert.requestWindowFeature(Window.FEATURE_NO_TITLE); // no title
alert.getWindow().getAttributes().windowAnimations = R.style.PauseDialogAnimation; // this is used for custom animation when dialog is showing and hiding
alert.setContentView(getLayoutInflater().inflate(R.layout.stamps, null)); // here is your custom layout
alert.getWindow().setLayout(width-50, (height-100)); // set height / width
and when you want to trigger an onlclick in your button for example which is placed in R.layout.stamps as in the example you should do like this :
Button dog = (Button) alert.findViewById(R.id.dog_stamp);
You can create a custom AlertDialog.
For example : http://www.mkyong.com/android/android-custom-dialog-example/

Make activity match current system dialog?

I'd like to be able to create an Activity that matches a default system Dialog. So in Android 2.2, it'll look like a Dialog for that version, in 2.3 it'll look like a Dialog for 2.3, etc.
The usual answer starts off with set android:theme="#android:style/Theme.Dialog" in the Activity manifest. However, that just gives you a floating box with unstyled text. What's missing is a title over a title bar, the dialog text, and the dialog buttons---all styled to match a system Dialog. What system styles should I use?
For example, I found TextAppearance_DialogWindowTitle in R.style. This gives you the text size for the title. Still missing is styling the title background, the buttons, etc.. Any ideas? Android style and theme documentation is sorely lacking.
I would just use the dialog builder except that I need to use a custom icon, so I would be back to square one styling a custom dialog....

Spinner pop up window title background

I would like to modify the background of the title bar of the dropdown dialog associated to a spinner.
If this is not possible I would like to know what resource is used to draw this background android.R.drawable.* ?
This is an effort of uniformity for my various pop ups in my application.
You can change everything using styles and themes.
Take a look at this example for buttons:
http://blog.androgames.net/40/custom-button-style-and-theme/

Categories

Resources