Fragment Bottom Navigation in Android refers to a UI navigation pattern where the app has a bottom navigation bar, typically at the bottom of the screen, to switch between different fragments. Each item in the bottom navigation bar represents a different section of the app, and tapping on an item replaces the current fragment with a new one, without navigating away from the activity.
Here’s a breakdown:
1. Fragments:
Fragments are reusable portions of an interface in Android. Each fragment has its own layout, logic, and lifecycle, but it is always hosted within an activity.
Fragments allow dynamic changes to the UI within the same activity, such as switching between different screens without leaving the current activity.
2. Bottom Navigation:
The Bottom Navigation Bar is a bar at the bottom of the screen with several icons or labels, typically representing the primary sections of the app.
It provides easy access to these sections, improving the app's usability.
3. Fragment Bottom Navigation:
When you combine fragments with bottom navigation, tapping on different items in the bottom navigation bar changes the displayed fragment without leaving the activity. This setup is commonly used in apps that require switching between a few main sections like "Home," "Search," and "Profile."
For example, apps like Instagram use bottom navigation to switch between different sections like Home, Search, and Profile, while keeping the user in the same activity.