View behind a panel

barx

Well-Known Member
Licensed User
Longtime User
I've just tried to create a popup effect using a panel with .enable. Upon taping the screen I realised it accesses the views behind the panel as though it wasn't there.

This triggered a memory that someone else posted about the same issue but cannot find the thread. What was the out come? is there a workaround or do you have to move the views in the background off screen.

Thanks
 

barx

Well-Known Member
Licensed User
Longtime User
Does this help?

Thanks vb1992 but it's more a problem of being able to click views 'through' a panel.

Guess enabling and disabling may be the way to go. Or just move out of the way.

A bit of an oversite this one on Googles part
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
Just been reading agraham dialogs library and wondering if the custom dialog would be useful to achieve my goal.

agraham, if you read this post, how does the dialogs do their thing without the bug raising it's little head?

When you show a custom dialog, can the views contained on the panel be updated without reloading the dialog. Basically want to show a spinner and listview or scrollview, The lists' items need to be dynamic based on the spinner selected item. Then 'OK' and 'Cancel' Buttons at the bottom.
 
Upvote 0

timo

Active Member
Licensed User
Longtime User
Disabling a panel is not enough to avoid his Views to be non reactives: you should make that panel visible=false. If you have some buttons/edittexts directly on the Activity itself too, you should enabled=false those Views.

My problem was with multiples panels, where to control all of them became complicated: it was better to have had a property to set only on the choosen one.

But I realize, at the end, that it is not a real problem anyway.
 
Last edited:
Upvote 0

latcc

Banned
I have seen this too, and cannot find a way to get around it. To my mind if you disable and hide a panel then it should not be accessable to the user.

Erel answered this error in an old post by saying it being able to click a panel's views when that panel had been disabled and made non-visible was normal and how Android worked.

Another reply suggested you need to 'consume' all views.

Erel said you could had to capture the views' calls (eg: sub button_click) even if there was no code within the subs.

In another thread someone said they don't like using panels because of this exact problem.

Is this is normal android behaviour? I have never come across it in non B4A programs.

I think we need a 'consume' property for panels so when we disable them they close dissapear immediately.
 
Upvote 0

timo

Active Member
Licensed User
Longtime User
I Learned one thing from that: now I use only one panel per Activity that hold all the views and I do the rest with other Activities the same way. The only exception is the splash panel, but I get very careful on what is behind it.
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
To be honest this only came about because my app requires a lot of user input. It already utilises a tab hhost to split things up into 3 tabs, then panels in a scroll views to split tabs into scrollable sections.

One particular piece of info requires a category:item approach and rather than have 2 spinners I thought a popup dialog with spinner and list would look nicer. Guess I'll have to find another way. I don't like cluttered screens though and fear this may be going that way...I can't understand why the dialogs don't have such problems?

Sent from my HTC Vision using Tapatalk
 
Upvote 0

capisx

Member
Licensed User
Longtime User
i had this problem too before, and i'm using a button view to prevent it. just set the button size to fill the panel and then set the button alpha to 0 (fully transparent).
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
Panel was only 80% size, but will increase to 100% then add click event. Thanks
 
Upvote 0
Top