I have an issue. I've developed a very custom dialog which I have created on a panel in the designer. Then at startup, I programmatically create a panel the size of the Activity using the FillParent option, which is specified with a width and height value of -1, and set its color to ARGB(180, 1, 1, 1) which is a dark transparent black, which dims whats behind it, then load the custom dialog layout. pnlInput is of course Dim'd in Sub Globals.
Here is my init code:
That simply sets up what I've described, hides it, then set's the dialogs vertical position. Then when its needed, I call it like this:
and I've attached a screenshot below. Also note that when the translucent panel is called to front and made visible, it overlays a scrollview with a series of labels.
Problem is, in the emulator anyway, you can scroll what's behind/underneath the translucent panel, by grabbing it on either side of the gray dialog panel and moving up and down. I even tried adding pnlInput to the activity as the very last step, and also tried using Activity.Width and Activity.Height instead of using FillParent, but it didn't change anything... Even disabling the scrollview behind the panel didn't stop it from scrolling.
This really threw me for a loop. I didn't think even a completely transparent panel would let touch events through. This was the way I was going to make the 'dialog' modal, by allowing you to see what's behind the panel, but not allowing you to touch. But as it turns out, if a user wants to change the day displayed in the dialog, they can without exiting the dialog. And that's not a bad thing in this particular app. So all is not lost.
But this is too weird! Can anyone tell me if I've done something wrong? Or if I've left out something? I'm thinking that views behind/underneath a panel, even a transparent one, should never be able to be clicked, dragged, scrolled or otherwise manipulated.
Help??
Jesse
Here is my init code:
B4X:
pnlInput.Initialize("")
activity.AddView(pnlInput, 0, 0, -1, -1)
pnlInput.Visible = False
pnlInput.LoadLayout("input")
pnlInput.Color = Colors.ARGB(180, 1, 1, 1)
Panel1.Top = Activity.Height - Panel1.Height - 20dip
That simply sets up what I've described, hides it, then set's the dialogs vertical position. Then when its needed, I call it like this:
B4X:
pnlInput.Visible = True
pnlInput.BringToFront
and I've attached a screenshot below. Also note that when the translucent panel is called to front and made visible, it overlays a scrollview with a series of labels.
Problem is, in the emulator anyway, you can scroll what's behind/underneath the translucent panel, by grabbing it on either side of the gray dialog panel and moving up and down. I even tried adding pnlInput to the activity as the very last step, and also tried using Activity.Width and Activity.Height instead of using FillParent, but it didn't change anything... Even disabling the scrollview behind the panel didn't stop it from scrolling.
This really threw me for a loop. I didn't think even a completely transparent panel would let touch events through. This was the way I was going to make the 'dialog' modal, by allowing you to see what's behind the panel, but not allowing you to touch. But as it turns out, if a user wants to change the day displayed in the dialog, they can without exiting the dialog. And that's not a bad thing in this particular app. So all is not lost.
But this is too weird! Can anyone tell me if I've done something wrong? Or if I've left out something? I'm thinking that views behind/underneath a panel, even a transparent one, should never be able to be clicked, dragged, scrolled or otherwise manipulated.
Help??
Jesse
Attachments
Last edited: