├── app
├── .gitignore
├── src
│ ├── test
│ │ ├── resources
│ │ │ └── mockito-extensions
│ │ │ │ └── org.mockito.plugins.MockMaker
│ │ └── java
│ │ │ └── me
│ │ │ └── jorgecastillo
│ │ │ └── kodein
│ │ │ └── GetPhotosEndToEndShould.kt
│ ├── main
│ │ ├── res
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── drawable-hdpi
│ │ │ │ ├── ic_search_white_24dp.png
│ │ │ │ ├── ic_share_white_24dp.png
│ │ │ │ ├── baseline_photo_camera_white_24.png
│ │ │ │ └── baseline_photo_library_white_24.png
│ │ │ ├── drawable-mdpi
│ │ │ │ ├── ic_search_white_24dp.png
│ │ │ │ ├── ic_share_white_24dp.png
│ │ │ │ ├── baseline_photo_camera_white_24.png
│ │ │ │ └── baseline_photo_library_white_24.png
│ │ │ ├── drawable-xhdpi
│ │ │ │ ├── ic_share_white_24dp.png
│ │ │ │ ├── ic_search_white_24dp.png
│ │ │ │ ├── baseline_photo_camera_white_24.png
│ │ │ │ └── baseline_photo_library_white_24.png
│ │ │ ├── drawable-xxhdpi
│ │ │ │ ├── ic_search_white_24dp.png
│ │ │ │ ├── ic_share_white_24dp.png
│ │ │ │ ├── baseline_photo_camera_white_24.png
│ │ │ │ └── baseline_photo_library_white_24.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ │ ├── ic_search_white_24dp.png
│ │ │ │ ├── ic_share_white_24dp.png
│ │ │ │ ├── baseline_photo_camera_white_24.png
│ │ │ │ └── baseline_photo_library_white_24.png
│ │ │ ├── xml
│ │ │ │ └── provider_paths.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── menu
│ │ │ │ ├── menu_detail.xml
│ │ │ │ └── menu_photo_list.xml
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── layout
│ │ │ │ ├── fragment_description.xml
│ │ │ │ ├── activity_photo_list.xml
│ │ │ │ ├── item_photo.xml
│ │ │ │ └── activity_detail.xml
│ │ │ ├── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── drawable
│ │ │ │ └── ic_launcher_background.xml
│ │ ├── java
│ │ │ └── me
│ │ │ │ └── jorgecastillo
│ │ │ │ └── kodein
│ │ │ │ ├── common
│ │ │ │ ├── GenericFileProvider.kt
│ │ │ │ ├── router
│ │ │ │ │ ├── Navigator.kt
│ │ │ │ │ └── PhotoAppNavigator.kt
│ │ │ │ ├── domain
│ │ │ │ │ ├── model
│ │ │ │ │ │ └── Photo.kt
│ │ │ │ │ ├── error
│ │ │ │ │ │ └── Error.kt
│ │ │ │ │ ├── interactor
│ │ │ │ │ │ ├── UseCase.kt
│ │ │ │ │ │ ├── Invoker.kt
│ │ │ │ │ │ └── UseCaseInvoker.kt
│ │ │ │ │ └── repository
│ │ │ │ │ │ ├── Policies.kt
│ │ │ │ │ │ ├── PhotosNetworkDataSource.kt
│ │ │ │ │ │ └── PhotosLocalDataSource.kt
│ │ │ │ ├── view
│ │ │ │ │ ├── ImageViewExtensions.kt
│ │ │ │ │ └── BitmapExtensions.kt
│ │ │ │ ├── log
│ │ │ │ │ ├── Logger.kt
│ │ │ │ │ └── AndroidLogger.kt
│ │ │ │ ├── data
│ │ │ │ │ ├── network
│ │ │ │ │ │ ├── http
│ │ │ │ │ │ │ ├── HttpClient.kt
│ │ │ │ │ │ │ └── HeadersInterceptor.kt
│ │ │ │ │ │ ├── mapper
│ │ │ │ │ │ │ └── PhotoMappers.kt
│ │ │ │ │ │ ├── UnsplashService.kt
│ │ │ │ │ │ ├── UnsplashPhotosDataSource.kt
│ │ │ │ │ │ └── model
│ │ │ │ │ │ │ └── Models.kt
│ │ │ │ │ └── local
│ │ │ │ │ │ └── InMemoryPhotosDataSource.kt
│ │ │ │ ├── presenter
│ │ │ │ │ └── BasePresenter.kt
│ │ │ │ └── di
│ │ │ │ │ ├── ActivityModule.kt
│ │ │ │ │ ├── InjectedActivity.kt
│ │ │ │ │ └── AppModules.kt
│ │ │ │ ├── PhotosApp.kt
│ │ │ │ ├── detail
│ │ │ │ ├── description
│ │ │ │ │ ├── DescriptionPresenter.kt
│ │ │ │ │ ├── di
│ │ │ │ │ │ └── descriptionFragmentModule.kt
│ │ │ │ │ ├── customview
│ │ │ │ │ │ └── CustomTextView.kt
│ │ │ │ │ └── DescriptionFragment.kt
│ │ │ │ ├── domain
│ │ │ │ │ └── interactor
│ │ │ │ │ │ └── GetPhoto.kt
│ │ │ │ ├── di
│ │ │ │ │ └── detailActivityModule.kt
│ │ │ │ ├── presenter
│ │ │ │ │ └── DetailPresenter.kt
│ │ │ │ └── view
│ │ │ │ │ └── DetailActivity.kt
│ │ │ │ └── photoslist
│ │ │ │ ├── domain
│ │ │ │ ├── interactor
│ │ │ │ │ └── GetPhotos.kt
│ │ │ │ └── repository
│ │ │ │ │ └── PhotosRepository.kt
│ │ │ │ ├── di
│ │ │ │ └── photoListActivityModule.kt
│ │ │ │ ├── presenter
│ │ │ │ └── PhotoListPresenter.kt
│ │ │ │ └── view
│ │ │ │ ├── PhotosAdapter.kt
│ │ │ │ └── PhotoListActivity.kt
│ │ └── AndroidManifest.xml
│ ├── androidTest
│ │ └── java
│ │ │ └── me
│ │ │ └── jorgecastillo
│ │ │ └── kodein
│ │ │ ├── OverridesRule.kt
│ │ │ ├── recyclerview
│ │ │ ├── RecyclerItemViewAssertion.java
│ │ │ └── RecyclerViewInteraction.java
│ │ │ └── PhotoListActivityShould.kt
│ └── sharedTest
│ │ └── java
│ │ └── BlockingUseCaseInvoker.kt
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── assets
├── list.png
└── detail.png
├── course
├── 1
│ ├── Slides.pdf
│ ├── Slides.md
│ └── Script.md
├── 2
│ ├── Slides.pdf
│ ├── Slides.md
│ └── Script.md
├── 3
│ └── Script.md
├── 4
│ ├── Slides.pdf
│ ├── Slides.md
│ └── Script.md
├── 5
│ ├── Slides.pdf
│ ├── Slides.md
│ └── Script.md
├── 6
│ ├── Slides.pdf
│ ├── scopes.png
│ ├── Slides.md
│ └── Script.md
├── 7
│ └── Script.md
├── 8
│ ├── Slides.pdf
│ ├── Slides.md
│ └── Script.md
├── 9
│ └── Script.md
├── 10
│ ├── Slides.pdf
│ ├── Slides.md
│ └── Script.md
├── 11
│ └── Script.md
├── 12
│ ├── detail.png
│ ├── detail_share.png
│ └── Script.md
├── 13
│ ├── Slides.pdf
│ ├── scopes.png
│ ├── scopes_app_context.png
│ ├── scopes_context_per_scope.png
│ ├── Slides.md
│ └── Script.md
├── 14
│ ├── Slides.pdf
│ ├── scopes.png
│ ├── Slides.md
│ └── Script.md
├── 15
│ ├── Slides.pdf
│ ├── scopes_custom_views.png
│ ├── Slides.md
│ └── Script.md
├── 16
│ ├── Slides.pdf
│ ├── architecture.png
│ ├── architecture_side_effects.png
│ ├── Slides.md
│ └── Script.md
└── 17
│ ├── Slides.pdf
│ ├── ui_tests.png
│ ├── ui_tests_mocks.png
│ ├── Slides.md
│ └── Script.md
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── gradle.properties
├── gradlew.bat
├── README.md
└── gradlew
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/app/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker:
--------------------------------------------------------------------------------
1 | mock-maker-inline
2 |
--------------------------------------------------------------------------------
/assets/list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/assets/list.png
--------------------------------------------------------------------------------
/assets/detail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/assets/detail.png
--------------------------------------------------------------------------------
/course/1/Slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/1/Slides.pdf
--------------------------------------------------------------------------------
/course/10/Slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/10/Slides.pdf
--------------------------------------------------------------------------------
/course/12/detail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/12/detail.png
--------------------------------------------------------------------------------
/course/13/Slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/13/Slides.pdf
--------------------------------------------------------------------------------
/course/13/scopes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/13/scopes.png
--------------------------------------------------------------------------------
/course/14/Slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/14/Slides.pdf
--------------------------------------------------------------------------------
/course/14/scopes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/14/scopes.png
--------------------------------------------------------------------------------
/course/15/Slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/15/Slides.pdf
--------------------------------------------------------------------------------
/course/16/Slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/16/Slides.pdf
--------------------------------------------------------------------------------
/course/17/Slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/17/Slides.pdf
--------------------------------------------------------------------------------
/course/2/Slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/2/Slides.pdf
--------------------------------------------------------------------------------
/course/4/Slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/4/Slides.pdf
--------------------------------------------------------------------------------
/course/5/Slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/5/Slides.pdf
--------------------------------------------------------------------------------
/course/6/Slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/6/Slides.pdf
--------------------------------------------------------------------------------
/course/6/scopes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/6/scopes.png
--------------------------------------------------------------------------------
/course/8/Slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/8/Slides.pdf
--------------------------------------------------------------------------------
/course/17/ui_tests.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/17/ui_tests.png
--------------------------------------------------------------------------------
/course/12/detail_share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/12/detail_share.png
--------------------------------------------------------------------------------
/course/16/architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/16/architecture.png
--------------------------------------------------------------------------------
/course/17/ui_tests_mocks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/17/ui_tests_mocks.png
--------------------------------------------------------------------------------
/course/13/scopes_app_context.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/13/scopes_app_context.png
--------------------------------------------------------------------------------
/course/15/scopes_custom_views.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/15/scopes_custom_views.png
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/course/13/scopes_context_per_scope.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/13/scopes_context_per_scope.png
--------------------------------------------------------------------------------
/course/16/architecture_side_effects.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/course/16/architecture_side_effects.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_search_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-hdpi/ic_search_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_share_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-hdpi/ic_share_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_search_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-mdpi/ic_search_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_share_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-mdpi/ic_share_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_share_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-xhdpi/ic_share_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_search_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-xhdpi/ic_search_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_search_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-xxhdpi/ic_search_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_share_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-xxhdpi/ic_share_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_search_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-xxxhdpi/ic_search_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_share_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-xxxhdpi/ic_share_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/baseline_photo_camera_white_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-hdpi/baseline_photo_camera_white_24.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/baseline_photo_camera_white_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-mdpi/baseline_photo_camera_white_24.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/baseline_photo_library_white_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-hdpi/baseline_photo_library_white_24.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/baseline_photo_library_white_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-mdpi/baseline_photo_library_white_24.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_photo_camera_white_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-xhdpi/baseline_photo_camera_white_24.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_photo_library_white_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-xhdpi/baseline_photo_library_white_24.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/baseline_photo_camera_white_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-xxhdpi/baseline_photo_camera_white_24.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/baseline_photo_library_white_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-xxhdpi/baseline_photo_library_white_24.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/baseline_photo_camera_white_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-xxxhdpi/baseline_photo_camera_white_24.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/baseline_photo_library_white_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JorgeCastilloPrz/AndroidKodeinSample/HEAD/app/src/main/res/drawable-xxxhdpi/baseline_photo_library_white_24.png
--------------------------------------------------------------------------------
/app/src/main/java/me/jorgecastillo/kodein/common/GenericFileProvider.kt:
--------------------------------------------------------------------------------
1 | package me.jorgecastillo.kodein.common
2 |
3 | import android.support.v4.content.FileProvider
4 |
5 | class GenericFileProvider : FileProvider()
6 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/provider_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
17 | * in compliance with the License. You may obtain a copy of the License at
18 | * http://www.apache.org/licenses/LICENSE-2.0
19 | * Unless required by applicable law or agreed to in writing, software distributed under the License
20 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
21 | * or implied. See the License for the specific language governing permissions and limitations under
22 | * the License.
23 | *
24 | * https://github.com/Karumi/KataSuperHeroesAndroid/blob/master/app/src/androidTest/java/com/karumi/katasuperheroes/recyclerview/RecyclerViewInteraction.java
25 | */
26 | public class RecyclerViewInteraction {
27 |
28 | private Matcher
49 |
50 |
--------------------------------------------------------------------------------
/course/13/Script.md:
--------------------------------------------------------------------------------
1 | # 13: "Injecting Navigation"
2 |
3 | On the previous lesson we didn't show the logics we use for navigating from one activity to another.
4 |
5 | We will need a click listener in the adapter for every item, which will just forward the click event to the presenter,
6 | as you can see here. We need to pass the photo Id, so the presenter can navigate to the detail for that given photo.
7 |
8 | But the presenter is not performing the navigation by itself, but delegating it to some other entity called Navigator.
9 |
10 | If you think about one of the main purposes of presenters, it's to put a boundary between the view implementation, and
11 | the rest of the app. That means presenters should never depend on any frameworks like the Android SDK.
12 |
13 | Navigation depends on the Android framework since it requires an Android Context, so we cannot implement it here.
14 |
15 | We will create an interface to abstract it away and inject it here. This contract will define all the navigation routes
16 | available for the app. Since this app is quite simple, it will just provide a function to navigate to the detail,
17 | which will require a photoId for it.
18 |
19 | The implementation will get a context injected so it can perform navigation as expected.
20 |
21 | But we still need to provide the navigation into the dependency injection scope. If we think about navigators, we
22 | could think that it requires an activity context to launch another activity. But that is actually not true. You can
23 | start activities using any context, like a Service or even the Application itself. That's because the startActivity
24 | method is defined in the Android Context class, so any entity extending Context will be able to start activities.
25 |
26 | That's how you can launch activities from push notification services, for example.
27 |
28 | That means the binding for the navigator will fit better on the application scope, since it can be used from many
29 | different parts of the app.
30 |
31 | (Show scopes onion graph)
32 |
33 | If we take a brief look to our dependency scopes graph, we can see the application scope is the innermost one.
34 | That means its bindings are inherited by the activity one, and the bindings from both are inherited from the
35 | fragment one.
36 |
37 | So, if we declare the navigator in the application scope, it will clearly get the application context passed in, since
38 | it's the only one visible. But what if we are in an activity scope? wouldn't we want to get the activity context
39 | automatically passed in instead of the application one?
40 |
41 | If we could define the binding in a way that leaves the context as a hole, and then provide a different implementation
42 | of the context for each scope, that should be enough. The fragment scope wouldn't need to provide any context binding
43 | since fragments are not context wrappers. It could just reuse the activity one, which will be visible since the fragment
44 | scope depends on it.
45 |
46 | But this has a new problem, hasn't it? We'll get a runtime error because there are two bindings defined for the Context
47 | type on the activity scope, given that it's extending the application scope.
48 |
49 | But there's a really cool feature from Kodein to resolve this: The Binding overrides.
50 |
51 | What we want to do is to override our application context with the activity one, but just for the activity scope. To do
52 | that, go to the `InjectedActivity` and set the allow overrides property to true when importing the module. Once you
53 | have that, go to the base activity module and mark the context binding as an override like this. And you'll be done.
54 |
55 | Any time a navigator is required, the application module will provide it fulfilling the context instance using the
56 | application context, but if we're into an activity scope, the context will be overriden by the activity one.
57 |
58 | In the same way, if we had a service, we could create a service scope that would extend from the application one,
59 | and could also override the context binding to provide the service context.
60 |
--------------------------------------------------------------------------------
/course/8/Script.md:
--------------------------------------------------------------------------------
1 | # 8: "Transitive Dependencies"
2 |
3 | We have our bindings in place for PhotoListActivity. Whenever it gets launched we'll get our instance of the presenter
4 | injected. We can do that thanks to the binding we have defined on the photoListActivityModule(). But what if we needed
5 | to go further and provide a dependency to the Presenter on construction?
6 |
7 | We'd need a way to also instantiate and provide it. And of course we can do that by declaring another binding.
8 |
9 | We'll showcase that by injecting what we call a UseCase into the presenter. Use cases, also called "interactors", are
10 | part of an architecture called Clean Architecture. Just keep in mind that they exist to pull business logic out from
11 | Presenters or ViewModels so they don't grow massively, and also as a way to make our presenter or ViewModel agnostic
12 | from any data retrieval logics.
13 |
14 | We will be using a base class UseCase to provide a contract for all of them. We will make Parameters a generic type so
15 | each use case can specify it, and the same for the return type.
16 |
17 | Whenever we run the use case, we will perform some business logic or maybe retrieve data from somewhere, and then return
18 | a result.
19 |
20 | Since any use case is an execution unit that can fail or succeed, we're returning Either a domain error or the
21 | successful return type, as you can see here. Either is just a wrapper class to provide that duality into the same type,
22 | so we can avoid using callbacks.
23 |
24 | I'm taking it from a library called Arrow, but you can just write your own, since at the end of the day it's just a
25 | sealed class with two different implementations, one for the error and another one for the success type.
26 |
27 | Note that the error represents a domain error type, which is defined as a sealed class that can take a bunch of expected
28 | errors handled by our domain.
29 |
30 | (Show GetPhotos)
31 |
32 | But lets get to the point. We want to create our use case to get the photos and return them to the presenter. To do
33 | that, we will inherit from the base one. The parameters for it are defined as a data class, as you can see. I'm
34 | providing the page to load and a query string that could be used for searching photos by category or something.
35 |
36 | Then there is the successful return type, which is going to be a list of photos (List