Trying to create a mobile application using kotlin. Open for suggestions and answers. Feel free to post your views on this.
Application is dependent on "User-Based Login".
Each login has different navigation components. For example, if we have 2 users, the path names would be as follows:
User 1: Profile, Email
User 2: Profile, Location, Email, Holiday, Leave
When User 1 logs in, only Profile and Email should be displayed in the side navigation. When User 2 logs in, all the mentioned paths should be displayed in the side navigation.
By default, we get HomeFragment, ProfileFragment, SlideShowFragment. However, I'm seeking a dynamic navigation solution.
If the user type is obtained as either 1 or 2 from API calls, dynamic navigation becomes more straightforward. You can initially set up two separate navigation views, each with its own layout for menu items. Then, based on the user type, you can toggle the visibility of one of the views. Initially, set the layout to 'Gone.' Once the user logs in, adjust the view to 'Visible' based on the user type. I applied this concept in my app for both the Bottom Navigation Bar and the Side Drawer.