├── app
├── .gitignore
├── src
│ └── main
│ │ ├── res
│ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ ├── values
│ │ │ ├── strings.xml
│ │ │ ├── dimens.xml
│ │ │ ├── styles.xml
│ │ │ └── colors.xml
│ │ ├── drawable-hdpi
│ │ │ ├── icon_category_food_raster.png
│ │ │ ├── icon_category_music_raster.png
│ │ │ ├── icon_category_history_raster.png
│ │ │ ├── icon_category_science_raster.png
│ │ │ ├── icon_category_sports_raster.png
│ │ │ ├── icon_category_tvmovies_raster.png
│ │ │ ├── icon_category_geography_raster.png
│ │ │ ├── icon_category_knowledge_raster.png
│ │ │ ├── icon_category_entertainment_raster.png
│ │ │ └── icon_category_leaderboard_raster.png
│ │ ├── drawable-mdpi
│ │ │ ├── icon_category_food_raster.png
│ │ │ ├── icon_category_music_raster.png
│ │ │ ├── icon_category_history_raster.png
│ │ │ ├── icon_category_science_raster.png
│ │ │ ├── icon_category_sports_raster.png
│ │ │ ├── icon_category_tvmovies_raster.png
│ │ │ ├── icon_category_geography_raster.png
│ │ │ ├── icon_category_knowledge_raster.png
│ │ │ ├── icon_category_entertainment_raster.png
│ │ │ └── icon_category_leaderboard_raster.png
│ │ ├── drawable-xhdpi
│ │ │ ├── image_category_food_raster.png
│ │ │ ├── image_category_music_raster.png
│ │ │ ├── image_category_sports_raster.png
│ │ │ ├── image_category_history_raster.png
│ │ │ ├── image_category_science_raster.png
│ │ │ ├── image_category_tvmovies_raster.png
│ │ │ ├── image_category_geography_raster.png
│ │ │ ├── image_category_knowledge_raster.png
│ │ │ └── image_category_entertainment_raster.png
│ │ ├── drawable-xxhdpi
│ │ │ ├── image_category_food_raster.png
│ │ │ ├── image_category_music_raster.png
│ │ │ ├── image_category_history_raster.png
│ │ │ ├── image_category_science_raster.png
│ │ │ ├── image_category_sports_raster.png
│ │ │ ├── image_category_geography_raster.png
│ │ │ ├── image_category_knowledge_raster.png
│ │ │ ├── image_category_tvmovies_raster.png
│ │ │ └── image_category_entertainment_raster.png
│ │ ├── drawable-xxxhdpi
│ │ │ ├── image_category_food_raster.png
│ │ │ ├── image_category_music_raster.png
│ │ │ ├── image_category_sports_raster.png
│ │ │ ├── image_category_geography_raster.png
│ │ │ ├── image_category_history_raster.png
│ │ │ ├── image_category_knowledge_raster.png
│ │ │ ├── image_category_science_raster.png
│ │ │ ├── image_category_tvmovies_raster.png
│ │ │ └── image_category_entertainment_raster.png
│ │ ├── values-w820dp
│ │ │ └── dimens.xml
│ │ ├── drawable
│ │ │ ├── icon_category_food.xml
│ │ │ ├── icon_category_history.xml
│ │ │ ├── icon_category_music.xml
│ │ │ ├── icon_category_science.xml
│ │ │ ├── icon_category_sports.xml
│ │ │ ├── icon_category_geography.xml
│ │ │ ├── icon_category_knowledge.xml
│ │ │ ├── icon_category_tvmovies.xml
│ │ │ ├── icon_category_leaderboard.xml
│ │ │ └── icon_category_entertainment.xml
│ │ └── layout
│ │ │ ├── item_category.xml
│ │ │ └── activity_category.xml
│ │ ├── java
│ │ └── io
│ │ │ └── github
│ │ │ └── erikjhordanrey
│ │ │ └── dagger2
│ │ │ ├── category
│ │ │ ├── model
│ │ │ │ ├── Callback.java
│ │ │ │ ├── Category.java
│ │ │ │ └── Categories.java
│ │ │ ├── view
│ │ │ │ ├── presenter
│ │ │ │ │ ├── Presenter.java
│ │ │ │ │ └── CategoryPresenter.java
│ │ │ │ └── activity
│ │ │ │ │ └── CategoryActivity.java
│ │ │ └── adapter
│ │ │ │ ├── CategoryViewHolder.java
│ │ │ │ └── CategoryAdapter.java
│ │ │ ├── di
│ │ │ ├── ActivityScope.java
│ │ │ ├── module
│ │ │ │ ├── InteractorsModule.java
│ │ │ │ └── CategoryModule.java
│ │ │ └── component
│ │ │ │ ├── AppComponent.java
│ │ │ │ └── CategoryComponent.java
│ │ │ ├── common
│ │ │ └── BaseActivity.java
│ │ │ ├── CategoryApplication.java
│ │ │ └── widget
│ │ │ └── ResponsiveRecyclerView.java
│ │ └── AndroidManifest.xml
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── art
└── 2015-12-15.png
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── .travis.yml
├── gradle.properties
├── README.md
├── gradlew.bat
└── gradlew
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/art/2015-12-15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/art/2015-12-15.png
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | .DS_Store
4 | /build
5 | /captures
6 | **.iml
7 | /.idea
8 | sdcard
9 | sdcard.lock
10 | libs/
11 | .idea/
12 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Topekita
3 | Category
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/icon_category_food_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-hdpi/icon_category_food_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/icon_category_music_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-hdpi/icon_category_music_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/icon_category_food_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-mdpi/icon_category_food_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/icon_category_music_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-mdpi/icon_category_music_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/icon_category_history_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-hdpi/icon_category_history_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/icon_category_science_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-hdpi/icon_category_science_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/icon_category_sports_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-hdpi/icon_category_sports_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/icon_category_tvmovies_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-hdpi/icon_category_tvmovies_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/icon_category_history_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-mdpi/icon_category_history_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/icon_category_science_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-mdpi/icon_category_science_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/icon_category_sports_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-mdpi/icon_category_sports_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/icon_category_tvmovies_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-mdpi/icon_category_tvmovies_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/image_category_food_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xhdpi/image_category_food_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/image_category_music_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xhdpi/image_category_music_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/image_category_sports_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xhdpi/image_category_sports_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/image_category_food_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxhdpi/image_category_food_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/image_category_music_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxhdpi/image_category_music_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/image_category_food_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxxhdpi/image_category_food_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/icon_category_geography_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-hdpi/icon_category_geography_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/icon_category_knowledge_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-hdpi/icon_category_knowledge_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/icon_category_geography_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-mdpi/icon_category_geography_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/icon_category_knowledge_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-mdpi/icon_category_knowledge_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/image_category_history_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xhdpi/image_category_history_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/image_category_science_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xhdpi/image_category_science_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/image_category_tvmovies_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xhdpi/image_category_tvmovies_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/image_category_history_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxhdpi/image_category_history_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/image_category_science_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxhdpi/image_category_science_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/image_category_sports_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxhdpi/image_category_sports_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/image_category_music_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxxhdpi/image_category_music_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/image_category_sports_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxxhdpi/image_category_sports_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/icon_category_entertainment_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-hdpi/icon_category_entertainment_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/icon_category_leaderboard_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-hdpi/icon_category_leaderboard_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/icon_category_entertainment_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-mdpi/icon_category_entertainment_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/icon_category_leaderboard_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-mdpi/icon_category_leaderboard_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/image_category_geography_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xhdpi/image_category_geography_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/image_category_knowledge_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xhdpi/image_category_knowledge_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/image_category_geography_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxhdpi/image_category_geography_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/image_category_knowledge_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxhdpi/image_category_knowledge_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/image_category_tvmovies_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxhdpi/image_category_tvmovies_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/image_category_geography_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxxhdpi/image_category_geography_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/image_category_history_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxxhdpi/image_category_history_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/image_category_knowledge_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxxhdpi/image_category_knowledge_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/image_category_science_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxxhdpi/image_category_science_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/image_category_tvmovies_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxxhdpi/image_category_tvmovies_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/image_category_entertainment_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xhdpi/image_category_entertainment_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/image_category_entertainment_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxhdpi/image_category_entertainment_raster.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/image_category_entertainment_raster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/erikjhordan-rey/Dagger2-MVP-Sample/HEAD/app/src/main/res/drawable-xxxhdpi/image_category_entertainment_raster.png
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Jul 15 14:29:46 CDT 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 | 16dp
7 |
8 | 40dp
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: android
2 | dist: trusty
3 | jdk: oraclejdk8
4 |
5 | env:
6 | global:
7 | - ADB_INSTALL_TIMEOUT=8
8 |
9 | android:
10 | components:
11 | - tools
12 | - platform-tools
13 | - build-tools-29.0.2
14 | - android-29
15 | - extra-android-support
16 | - extra-google-google_play_services
17 | - extra-google-m2repository
18 | - extra-android-m2repository
19 |
20 | licenses:
21 | - 'android-sdk-license-.+'
22 | - 'google-gdk-license-.+'
23 | - 'android-sdk-preview-license-.+'
24 |
25 | script:
26 | - ./gradlew assemble
27 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Applications/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_category_food.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_category_history.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_category_music.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_category_science.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_category_sports.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_category_geography.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_category_knowledge.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_category_tvmovies.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_category_leaderboard.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icon_category_entertainment.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/category/model/Callback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Erik Jhordan Rey.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.github.erikjhordanrey.dagger2.category.model;
18 |
19 | import java.util.List;
20 |
21 | public interface Callback {
22 | void onLoadCategories(List categories);
23 | }
24 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
10 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
11 | # When configured, Gradle will run in incubating parallel mode.
12 | # This option should only be used with decoupled projects. More details, visit
13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
14 | # org.gradle.parallel=true
15 | android.enableJetifier=true
16 | android.useAndroidX=true
17 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/di/ActivityScope.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Erik Jhordan Rey.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.github.erikjhordanrey.dagger2.di;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import javax.inject.Scope;
22 |
23 | @Scope @Retention(RetentionPolicy.RUNTIME) public @interface ActivityScope {
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/category/view/presenter/Presenter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Erik Jhordan Rey.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.github.erikjhordanrey.dagger2.category.view.presenter;
18 |
19 | import io.github.erikjhordanrey.dagger2.category.model.Category;
20 |
21 | public interface Presenter {
22 |
23 | void onResume();
24 |
25 | void onItemSelected(Category category, int position);
26 | }
27 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 29
5 | defaultConfig {
6 | applicationId "io.github.erikjhordanrey.dagger2"
7 | minSdkVersion 17
8 | targetSdkVersion 29
9 | versionCode 1
10 | versionName "1.0"
11 | }
12 |
13 | compileOptions {
14 | sourceCompatibility JavaVersion.VERSION_1_8
15 | targetCompatibility JavaVersion.VERSION_1_8
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 |
25 | buildFeatures {
26 | viewBinding = true
27 | }
28 | }
29 |
30 | dependencies {
31 |
32 | implementation "androidx.appcompat:appcompat:1.1.0"
33 | implementation "androidx.recyclerview:recyclerview:1.1.0"
34 |
35 | annotationProcessor 'com.google.dagger:dagger-compiler:2.25.4'
36 | implementation 'com.google.dagger:dagger:2.27'
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/di/module/InteractorsModule.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2015 Erik Jhordan Rey. Licensed under the Apache License, Version 2.0 (the
3 | * "License"); you may not use this file except in compliance with the License. You may obtain a
4 | * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
5 | * applicable law or agreed to in writing, software distributed under the License is distributed on
6 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
7 | * the License for the specific language governing permissions and limitations under the License.
8 | */
9 |
10 | package io.github.erikjhordanrey.dagger2.di.module;
11 |
12 | import dagger.Module;
13 | import dagger.Provides;
14 | import io.github.erikjhordanrey.dagger2.category.model.Categories;
15 |
16 | @Module
17 | public class InteractorsModule {
18 |
19 | @Provides
20 | Categories provideFindItemsInteractor() {
21 | return new Categories();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_category.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
17 |
18 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #00bad2
4 | #00a3b8
5 | #FF4081
6 |
7 |
8 | #ffffff
9 | #fff0f0f0
10 | #41000000
11 |
12 |
13 | #212121
14 | #727272
15 |
16 |
17 | #03a9f4
18 | #84ffff
19 |
20 | #1de9b6
21 | #b9f6ca
22 |
23 | #7e57c2
24 | #b388ff
25 |
26 | #ff5252
27 | #ff8a80
28 |
29 | #ffeb3b
30 | #ffff8d
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/di/component/AppComponent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Erik Jhordan Rey.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.github.erikjhordanrey.dagger2.di.component;
18 |
19 | import dagger.Component;
20 | import io.github.erikjhordanrey.dagger2.category.model.Categories;
21 | import io.github.erikjhordanrey.dagger2.di.module.InteractorsModule;
22 | import javax.inject.Singleton;
23 |
24 | @Singleton
25 | @Component(modules = {InteractorsModule.class})
26 | public interface AppComponent {
27 |
28 | Categories getFindItemsInteractor();
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/category/adapter/CategoryViewHolder.java:
--------------------------------------------------------------------------------
1 | package io.github.erikjhordanrey.dagger2.category.adapter;
2 |
3 | import androidx.annotation.NonNull;
4 | import static androidx.core.content.ContextCompat.getColor;
5 | import androidx.recyclerview.widget.RecyclerView;
6 | import io.github.erikjhordanrey.dagger2.category.model.Category;
7 | import gdg.androidtitlan.dagger2.databinding.ItemCategoryBinding;
8 |
9 | class CategoryViewHolder extends RecyclerView.ViewHolder {
10 |
11 | private ItemCategoryBinding binding;
12 |
13 | CategoryViewHolder(@NonNull ItemCategoryBinding binding) {
14 | super(binding.getRoot());
15 | this.binding = binding;
16 | }
17 |
18 | void bind(Category category) {
19 | binding.labelCategoryName.setText(category.getName());
20 | binding.labelCategoryName.setBackgroundColor(getColor(binding.labelCategoryName.getContext(), category.getPrimaryColor()));
21 | binding.imageCategoryIcon.setImageResource(category.getIcon());
22 | binding.imageCategoryIcon.setBackgroundColor(getColor(binding.imageCategoryIcon.getContext(), category.getBackgroundColor()));
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_category.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
14 |
15 |
18 |
19 |
22 |
23 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/common/BaseActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Erik Jhordan Rey.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.github.erikjhordanrey.dagger2.common;
18 |
19 | import android.os.Bundle;
20 |
21 | import androidx.appcompat.app.AppCompatActivity;
22 |
23 | import io.github.erikjhordanrey.dagger2.CategoryApplication;
24 | import io.github.erikjhordanrey.dagger2.di.component.AppComponent;
25 |
26 | public abstract class BaseActivity extends AppCompatActivity {
27 |
28 | @Override protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setupComponent(CategoryApplication.get(this).component());
31 | }
32 |
33 | protected abstract void setupComponent(AppComponent appComponent);
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/di/component/CategoryComponent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Erik Jhordan Rey.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.github.erikjhordanrey.dagger2.di.component;
18 |
19 | import dagger.Component;
20 | import io.github.erikjhordanrey.dagger2.category.view.activity.CategoryActivity;
21 | import io.github.erikjhordanrey.dagger2.category.view.presenter.Presenter;
22 | import io.github.erikjhordanrey.dagger2.di.ActivityScope;
23 | import io.github.erikjhordanrey.dagger2.di.module.CategoryModule;
24 |
25 | @ActivityScope
26 | @Component(dependencies = AppComponent.class, modules = CategoryModule.class)
27 | public interface CategoryComponent {
28 | void inject(CategoryActivity categoryActivity);
29 |
30 | Presenter getMainPresenter();
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/category/model/Category.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Erik Jhordan Rey.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.github.erikjhordanrey.dagger2.category.model;
18 |
19 | public class Category {
20 |
21 | private String mName;
22 | private int mIcon;
23 | private int mBackgroundColor;
24 | private int mPrimaryColor;
25 |
26 | Category(String mName, int mIcon, int mBackgroundColor, int mPrimaryColor) {
27 | this.mName = mName;
28 | this.mIcon = mIcon;
29 | this.mBackgroundColor = mBackgroundColor;
30 | this.mPrimaryColor = mPrimaryColor;
31 | }
32 |
33 | public String getName() {
34 | return mName;
35 | }
36 |
37 | public int getIcon() {
38 | return mIcon;
39 | }
40 |
41 | public int getBackgroundColor() {
42 | return mBackgroundColor;
43 | }
44 |
45 | public int getPrimaryColor() {
46 | return mPrimaryColor;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/CategoryApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Erik Jhordan Rey.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.github.erikjhordanrey.dagger2;
18 |
19 | import android.app.Application;
20 | import android.content.Context;
21 | import io.github.erikjhordanrey.dagger2.di.component.AppComponent;
22 | import io.github.erikjhordanrey.dagger2.di.component.DaggerAppComponent;
23 |
24 | public class CategoryApplication extends Application {
25 |
26 | private AppComponent component;
27 |
28 | public static CategoryApplication get(Context context) {
29 | return (CategoryApplication) context.getApplicationContext();
30 | }
31 |
32 | @Override
33 | public void onCreate() {
34 | super.onCreate();
35 | setupGraph();
36 | }
37 |
38 | private void setupGraph() {
39 | component = DaggerAppComponent.builder().build();
40 | }
41 |
42 | public AppComponent component() {
43 | return component;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/di/module/CategoryModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Erik Jhordan Rey.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.github.erikjhordanrey.dagger2.di.module;
18 |
19 | import dagger.Module;
20 | import dagger.Provides;
21 | import io.github.erikjhordanrey.dagger2.category.model.Categories;
22 | import io.github.erikjhordanrey.dagger2.category.view.presenter.CategoryPresenter;
23 | import io.github.erikjhordanrey.dagger2.category.view.presenter.Presenter;
24 |
25 | @Module
26 | public class CategoryModule {
27 |
28 | private CategoryPresenter.View view;
29 |
30 | public CategoryModule(CategoryPresenter.View view) {
31 | this.view = view;
32 | }
33 |
34 | @Provides
35 | CategoryPresenter.View provideView() {
36 | return view;
37 | }
38 |
39 | @Provides
40 | Presenter providePresenter(CategoryPresenter.View categoryView, Categories categories) {
41 | return new CategoryPresenter(categoryView, categories);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Dagger2-MVP-Sample [](https://travis-ci.org/erikjhordan-rey/Dagger2-MVP-Sample)
2 |
3 | Example Dagger 2 using the MVP pattern to show how to use dagger library and inside MVP pattern in our android applications.
4 |
5 | Inspired in googlesamples / [android-topeka](https://github.com/googlesamples/android-topeka)
6 |
7 | ## Do you want to learn Dagger2 ?
8 |
9 | MarioKart Kata for Android Developers The main goal is to practice Dependency injection using Dagger 2.
10 |
11 | * [Source Code - MarioKart Kata Dagger 2](https://github.com/erikjhordan-rey/Kata-Dagger2-MarioKart)
12 | * [BlogPost - MarioKart Kata Dagger 2](https://erikjhordan-rey.github.io/blog/2016/07/07/ANDROID-kata-dagger2.html) (spanish)
13 |
14 |
15 | Libraries used on the sample project
16 | ------------------------------------
17 | * [Dagger 2][2]
18 |
19 |
20 | ## Demo
21 |
22 | 
23 |
24 |
25 | Do you want to contribute?
26 | --------------------------
27 |
28 | Feel free to report or add any useful feature, I will be glad to improve it with your help.
29 |
30 |
31 | Developed By
32 | ------------
33 |
34 | * Erik Jhordan Rey -
35 |
36 |
37 | License
38 | -------
39 |
40 | Copyright 2016 Erik Jhordan Rey
41 |
42 | Licensed under the Apache License, Version 2.0 (the "License");
43 | you may not use this file except in compliance with the License.
44 | You may obtain a copy of the License at
45 |
46 | http://www.apache.org/licenses/LICENSE-2.0
47 |
48 | Unless required by applicable law or agreed to in writing, software
49 | distributed under the License is distributed on an "AS IS" BASIS,
50 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
51 | See the License for the specific language governing permissions and
52 | limitations under the License.
53 |
54 | [2]: https://github.com/google/dagger
55 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/category/view/presenter/CategoryPresenter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Erik Jhordan Rey.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.github.erikjhordanrey.dagger2.category.view.presenter;
18 |
19 | import io.github.erikjhordanrey.dagger2.category.model.Callback;
20 | import io.github.erikjhordanrey.dagger2.category.model.Categories;
21 | import io.github.erikjhordanrey.dagger2.category.model.Category;
22 | import java.util.List;
23 |
24 | public class CategoryPresenter implements Presenter, Callback {
25 |
26 | private View view;
27 | private Categories categories;
28 |
29 | public CategoryPresenter(View view, Categories categories) {
30 | this.view = view;
31 | this.categories = categories;
32 | }
33 |
34 | @Override
35 | public void onResume() {
36 | view.showProgress();
37 | categories.getCategories(this);
38 | }
39 |
40 | @Override
41 | public void onItemSelected(Category category, int position) {
42 | view.showMessage(String.format(category.getName() + " ->" + " Position %d clicked", position));
43 | }
44 |
45 | @Override
46 | public void onLoadCategories(List categories) {
47 | view.showCategories(categories);
48 | view.hideProgress();
49 | }
50 |
51 | public interface View {
52 |
53 | void showProgress();
54 |
55 | void hideProgress();
56 |
57 | void showCategories(List categories);
58 |
59 | void showMessage(String message);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/widget/ResponsiveRecyclerView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Erik Jhordan Rey.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package io.github.erikjhordanrey.dagger2.widget;
17 |
18 | import android.content.Context;
19 | import android.content.res.TypedArray;
20 | import android.util.AttributeSet;
21 |
22 | import androidx.recyclerview.widget.GridLayoutManager;
23 | import androidx.recyclerview.widget.RecyclerView;
24 |
25 | public class ResponsiveRecyclerView extends RecyclerView {
26 | private GridLayoutManager manager;
27 | private int columnWidth = -1;
28 |
29 | public ResponsiveRecyclerView(Context context) {
30 | super(context);
31 | init(context, null);
32 | }
33 |
34 | public ResponsiveRecyclerView(Context context, AttributeSet attrs) {
35 | super(context, attrs);
36 | init(context, attrs);
37 | }
38 |
39 | public ResponsiveRecyclerView(Context context, AttributeSet attrs, int defStyle) {
40 | super(context, attrs, defStyle);
41 | init(context, attrs);
42 | }
43 |
44 | private void init(Context context, AttributeSet attrs) {
45 | if (attrs != null) {
46 | int[] attrsArray = {
47 | android.R.attr.columnWidth
48 | };
49 | TypedArray array = context.obtainStyledAttributes(attrs, attrsArray);
50 | columnWidth = array.getDimensionPixelSize(0, -1);
51 | array.recycle();
52 | }
53 |
54 | manager = new GridLayoutManager(getContext(), 1);
55 | setLayoutManager(manager);
56 | }
57 |
58 | @Override
59 | protected void onMeasure(int widthSpec, int heightSpec) {
60 | super.onMeasure(widthSpec, heightSpec);
61 | if (columnWidth > 0) {
62 | int spanCount = Math.max(1, getMeasuredWidth() / columnWidth);
63 | manager.setSpanCount(spanCount);
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/category/adapter/CategoryAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Erik Jhordan Rey.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.github.erikjhordanrey.dagger2.category.adapter;
18 |
19 | import android.view.LayoutInflater;
20 | import android.view.ViewGroup;
21 | import androidx.annotation.NonNull;
22 | import androidx.recyclerview.widget.RecyclerView;
23 | import io.github.erikjhordanrey.dagger2.category.model.Category;
24 | import gdg.androidtitlan.dagger2.databinding.ItemCategoryBinding;
25 | import java.util.Collections;
26 | import java.util.List;
27 |
28 | public class CategoryAdapter extends RecyclerView.Adapter {
29 |
30 | private List categories;
31 | private ItemClickListener itemClickListener;
32 |
33 | public CategoryAdapter() {
34 | categories = Collections.emptyList();
35 | }
36 |
37 | @NonNull
38 | @Override
39 | public CategoryViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
40 | return new CategoryViewHolder(ItemCategoryBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
41 | }
42 |
43 | @Override
44 | public void onBindViewHolder(@NonNull CategoryViewHolder holder, final int position) {
45 | final Category category = categories.get(position);
46 | holder.bind(category);
47 | holder.itemView.setOnClickListener(v -> {
48 | if (itemClickListener != null) itemClickListener.onItemClick(category, position);
49 | });
50 | }
51 |
52 | @Override
53 | public int getItemCount() {
54 | return categories.size();
55 | }
56 |
57 | public void setCategories(List categories) {
58 | this.categories = categories;
59 | }
60 |
61 | public void setItemClickListener(ItemClickListener itemClickListener) {
62 | this.itemClickListener = itemClickListener;
63 | }
64 |
65 | public interface ItemClickListener {
66 | void onItemClick(Category category, int position);
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/category/model/Categories.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Erik Jhordan Rey.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.github.erikjhordanrey.dagger2.category.model;
18 |
19 | import android.os.Handler;
20 | import gdg.androidtitlan.dagger2.R;
21 | import java.util.ArrayList;
22 | import java.util.List;
23 |
24 | public class Categories {
25 |
26 | public void getCategories(final Callback callback) {
27 | final int DELEAY_MILLIS = 2000;
28 | new Handler().postDelayed(() -> callback.onLoadCategories(createArrayList()), DELEAY_MILLIS);
29 | }
30 |
31 | private List createArrayList() {
32 |
33 | List categories = new ArrayList<>();
34 |
35 | categories.add(
36 | new Category("Food & Drink", R.drawable.icon_category_food, R.color.theme_green_background,
37 | R.color.theme_green_primary));
38 | categories.add(new Category("General Knowledge", R.drawable.icon_category_knowledge,
39 | R.color.theme_yellow_background, R.color.theme_yellow_primary));
40 | categories.add(
41 | new Category("History", R.drawable.icon_category_history, R.color.theme_blue_background,
42 | R.color.theme_blue_primary));
43 | categories.add(
44 | new Category("Geography", R.drawable.icon_category_geography, R.color.theme_red_background,
45 | R.color.theme_red_primary));
46 | categories.add(new Category("Science and Nature", R.drawable.icon_category_science,
47 | R.color.theme_green_background, R.color.theme_green_primary));
48 | categories.add(new Category("TV & Movies", R.drawable.icon_category_tvmovies,
49 | R.color.theme_purple_background, R.color.theme_purple_primary));
50 | categories.add(
51 | new Category("Music", R.drawable.icon_category_science, R.color.theme_blue_background,
52 | R.color.theme_blue_primary));
53 | categories.add(new Category("Entertainment", R.drawable.icon_category_entertainment,
54 | R.color.theme_red_background, R.color.theme_red_primary));
55 | categories.add(
56 | new Category("Sports", R.drawable.icon_category_sports, R.color.theme_purple_background,
57 | R.color.theme_purple_primary));
58 |
59 | return categories;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/src/main/java/io/github/erikjhordanrey/dagger2/category/view/activity/CategoryActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Erik Jhordan Rey.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package io.github.erikjhordanrey.dagger2.category.view.activity;
18 |
19 | import android.os.Bundle;
20 | import android.view.View;
21 | import android.widget.Toast;
22 | import androidx.appcompat.app.ActionBar;
23 | import io.github.erikjhordanrey.dagger2.category.adapter.CategoryAdapter;
24 | import io.github.erikjhordanrey.dagger2.category.model.Category;
25 | import io.github.erikjhordanrey.dagger2.category.view.presenter.CategoryPresenter;
26 | import io.github.erikjhordanrey.dagger2.category.view.presenter.Presenter;
27 | import io.github.erikjhordanrey.dagger2.common.BaseActivity;
28 | import gdg.androidtitlan.dagger2.databinding.ActivityCategoryBinding;
29 | import io.github.erikjhordanrey.dagger2.di.component.AppComponent;
30 | import io.github.erikjhordanrey.dagger2.di.component.DaggerCategoryComponent;
31 | import io.github.erikjhordanrey.dagger2.di.module.CategoryModule;
32 | import java.util.List;
33 | import javax.inject.Inject;
34 |
35 | public class CategoryActivity extends BaseActivity implements CategoryPresenter.View, CategoryAdapter.ItemClickListener {
36 |
37 | private ActivityCategoryBinding binding;
38 | private CategoryAdapter categoryAdapter = new CategoryAdapter();
39 |
40 | @Inject
41 | Presenter presenter;
42 |
43 | @Override
44 | protected void setupComponent(AppComponent appComponent) {
45 | DaggerCategoryComponent.builder()
46 | .appComponent(appComponent)
47 | .categoryModule(new CategoryModule(this))
48 | .build()
49 | .inject(this);
50 | }
51 |
52 | @Override
53 | protected void onCreate(Bundle savedInstanceState) {
54 | super.onCreate(savedInstanceState);
55 | binding = ActivityCategoryBinding.inflate(getLayoutInflater());
56 | setContentView(binding.getRoot());
57 | initViews();
58 | setUpToolbar();
59 | }
60 |
61 | @Override
62 | protected void onResume() {
63 | super.onResume();
64 | presenter.onResume();
65 | }
66 |
67 | @Override
68 | public void showProgress() {
69 | binding.progress.setVisibility(View.VISIBLE);
70 | binding.rvCategorys.setVisibility(View.INVISIBLE);
71 | }
72 |
73 | @Override
74 | public void hideProgress() {
75 | binding.progress.setVisibility(View.INVISIBLE);
76 | binding.rvCategorys.setVisibility(View.VISIBLE);
77 | }
78 |
79 | @Override
80 | public void showCategories(List items) {
81 | categoryAdapter.setCategories(items);
82 | categoryAdapter.setItemClickListener(this);
83 | binding.rvCategorys.setAdapter(categoryAdapter);
84 | }
85 |
86 | @Override
87 | public void showMessage(String message) {
88 | Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
89 | }
90 |
91 | private void initViews() {
92 | setSupportActionBar(binding.toolbar);
93 | }
94 |
95 | private void setUpToolbar() {
96 | ActionBar actionBar = getSupportActionBar();
97 | if (actionBar != null) {
98 | actionBar.setDisplayHomeAsUpEnabled(false);
99 | actionBar.setDisplayShowTitleEnabled(true);
100 | }
101 | }
102 |
103 | @Override
104 | public void onItemClick(Category category, int position) {
105 | presenter.onItemSelected(category, position);
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------