I'd like to an AlertDialog that has no border. Currently all AlertDialogs on my 2 phones have borders, with the borders looking different on each phone. I'm guessing this is due to manufacturer customization.
I know I can use a standard Dialog for more control, but hope to avoid that if possible.
Take a look here: Android Borderless Dialog
A custom xml layout for the dialog should do the trick :)
Related
I am tasked with creating this kind of pop-up message for an app. I attached an image bellow with the design,
Note that the pop-up is placed right bellow a certain ImageButton to indicate something about it. The pop-up must also contain an ImageView, a TextView and two Buttons.
I know that the Alert Dialog native for Android opens a Dialog Popup at the center of the screen that has a rectangular shape and also makes the background behind it darker. But I want to create something that matches this design exactly and right now I have no idea how.
Can anyone show me how to do this, if necessary, even a library would help. All that matters is that the solution has to work on any Android OS equal or higher than v6.0 (Marshmallow).
Thank You!
Below popup library will help
https://android-arsenal.com/details/1/2927
you can inflate your custom View into this library
I need to develop a dialog similar to the one in the image, and I don't know what is the best approach (I'm a newbie):
Which approach do you consider to be the best?
Define one custom dialog and define the custom layout (up arrow) in some way?
Define one image with 9-patch and use it as an imageView with text inside?
Thanks a lot in advance :)
Well, You need tooltips views not dialogs. Dialogs will not serve your purpose.
please refere below library
https://github.com/nhaarman/supertooltips
I need to edit default AlertDialog theme so that it will look like part of the design of my app. I don't want to create a whole new theme for it. I will just play with its own properties and make small changes. But the problem is I can't manage to reach the source code and I don't know what kind of attributes it has.
What I need to do is basically to give background a little transparency and roundness.
Does anyone know where can I get the AlertDialog style code? And which attributes do I need to edit for transparency and roundness of background?
Thanks.
Here's the style code for AlertDialog: https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml
I don't know how to change it the way you want though.
I want to implement a regular functional dialog, as well as text and a drawable on top of the gray overlay.
I did some research, but I was wondering if someone knows a better way of doing it. Here are a few thoughts:
1) The dirtiest way is to ditch the dialog and create a view with a fake dialog. That would be very easy, but is the least preferable because dialogs look different on different Android versions. Also it would be nice to reuse some of the Dialog stuff that has already been implemented.
2) A slightly better way would be to reuse the parts of Dialog xml file, but it's still "reinventing the wheel" a bit too much.
3) It would be great if I could just inflate a layout for the background and do dialog.setBackground but I couldn't find anything like that.
4) I tried inflating a layout and setting it using .setView() on the AlertDialog.Builder but it seems like it alters the dialog itself, not the background.
I have read lots of articles, here and elsewhere about customizing AlertDialogs, and those created by AlertDialog.Builder.
The approach that I'm using at the moment is injecting my AlertDialog.Builder with a ContextThemeWrapper. This ContextThemeWrapper is configured to read from a custom style that inherits from Theme.Dialog.
My customization requirements are quite straightforward:
Change the title bar background colour from the default navy/black version
Change the font type and size of both title and buttons
I've had a look in the default themes.xml and styles.xml but I don't see where to configure number 1 in particular...can someone let me know how this is done?
Also, some of the solutions I've seen involve inflating a layout and then setting this using AlertDialog.Builder.setView()...if I was to customize using this way then how do I design the views for positive and negative buttons?
Thanks
Sorry, alert dialogs are not really intended to be themed like that. They are basically the most concrete thing you can do -- a canned appearance for standard common situations.
If you want to have a dialog with a customized appearance, you should just start with the Dialog class.