Android have alertdialog not block app options menu - android

I've searched around for a while on this but haven't found anything. I have an "about" option in my app's main options menu that gives the user support information (# to call, version info, etc). I also have an alertdialog that prompts the user to take an external action before the app proceeds (they have to do this). It's possible the user may want to get this support information while the alertdialog is present. Is there any way to make the alertdialog not block the app's option menu? Or maybe just show the options menu on top of the alertdialog somehow?
edit - not on top of the dialog itself, in the same spot it would normally be, just on top of the overlay.

I ran into a similar problem with a dialog and sound. My problem was that when the dialog appears, it caused the original activity to pause, which had unintended consequences.
In my case I found it easier to implement my own dialog interface using a RelativeLayout and FrameLayout within the original activity.

Related

Android - UX design conventions concerning "Cancel" and "Done" buttons

I am new to Android and I am creating an app in which you have a form which you can save similar to how it is done in the contacts app.
My question is: how should I display "Cancel" and "Done" buttons? Should I even display a "Cancel" button in the first place, since the hardware back button (or the action bar's up-navigation) should suffice?
The screenshot below shows how it is done in the Contacts app, but I am wondering if this is "the way to go", because this way the buttons take a lot of screen space for no reason. On iPhone you have a small "Done" button on the top right (inside the navigation bar / action bar). I tend to do the same for this Android app, but I don't want to do anything that users don't expect.
So can someone please help me out here? :)
For this particular case, put the "Done" in a contextual action bar.
Back does not work as "Cancel" - it should also persist whatever edits made so far.
(Buttons like "Done" and "Cancel" are valid in an alert dialog but that is not the case here.)

Opening Options Menu with Dialog Open

This seems like a pretty simple question, but I'm not sure if it's even possible. Is it possible to allow the MENU button to still bring up the option's menu when a dialog is showing on top? I want to do this because I want to give the user some more options while a dialog is opened.
I don't think that is possible.
Although the docs say that you should be able to do this.
A dialog is always created and displayed as a part of an Activity. You should normally create dialogs from within your Activity's onCreateDialog(int) callback method. When you use this callback, the Android system automatically manages the state of each dialog and hooks them to the Activity, effectively making it the "owner" of each dialog. As such, each dialog inherits certain properties from the Activity. For example, when a dialog is open, the Menu key reveals the options menu defined for the Activity and the volume keys modify the audio stream used by the Activity.
http://developer.android.com/guide/topics/ui/dialogs.html

How to blur background of search dialog?

I’ve created a search activity in my app, in the standard Android way, without custom suggestions. When a user starts typing text or presses the search button, they get a search dialog with search box, something like figure 1 from here:
http://developer.android.com/guide/topics/search/search-dialog.html
You’ll notice in the background is the previous activity, the words “abide”, etc.
My problem is that the previous activity is shown clear as day behind the search dialog, and its confusing for users, because users think all that is still active, and they try to press on it, but it just cancels the search dialog. And it distracts the user from the search task (are those search results, they may wonder?).
Question: how to blur (make out of focus) or darken the previous activity?
I actually see this in some app’s search screens.
I found a simple way to blur the background of the search dialog:
Basically it's just adding a (half) transparent view over the ListView (or what is under the dialog) and hide it by default. If the search dialog appears (calling onSearchRequested()) it is set to visible, if it disappears it's set back to gone (invisible).
Check out the details at my blog: http://mavistechchannel.wordpress.com/2011/08/13/blur-background-android-search-dialog/
Assuming you got dialog from a Dialog.Builder, use the following:
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);

Is there a way to onCreateOptionsMenus() continue "listening" while a Progress Dialog is showing?

The Title is almost the entire question but i'll complement it with some things :
-(1) I have a AsyncTask for get some data from Internet
-(2) I have a AsyncTask for display a Progress Dialog
Before call (1) , I execute (2) dialog.show() and when task (2) ends I call dialog.dimiss(). All is doing right , but while the Progress Bar is showing the Menu Button stay unresponsiveness, ie , nothing happens...
I would like to know if it is the default behavior or i missing something ?
I'm looking for it and did found anything that clear me about it..
Aprecciate any advice
You mean to say that while the dialog is showing, pressing the hard menu button does not bring up the menu. Did I get it right?
If so, then I see the same behavior as you. But according to this:
For example, when a dialog is open,
the Menu key reveals the options menu
defined for the Activity and the
volume keys modify the audio stream
used by the Activity.
So I would expect that the menu button should still work even if the dialog is showing, but based on my experience, it does not.
After the dialog is dismissed, the menu button should work again.
onCreateOptionsMenu is meant to prepare the dialog. Once it is shown and in use it is no longer being prepared and thus use of the dialog is then handled in onOptionsItemSelected.

Android TextView show just above the Menu

i have a textview at the bottom of my screen but when menu clicked, i need to move the textview just above the menu, so that every one can see the textview,now when i clicked menu ,it cover the textview ,any solution for this problem
This is only possible with the virtual keyboard, I think.
It would not be a good idea anyway, since menus are for things the user can decide to do without looking at the screen information. Menus should be self-explaining.
A dialog is another story, since it sometimes refers to items, which are covered by it (open file e.g.). One might want to repeat the item in the dialog. I would not use a menu to open a file, the user has selected from a view. Instead, I would use a popup dialog, repeating the file name.

Categories

Resources