I have a Popup window where pressing on a button opens a Snackbar. I want this Snackbar to show on the bottom of the screen, not on the bottom of the popup window, so I pass the root View to the Snackbar.make function instead of the popup view.
The Snackbar shows up on the bottom of the screen now, but since the screen behind the popup window is darkened, the snackbar object is also shown behind the gray filter.
I would like to keep this gray layer above the window behind the popup window while showing the snackbar as if it were on the top layer (without the gray filter on it). How do I do that?
Thanks!
Make a Snackbar opening function on the fragment or activity, then when you instantiate the PopupView you pass the method through a listener.
Related
I need to limit the click area on the view. For example, I have a full-screen view, but I need only the top of the screen to be clickable, while clicking on the bottom should not give a result, how can I implement this? adding on top of the container doesn't help
You will need to create a click listener ONLY on the view you want to respond.
TopView.setOnClickListener()
BottonView (nothing).
If for some reason, your top View is not independent, just create another view that is transparent, and set a clickListener on that.
I have a webview app where I'm displaying images in a full screen popup. But, whenever a user press back button, it goes to previous page without closing it. Where the user intent is to close the popup and view other images. If the pop-up is visible, how to stop going back to previous page, but close the pop up.
You have to define a function in your page which is loaded in WebView. When the back button is pressed, you call that function.
You can look at this link for more information:
Calling JavaScript from Android
I have a few group of actor that contain some texture and button. I have a group that act like modal box that popup , overlay and occupy the whole screen. but I realize the actor that blocked by the modal box is still clickable. How do I disable it beside setting those 20+ button to untouchable?
Sample code
stage.addActor(slotMachine);
stage.addActor(payTableDialog);
payTableDialog.show();
Sample code of Dialog class
CustomDialog extends Group{
}
Set the size of the CutomDialoge Group(modal box) to Screen Size.
group.setSize(screenWidth, screenHight);
I am working on a android app, which has card swiping functionality like Tinder. In each cards, I'm having a imageview, which on click, opens in full screen. My problem is when I try to swipe, the image view considers it as a click event and opens the image in full screen.
I'm having my code for imageview onclick in the card swipe adapter and the code for swipe in the main activity that uses the card swipe adapter. How can I restrict the child view from consuming the parent's event?
I have an android dialog with EditText in it.
When the user clicks the EditText, the keyboard is opened
but the dialog is shrink.
The dialog root background is a 9patch
I want it to be cut, meaning its corners won't be rounded but square.
Now, the user might think the shrink dialog is the dialog full size.
I want the keyboard to be laid on the dialog in a way the user will see the dialog is originally larger there are not visible fields.
I have tried this on the activity that opens the dialog:
mDialog.getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
manifest:
android:windowSoftInputMode="adjustPan"
See my similar answer here: https://stackoverflow.com/a/22463549/335650
Is any part of your layout a scrollable container (like ListView)? If
so, try setting android:isScrollContainer="false" on that item in your
XML layout.
If you have any views which have android:isScrollContainer="true", the
layout manager will attempt to resize your layout when the keyboard
pops up, regardless of `android:windowSoftInputMode'.