Samples and links from my blog post regarding the state of Fragments in 2017.
To build, install and run a debug version, run this from the root of the project:
./gradlew assembleDebug
The sample code I have provided essentially doing the same thing in many different ways. This is a master -> detail example that displays a github user's repository and allows you to drill into the details.
All of the modules in this repository share code from the Common
module. This module has various components such as:
- ApplicationComponent - Base Dagger 2 application component which provides scoped instances of the GitHubApi and OkHttpClient.
- BaseApplication - Creates and stores the base Dagger 2 application component.
- Adapters - RecyclerView adapters that are shared amongst all the sample modules.
Each project implements a GITHUB_OWNER
key in their build.gradle file. This is the value passed into the GitHub api's call. Here's an example.