Android Question [Solved] B4XDrawer together with own navigation bar

Frank.G

Member
Licensed User
Hi, as my app is growing I encountered a "problem" that I was not able to solve.

Basically I implemented the B4ADrawer sliding menu from this thread https://www.b4x.com/android/forum/threads/97828 but without using any additional libary regarding Navigation bars.

I created my own custom panel area at the top just with two buttons and a label.
The left button (Burger design) to open my sliding menu other than swiping does not work when i put it into the full left corner. It seems that the swipe detection uses this space and prevents the button click.

I moved the button in the designer about 30 to the right to catch the click.

Is there any possibility to adjust this?
Maybe adjust the sliding drawer to start below my navigation bar as I fear adjusting the swipe detection will leave it useless as to far to the edge for detection.

I reviewd the B4XDrawer class but was not able to adjust something (still to new I think to fully understand).

Regards
Frank

Edit:Screenshot
screenshot.jpg
 
Last edited:

Frank.G

Member
Licensed User
Clicks (without movement) should always work. If a precise click doesn't work then there is probably a different problem.

You can modify Base_OnInterceptTouchEvent and check whether y < 30dip. If so then return False immediately.
Hi Erel,

Thx for the Info. I tried but unfortunate the changes did not solve the issue.
As I also use the BTX4Table and TablePanel I also tried modifying this class, with no positive result.

For further help request I attached the APP as a ZIP file.
Internally I disabled all functions concerning the used database because of copyright issues. But the rest is functional and also the burger button is full on the left.

Maybe someone has an idea whats going wrong.
BTW Great support and swift responses ;)


Regards
Frank
 

Attachments

  • PurCal.zip
    16 KB · Views: 252
Upvote 0

Frank.G

Member
Licensed User
1. A non-process global should be initialized whenever the activity is created. Initializing it only when FirstTime is true is a bug.

2. You are not setting B4XDrawer correctly. All the layout should be added to Drawer.CenterPanel. Otherwise it will not work properly.

I feel stupid now :(

Looking at my code for hours and didn't realize that I commented out the line
B4X:
Drawer.CenterPanel.LoadLayout("form1")
for setting up the drawer correctly.
After un-comment the line the button worked as supposed, thx for the tip anyways.

I also moved the part
B4X:
tp.Initialize(Me, "tp", Activity)
tp.base.LoadLayout("form1")
As I think that was the first of your comment regarding a non-process global.

Marked as solved :)

Frank
 
Upvote 0
Top