2

At the moment, the Codename One Toolbar doesn't provide an API to implement a right sidemenu.

I opened the RFE: SideMenu on right of Toolbar a while ago and I've also see several old discussions about it. I need to implement it (it's a requirement), so I tried to find a way to circumvent the lack of this feature. More precisely, I need to implement both a left side menu (without the hamburger menu icon) and a right side menu (with the hamburger menu icon) in the same Form.

I found a (complex) solution in the old post "On The Side, Up On Top", based on the (deprecated) SideMenuBar. I tested (in the Simulator only) the code reported in that post and I got the two side menus (the left one without icon and the right one with the hamburger icon).

However, I suppose that it's not a good solution to trust a deprecated API to do a new app. Moreover, I'm used to work with the Toolbar, I'm not comfortable with the SideMenuBar (that seems complex and that I've never used before).

My question is how to implement this use case with code that I can trust. Or is the SideMenuBar the only solution?

(The side implied ask for help is if somebody of the Codename One team can implement this RFE that probably can be interesting for other developers, as shown by other similar questions (i.e.: [1], [2], [3], [4], [5], [6], [7]): at the moment, I'm not able to do it by myself. Thanks).

Francesco Galgani
  • 6,137
  • 3
  • 20
  • 23
  • UPDATE FOR THE READERS: I sent several pull request to implement what I asked. In the next update of CN1, the right side menu will be available. – Francesco Galgani Jun 06 '18 at 00:36

1 Answers1

2

I wouldn't use SideMenuBar there is a reason we deprecated it and the right side support was especially flaky.

I would go with a pull request by changing the code in Toolbar to add support for an API that will add to a right side bar. It would essentially mean making use of the logic used in the left side menu bar to create a similar right side menu bar. Some fields will need duplication (e.g. the InteractionDialog) but a lot of the code can remain generic.

Alternatively if you don't need swipe support you can just add a command to the right menu bar and just show an InteractionDialog or even a Dialog with a side transition.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65