I have a problem with PopupWindow class used inside a Dialog.
The code works fine and the popup does show, but it is clipped to the content area of the Dialog. In my case, the popup can contain quite a bit of text, which makes it look weird, being clipped suddenly at the bottom of the Dialog :-(
Here is a little presentation:
Any hints how to make the popup draw inside the whole window, not just the Dialog frame?
I already tried this solution, but it breaks the Dialog styling, making it fill the whole screen and requiring lots of tricky fixes, so I would rather not use it.
Related
The scenario: There is a Dialog whose content is larger than the screen's height therefore scrolling is needed to see everything in the Dialog. Because scrolling should be avoided in Dialogs (according to Material Design guidelines) I was trying to find the way to omit that issue.
The solution?: I noticed that in Google Play Store there is a dialog that when scrolled down it animates smoothly into a full screen. If I get to the top of the screen again and scroll up, it becomes the Dialog again and when scrolled even further it dismisses the dialog. I was wondering whether there is an easy solution that would allow this kind of transition or do I have to add some kind of OnScroll() listeners manually?
I looked through forums and SO and find many examples on how to display a dialog with a blurred and dim background which I put in place in my app. The issue I have now is when I want to display a second dialog on top of the previous one but still keeping both on the screen. The effect I would like is to dim and blur the background a second time when the second pop-up shows up. But what it does at the moment is blurring the activity again and not blurring the dialog that is still showing in the background.
So my question would be, is it possible to blur a dialog, when opening another dialog? If yes how could I do this? (Make sure you read the question well... I know how to blur the activity, the question is how to blur the dialog already shown on screen when I open a new dialog on top of it....)
Thanks very much
you can create fullscreen dialog with custom layout which consist from
real dialog content and blurred transparent part outside which would blur and overlay all background views.
When a dialog is disappearing, it can look bad if you have another animation running at the same that takes up a large portion of the screen. I've also found that a disappearing dialog doesn't mix well with listView.smoothScrollToPosition().
Is it possible to put a listener on the dialog disappearing animation so that you can start your own animation or scrolling when it has completely gone?
I will accept the answer of "no it isn't possible" if someone can convince me of that.
I am using a dialog themed activity in android to show a popup from a application context. The dialog has a transparent theme, but the issue is that I want the underlying activity to have focus and not the popup though the popup must be visble. How do I achieve this in android?
I think you would have to use a Fragment and just make it look like a popup dialog.
You can not switch focus between activities. There's only one activity "on focus" at the time, and is the one that is being displayed at that point. The transparent background doesn't mean you can access the activity below.
If i don't get it wrong, you want to be able to interact with the activity's controls while having a "Dialog" on the screen. Any sort of Dialog class from Android will not help, since they take the focus away. Not really sure about PopupWindow, but i'm guessing will be the same thing as the documentation says "that appears on top of the current activity."
You are going to have to create a custom dialog using a RelativeLayout/FrameLayout within your activity.
Hi,
I need to create a UI such that an image view appears at the edge of an alert dialog. Please find below the steps in detail.
I click on a button in activity.
Alert dialog windows should slide from the right to the center.
In the edge of the dialog window, i have an image.
I am done till step 2. I don't know how to place an UI such that half of that appears on the dialog view. Please refer to the image i have provided.
Please provide me with the code samples or pointers for implementing the same. Thanks.
Try using frame layout
A dialog is usually a small window that appears in front of the current Activity. The underlying Activity loses focus and the dialog accepts all user interaction.
So, I doubt if such an effect can be obtained in a dialog.
However, I tried using absolute layout as dialog's content view to create a custom dialog and moved the imageview to an edge by altering the layout parameter. That showed only the portion of the imageview that could fit into the dialog and the rest was not visible.