Android Material Design DEMO application for accessing Movie DB data using a guest account.
The application is using 3 modules:
- common (library): contains base models and utility objects
- core (library): contains internal data providers, app models and basic interfaces / response objects, and core business logic
- app: contains base UI components, their implementations and dedicated data loaders.
- release for store release
- debug for debugging the application and enabling logging
- all build types automatically generate their APK filename using the current git commit information
- prod using the production server
- dev using the debug proxy
- mock using the mock server
-
core is using Retrofit internally with GSON deserialisation. All app models are represented by interfaces and are paired with their implementations during GSON initialisation.
-
app is using an abstract data loader which converts several of the models to UI objects which hide API implementation
-
Retrieved server configuration is stored in a shared preference. This is done in order to store the Base Image URL before starting the application proper.
-
All network data loading is done in a background thread. UI loaders will run the success / error result on the UI thread automatically.
-
UI loaders take care of chaining the request to a Data Provider (acts as a facade) who chains the request to a network loader for separation of concerns.
-
Data retrieved from the network gets validated through a generic ValidatorProcessor who picks the correct Validator for each Class type and produces a ValidationResult.
-
Backend errors are converted to custom UI errors through an internal converter.
- All base components are organised in a separate package for reusability.
- Application class inititalises the Core module singleton for access to the Data Provider and Crasylytics controller.
- Activities and Fragments keep a reference to an Intent Dispatcher and an Image Fetcher (Picasso Singleton) which they provide to their view binders. Image Fetcher can take a placeholder id as a request parameter.
Configuration is being retrieved from the server during the splash screen. Shows a progress bar and a movie quote.
Error view is randomly displaying movie quotes from an author and a quote array. IF the error is recoverable, it will show a Try Again button. Components use a StateKeeper to handle their current state (loading, error, empty, content).
ViewPager: This is using a view pager with a Smart Fragment Pager Adapter with icons as tab names. Tab name will appear on the toolbar and has a short animation on switching.
Searching: Fragments implement a Searchable interface and are using a custom Searcher class to handle queries. They can be searched for multiple values such as name, year and genre.
Recyclerview with Cardviews, extends Media Fragment. Displays wrapper UI object that combines Movies with Genres through a factory. Uses an AutoFitLayout for genres.
Recyclerview with Cardviews.
Recyclerview with Cardviews, extends Media Fragment. Displays wrapper UI object that combines TvSeries with Genres through a factory.
Activity with a Collapsing Layout and a Fragment.
Activity with a Collapsing Layout and a Fragment. Reusing the Movie Details infrastructure due to time constraints, although I would have preferred to write a new screen for it
- Several utility classes have been unit tested. Time constraints did not allow for further testing.
- Collapsing bar layout will not scroll properly in the case of a lot of details. It can be fixed, but time constraints did not allow me to address the issue.
- UI should only show UI models and should not be aware of back-end implementations for separation of concerns.