Android Navigation Flashcards
Study cards to better understand how android navigation works
What are the 3 different types of navigation in Material, a design system created by Google
Forward (hierarchical)
Lateral
Reverse
What is lateral navigation
Moving between screens at the same level of hierarchy
What are the 3 ways lateral navigation can be implemented
Navigation drawer
Tabs
Bottom navigation
What are the 3 ways forward navigation is achieved
- Moving sequentially through a flow
- Moving from a parent screen to a child screen
- Moving directly from one screen to another
What is reverse navigation and how is it achieved
Moving backwards through the screens
- Chronologically or hierarchically
What are the 3 key components of the navigation component in jetpack
- Navigation graph
- NavHostFragment
- NavController
What is a navigation graph and how is it used
XML resource file, contains information about destinations and actions
What is the NavHostFragment and where does it get added. Where does it get initiated
Provides an area for the navigation to occur. It gets added to the layout file where you want the navigation to occur.
It gets initiated in the activities code, along with a navController
What does the NavController do
Handles navigation in the app and manages the back stack
What do you need to do to use the navigation bar instead of the default action bar?
In the manifest file:
add
android:theme=”@style/Theme. NavigationJava.NoActionBar”
What does the ViewModel do
Bridge between the data/business logic and the views
Survives config changes
Handles UI Logic
Gets and processes data from the Model
Observes changes
What are two essential components that are needed to use Retrofit
- Retrofit interface (contract that defines how the app will interact with the API.
- The Retrofit client (creates the Retrofit interface static instance)
After setting up the Retrofit instance and the Retrofit client what do you have to get the MainActivity to do?
Calls the retrofit client method for getInterface and then does the custom search