Version 1.0
- Fork this repository with your private GitHub account
- After you are finished provide access to your fork for the user "sebastian-hoebarth"
- Try to use libraries that are included in Android Jetpack before using any other 3rd party library
- Try to support and use Material Design where ever possible
- Use MVVM, Single Activity and other concepts where every you can...
- The challenge is divided into separate parts, complete as many as you can
- Please stop if you are hitting the 4 hour time frame!!
- Good luck & enjoy your TACOs 🌮
The following structure and libraries are already provided. Please do not start a new project, use the current setup to continue in order to save time.
- An unfinished basic Android App implementation to start width
- Dependency injection with Hilt
- Database access with Room [FoodDb]
- REST service client with Retrofit [TacoService]
- List view item layouts
- Basic navigation pattern
- ViewModels & Databinding (if you are not familiar with any of those libraries, please check them out)
- Foundation - Components for core system capabilities, Kotlin extensions and support for
multidex and automated testing.
- AppCompat - Degrade gracefully on older versions of Android.
- Android KTX - Write more concise, idiomatic Kotlin code.
- Test - An Android testing framework for unit and runtime UI tests.
- Architecture - A collection of libraries that help you design robust, testable, and
maintainable apps. Start with classes for managing your UI component lifecycle and handling data
persistence.
- Data Binding - Declaratively bind observable data to UI elements.
- Lifecycles - Create a UI that automatically responds to lifecycle events.
- LiveData - Build data objects that notify views when the underlying database changes.
- Navigation - Handle everything needed for in-app navigation.
- Room - Access your app's SQLite database with in-app objects and compile-time checks.
- ViewModel - Store UI-related data that isn't destroyed on app rotations. Easily schedule asynchronous tasks for optimal execution.
- WorkManager - Manage your Android background jobs.
- UI - Details on why and how to use UI Components in your apps - together or separate
- Animations & Transitions - Move widgets and transition between screens.
- Fragment - A basic unit of composable UI.
- Layout - Lay out widgets using different algorithms.
- Third party and miscellaneous libraries
- Glide for image loading
- Hilt: for dependency injection
- Kotlin Coroutines for managing background threads with simplified code and reducing needs for callbacks
Use Jetpack Navigation to navigate between Fragments. Use ViewModel to hold the content. Store content in LiveData, access it in views with databinding.
Make yourself familiar with the project. It's a single activity-based architecture.
Here is an example of how your final UI structure should look like:
You need to create all missing Fragments by yourself.
This is your starting point:
(use bottom bar navigation to switch between [CategoryListFragment] and [SearchFoodFragment])
Request and display all taco categories in a list. Show the list of categories in a two-column staggered RecyclerView. Use the remote repository with REST Api [TacoService]. Documentation can be found here: https://taco-food-api.herokuapp.com/#api-Category-GetCategoriesList Use "item_category.xml" layout as list item. (use databinding) Load the total amount of "Food" items referenced in a category and display that information in the item.
TODO:
- Create list view
- Create Adapter & ViewHolder
- Load content from REST client
- Async update item amount per category from the local database
Access the local database [FoodDb] provided in the App assets to load "food" information. Display all food elements in a single column list view. Use paging adapters, not load all search results at once into your list. Use "item_food.xml" layout as list item.
TODOs:
- Create list view
- Create Adapter & ViewHolder
- Load paged content from database
Add a search box into the toolbar, filter local database [FoodDb] food results by the search term. Filter the search results based on "description" of a food item.
Selecting an item on SearchFoodFragment should lead to the detail screen of a food (FoodFragment). More details of a single food should be displayed on that screen, exactly like the UI/UX from Figma describes it UI components. (Font, Color, Shape, Size...) Load missing category name information from the web endpoint.
TODOs:
- Create new Fragment
- Use navigation component and safe args
- Link [SearchFoodFragment] item to open [FoodFragment]
- Build UI/UX exactly like described in Figma (free registration required) https://www.figma.com/file/5UjQCIHu8yv9si2tdBiO47/Taco---Detail?node-id=0%3A1
- Async update category name with REST API
Let the user add an Image via an ImagePicker or Camera to a single food item. The image should be stored locally and displayed when the user shows the detailed food item.
TODOs:
- Make sure to use ActivityResultContracts.
- Use an image cache library to display a picture
Request category name for this food item from web dynamically when it's shown on the detail screen. By clicking on the category the user can jump to the category detail page [CategoryFragment].
Selecting a category in the [CategoryListFragment] or from [FoodFragment] opens the [CategoryFragment], showing all foods that are added to this category. Show the category name at the top, use navigation arguments to send information between fragments. Access the food database [FoodDb] and query all foods that have the selected category, again use paging. Display preview information of a food item. Might make sense to use the same
TODOs:
- Create CategoryFragment
- Setup navigation component and safe args
- Prepare database query
- Tip: reuse [SearchFoodFragment]
If you are still hungry for more, choose one of the below bonus assignments for implementation. Happy coding!
On mobile devices, the internet might fail due to connection issues. Prepare error indications when content can't be loaded from the web.
Work with display insets and create an edge to edge feel. Top and bottom bars should fade away when scrolling in a List view. Tip: use helper library from Chris https://github.com/chrisbanes/insetter
Introduce your custom design for font, colors, small medium and large components. Tip: checkout material design guidelines https://material.io/design/material-studies/fortnightly.html#shape
Finding memory leaks is a very important task when developing high-quality apps. Make sure there is no memory leak. I might have inserted one ;-) Tip: there is a nice library for detecting leaks https://square.github.io/leakcanary/
Developing apps for all kinds of devices is essential on Android and therefore performance optimization is crucial. Initialize all necessary libraries before Application.onCreate() is executed. Move your DB initialization into a content provider, checkout this helper library https://developer.android.com/topic/libraries/app-startup
Make a single taco category accessible via url (e.g: https://taco-food-api.herokuapp.com/api/v1/category/1)
Use Material motion transitions of your choice to transform between fragments. Take a look at material components API