When my app is first run, I would like to have a welcome message displayed in a dialog box. Then the user can click next at the bottom, and the box stays but a new layout is displayed where the user can input information.
How would I go about this? It would also be great if I was able to add an animation between the two layouts, the second one sliding in from the right for example. Is this possible?
I was thinking I may be able to use
builder.setView(secondlayout);
Related
I am customizing the android keyboard after downloading the sample keyboard code from developer.android.com. I want to customize the layout of the popup window after a user made a long press on a given key, onLongPress(key popupKey). Particularly, I want to get ridoff the close button at the end of the popup keys and want to make the window close when the user clicks outside it. But, I can't figure out how to get access to the popup window. Please give me some hints.
I finally figure it out myself and want to share for anyone interested.
I was not able to get the close button and get rid off it. But, what I got easier is creating a PopupWindow having multiple buttons whose labels are the popup characters taken from the key parameter passed to onLongPress().
This way I was able to display only the popup characters and close the window when the user selects on of them or presses outside of the window.
Cheers!
I have two alert dialogs. Whenever app opens, the first dialog is shown. After some time, the second dialog is shown. But here problem is recently created dialog(second one) is in front. But I want the fist created dialog is in front and second one is behind the first one.
The problem with the dialog box is that you can not display two dialog box at a same time. You must hide first dialog box in order to display second one.
You can only display one dialog at the time, but you can "work around" this. When you are about to display your second dialog, you hide your first dialog, but your application remembers that the first dialog was open, so when you hide your second dialog you displays the first dialog again. In reality this will go so fast so the user is fooled that the dialog is layered over eachother(if they have the same dimensions).
But you cannot display a dialog on top of another dialog.
You can display first dialog in front :
When you are calling to display second one at that time call first dialog again so, that is in from view of your screen.
Let me know you understand this or not.. otherwise i will provide code for it..
You cant make two dialog active at same time either one should active and the other should inactive.In your case if you want the second should come background of fist then you have to call first dialog from the second.
I show a Dialog box to the user while loading a page.Would there be any problem if i show another Dialog box before dismissing the previous one?
I have tested it and its working fine.Just wanted to make sure.
I need to do this because-- When the user clicks on a button i show loading dialog box and users identity is verified in the background.If i dismiss this dialog box there the lag of say 2 sec( specially when network is very slow),before the user moves to the next activity.
I am showing another dialog box so that the user stays in that activity before all background work is done.
There would be no problem, when you are displaying one or two dialog boxes, but If you increase the number of dialog boxes, then your application becomes complex for users and it don't meet the user-friendly principles. you can use more dialog boxes in different places in your app.If you try to show more than three or four dialog continously, then your application will not meet the quality.
I want to show two Dialogs (default) at the same time, no matter if second one is shown then previous lost its focus but should remain on the Screen. I tried by many ways such as:
1) Creating two Alert Dialogs
2) Creating one Alert Dialog and other one Activity as a Dialog
but i never achieved my desired task. Image is shown below that just describes how i want to show such Dialogs (default) and layout would be same as to the Default dialog but here i just describe how should the dialogs be laid out.
It's not possible to show two dialogs at the same time in the same activity.
If you do want something that looks like a second dialog, I suggest you create a layout inside the first dialog that is hidden until you make some selection.
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);