Android Question Transparant colour settings

RickV

Member
After reading an old thread hoping to find an answer, I am reposting a new one.

I want a black background. I have set the activity and panel backgrounds to black. 000000h RGB(0,0,0). I have a button on panel0 that also has a black background 000000h RGB(0,0,0) with white wruting FFFFFFh RGB(255,255,255) that shows a connection status and if pressed closes the network socket, reioebs ut and starts the transactions over again.

After this is complete, I show panel1, background 000000h RGB(0,0,0), lavel views and text views 000000h RGB(0,0,0) backgrounds and white foregrounds FFFFFFh RGB(255,255,255).

Problem: within the background where ther are no objects, you cannot see the first p[anel or the label, but you can still press it.
I have even disabled the label, the panel, moved it out of the way and it still occurs.

So the question is, what colour setting is translated to transparent so I can change the colour settings for the panel background?
 

Sagenut

Expert
Licensed User
Longtime User
Are you setting colours from Designer or by code?
Anyway for Transparent just choose.... Transparent. :)
But I haven't understood clearly your problem:
You want to avoid to press the views that are on Panel0 when Panel1 in shown above them?
For this you have to declare the Panel1_Touch sub to consume the click without passing it to the underlying views.
 
Last edited:
Upvote 0

RickV

Member
I draw 2 panels in the designer, set both backcolours to 0,0,0 - panel 0 and panel 1 - Visible is set to false for both
Main activity always visible is another label that when clicked initiates the connection and shows panel 0 with the status of what the app is doing with network data. If it stalls for whatever reason, you tap the label to retart the netork process.
so, in designer ide) I draw a label on panel 0 and set the back colour of that to 0 and fore colour to FFFFFF. Panel 2 has a host of labels and text boxes for the data retrieved from the server.
Pamel 0 - In code for that label when clicked I close a socket, wait 1 second reopen the socket. Do not change colours
All goes well and gets data, panel 0.visible=false - panel 1.visible-trye
Now here is the problem, even though the back colour of panel 2 is fully black, cant see anything on panel 0, you can still click it through the spaces between the textboxes on panel 1...... seems weird considering it is full oopaque or full whiteout of panel 0.
I have even moved the panel to the extreme right of the screen so it cannot be clicked..
the only other active label behind the panel resides directly on the activity background. I am starting to think this may be the culpret.
 
Upvote 0

RickV

Member
but still dont understand why the label on the main activity can be clicked through the panel..
Is this a bug or a trait of the actual activity object?
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
but still dont understand why the label on the main activity can be clicked through the panel..
Is this a bug or a trait of the actual activity object?
It's not a bug.
You must add the Touch event of a panel (do it from Designer) if you want it to Block/Intercept the click on it.
Without the Touch event the click will be passed to the views behind it.
 
Upvote 0

PaulMeuris

Active Member
Licensed User
You could set a border (border width > 0) for the panels and/or labels with a border color opposite of the background color (white on black, black on white).
If a label is on top of a panel then the click event of the label is used (if tapped on the label) . If a panel covers the label then the panel click (touch) event is used.
You could also use both events if you write code for it.
 
Upvote 0

RickV

Member
awesome thank you for the advice. It us a bit of a learning curve but getting my head around stuff pretty quickly thanks to everyone on here. ☺
 
Upvote 0
Top