Android Question B4XDrawer Click on the icon does not work

Ederson Kerber

Member
Licensed User
Hi,

I downloaded the two examples of B4XDrawer:

Example 1
Example 2

In none of them when clicking on the navigation menu icon ("burger") the side menu is opened. The NavigationItemClick event is not raised when the icon is clicked.
Tested in Debug and Release mode (obfuscated), with device connected via usb.

Nothing was changed in the original design. Only executed.

Projetcs

P.S: It was not possible to attach the projects in the post, so I sent it via WeTransfer.

B4A Version 9.80.

thanks!
 

Attachments

  • bibliotecas.PNG
    bibliotecas.PNG
    7.9 KB · Views: 165
  • 20200212_222303.jpg
    20200212_222303.jpg
    51.7 KB · Views: 161
Last edited:

Toky Olivier

Active Member
Licensed User
Longtime User
It was not possible to attach the projects in the post, so I sent it via WeTransfer.
The size of project you wanted to attach is too big (7MB). I assume it's not the original examples.What is the result of running just the examples posted by Erel?
 
Last edited:
Upvote 0

Ederson Kerber

Member
Licensed User
These are the original examples. I downloaded more than once to test.
When clicking on the navigation menu icon ("hamburger"), the side menu is NOT opened. The NavigationItemClick event is NOT raised when the icon is clicked.
 
Upvote 0

Toky Olivier

Active Member
Licensed User
Longtime User
These are the original examples. I downloaded more than once to test.
When clicking on the navigation menu icon ("hamburger"), the side menu is NOT opened. The NavigationItemClick event is NOT raised when the icon is clicked.
The rar file you linked has a very big size.
I just tested the original samples project and there is no problem.
Have you tested with another devices or in the Emulator?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
1. Use File->"Export as zip" in the IDE to export a Project
2. I checked Appcompat example

This is the Log
Logger connected to: 988ad036525346515630
--------- beginning of crash
--------- beginning of main
--------- beginning of system
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
click1
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **

3. I checked AppCompat1 example

This is the Log
--------- beginning of system
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Click
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
The Drawer opened after i clicked in this example
 
Upvote 0

Ederson Kerber

Member
Licensed User
Hi,

Project attachment exported in File -> "Export as zip" in the IDE to export a Project.

I tested it on 2 different devices, both with the same problem: when clicking on the ACToolBarLight1 (hamburger) icon, the "ACToolBarLight1_NavigationItemClick" event is not executed.

Tested Devices:
- Samsung Galaxy SM-G530BT - Android version: 5.0.2
- Sansung Galaxy J7 SM-J710MN - Android version: 8.1.0

Thanks!
 

Attachments

  • AppCompat_test.zip
    13.7 KB · Views: 134
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You are loading the ACToolBarLight1 to the navdrawer layout. This is a mistake.

ACToolBarLight1 should be added to the top of your activity.

Use this sub

B4X:
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("1")   ' Load the ACToolBarLight1  to the activity layout.
    Drawer.Initialize(Me, "Drawer", Activity, 300dip)
    Drawer.CenterPanel.LoadLayout("Left") ' load the left layout into the drawer
    ToolbarHelper.Initialize
    ToolbarHelper.ShowUpIndicator = True 'set to true to show the up arrow
    Dim bd As BitmapDrawable
    bd.Initialize(LoadBitmap(File.DirAssets, "hamburger.png"))
    ToolbarHelper.UpIndicatorDrawable =  bd
    ACToolBarLight1.InitMenuListener
    Drawer.LeftPanel.LoadLayout("Left")
    For i = 1 To 30
        ListView1.AddSingleLine("Item " & i)
    Next
End Sub
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I ran your project and
A) The drawer opens on hamburger click
B)
Logger connected to: 988ad036525346515630
--------- beginning of crash
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
--------- beginning of system
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
click
 
Upvote 0

Ederson Kerber

Member
Licensed User
When executing the project and clicking on the hamburger button, the drawer does not open. And the "click" log is not shown:

B4X:
** Activity (main) Pause, UserClosed = true **

** Destroy (ignored) Service (starter) **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
 
Upvote 0

Ederson Kerber

Member
Licensed User
Hi,

I updated the AppCompat Library to version 4.00 (attachment) and the problem was fixed!

Thank you for your help!
 

Attachments

  • appcompat.PNG
    appcompat.PNG
    7.1 KB · Views: 141
Upvote 0
Top