Wish B4XPages Bottom Navigation

lucasheer

Active Member
Licensed User
Longtime User
Hello!

I have searched trying to find an answer to using a bottom navigation with B4XPages:

Here was my original thread:

Most modern apps have some kind of bottom navigation. 90% of my apps use bottom navigations, and I can't convert any of them to B4XPages. I also can't create any new apps using B4XPages.

Simulator Screen Shot - iPhone 8 - 2020-07-11 at 04.57.00.png


Thank you!
 

Biswajit

Active Member
Licensed User
Longtime User
  1. Create a Layout
  2. Add AHViewPager
  3. Add any bottom navigation view below viewpager
  4. Create a separate layout for each page that will be opened on the bottom menu item click
  5. Create a B4XPage
  6. Load the viewpager layout to the page root panel
  7. Then those separate layouts to the viewpager
  8. On the menu item click just scroll to that page
 

lucasheer

Active Member
Licensed User
Longtime User
There are many simple ways to implement such layout. You can for example, create a panel with a few ImageViews and labels. Implement it in a class and create such class in each of the pages.

If I implement it in each page, then it rides the animation changing to other pages.

I need it to be static, while the content animates
 

Cableguy

Expert
Licensed User
Longtime User
B4XPages are "just" panels which have a single (Main) activity as parent.
You can add a panel to the bottom of this activity to act as your bottom drawer, and it won't interfere with B4XPAGES animations, and it can even have its own set of animations.
 

lucasheer

Active Member
Licensed User
Longtime User
Not in B4i.


You can disable animations.

Whenever I disable animations, my bottom navigation still blinks whenever loading other views.

My current system is universal between B4i/B4a, but I would love to switch to B4XPages which seems to be the standard.


Thank you!
 

lucasheer

Active Member
Licensed User
Longtime User
Can you create a small project with this? Maybe it can be improved.

Yes sir!

I've been very busy with web dev & working on existing apps.

Here is the cross platform example I came up with There are still back animations on iOS, and android still shows an animation animation. You can click the button to go to a different bottom navigation page.

I wish I could keep page animations but get rid of animations on the bottom navigation.


Sorry for taking everyone's time here. However, my hopes are to create cross-platform apps with B4XPages like Facebook, Instagram, Snapchat, etc... It seems like 90% of apps nowadays have this bottom navigation.


Thank you!
 

Attachments

  • Project.zip
    15.9 KB · Views: 306

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. Why do you need a library for custom fonts???

2. In B4A, you can add the navigation to the main activity and give it an elevation of 20dip. It will appear above all pages.

3. It is a mistake to set a field in class before the class is initialized. Move it to B4XPage_Created

4. I've tested the B4i program. In release mode there is no visible flicker. You should show the next page with:
B4X:
B4XPages.ShowPageAndRemovePreviousPages("Test Page")
 
Top