Floating Windows

ClassicDancer

Member
Licensed User
Longtime User
Hi,

I've created a floating window to edit a record from a database. Just wondered whether there is a way to disable the main activity window from getting focus and finger pressing.

Or am I going about it the wrong way.

I need a small window on top of the main activity window in order to update a record.

Please help.

Andy
 

barx

Well-Known Member
Licensed User
Longtime User
Maybe overlay the activity with a clear panel and code to consume the click events. Then set that panel as the parent of the popup window (If it requires one)
 
Upvote 0

ClassicDancer

Member
Licensed User
Longtime User
I assume you mean this is the answer? (Place a panel between the floating window and the other views, and create a
OnTouch handler for this panel (even empty).)

I'm not sure how to do this..... Can you explain please?

Thanks

Andy.
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
I assume you mean this is the answer? (Place a panel between the floating window and the other views, and create a
OnTouch handler for this panel (even empty).)

I'm not sure how to do this..... Can you explain please?

Thanks

Andy.

Placing a panel on screen and creating an empty Panel_Touch handler is very basical. So what's the thing you don't understand ?
 
Upvote 0

ClassicDancer

Member
Licensed User
Longtime User
What sounds very basic to you obviously isn't basic to a new android programmer.

I have a main activity window and within this activity I have setup a Floating window to update a database entry. When the floating window shows its self the background activity can still receive focus and events.

In principle I understand what you are saying, however to implement it I am not sure how to cover the activity window with an empty panel etc....

Regards,

Andy
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User

B4X:
Dim pnl As Panel
pnl.Initialize("MyPanel")
pnl.Color = Colors.Transparent
Activity.AddView(pnl, 0, 0, 100%x, 100%y)

B4X:
Sub MyPanel_Touch(Action As Int, X As Float, Y As Float)
End Sub

If you succeed in using my Floating Windows class, I really don't understand why you're stucked on such a basic thing.
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
I've already tried that but the panel does not show.

????? You want to show a transparent panel ? With you, I'm completely lost.

1)
Add this code between the creation of w(3) and w(4) in my demo #1 (line 122):
B4X:
Dim pnl As Panel
pnl.Initialize("MyPanel")
pnl.Color = Colors.ARGB(220, 128, 128, 128)
MainPanel.AddView(pnl, 0, 0, 100%x, 100%y)

2)
Add the event handler sub from the last post and you'll see that some windows are still accessible, others are not. The panel acts as a blocker. I colored it in gray to make it visible.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…