├── .github ├── CODEOWNERS ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── Bug_report.md │ └── Feature_request.md └── pull_request_template.md ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── build.gradle ├── common-ui ├── .gitignore ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── skydoves │ │ └── common_ui │ │ ├── MovieGlide.kt │ │ ├── PosterPath.kt │ │ ├── adapters │ │ ├── MovieFavouriteDiffCallback.kt │ │ ├── MovieFavouriteListAdapter.kt │ │ ├── MovieListAdapter.kt │ │ ├── PeopleAdapter.kt │ │ ├── ReviewListAdapter.kt │ │ ├── TvFavouriteDiffCallback.kt │ │ ├── TvFavouriteListAdapter.kt │ │ ├── TvListAdapter.kt │ │ └── VideoListAdapter.kt │ │ ├── bindings │ │ ├── CustomViewBindings.kt │ │ ├── GlobalBindings.kt │ │ ├── ModelBindings.kt │ │ ├── RecyclerViewBindings.kt │ │ └── ViewHolderBindings.kt │ │ ├── customs │ │ └── FlourishFactory.kt │ │ ├── extensions │ │ ├── ActivityExtensions.kt │ │ ├── ContextExtensions.kt │ │ ├── Extensions.kt │ │ └── ViewExtensions.kt │ │ └── viewholders │ │ ├── BindingLazy.kt │ │ ├── MovieFavouriteListViewHolder.kt │ │ ├── MovieListViewHolder.kt │ │ ├── PeopleViewHolder.kt │ │ ├── ReviewListViewHolder.kt │ │ ├── TvFavouriteListViewHolder.kt │ │ ├── TvListViewHolder.kt │ │ └── VideoListViewHolder.kt │ └── res │ ├── drawable-hdpi │ ├── ic_arrow_back.png │ ├── ic_arrow_down.png │ ├── ic_arrow_up.png │ ├── ic_heart.png │ ├── ic_heart_border.png │ ├── ic_movie.png │ ├── ic_star.png │ └── ic_tv.png │ ├── drawable-mdpi │ ├── ic_arrow_back.png │ ├── ic_arrow_down.png │ ├── ic_arrow_up.png │ ├── ic_heart.png │ ├── ic_heart_border.png │ ├── ic_movie.png │ ├── ic_star.png │ └── ic_tv.png │ ├── drawable-xhdpi │ ├── ic_arrow_back.png │ ├── ic_arrow_down.png │ ├── ic_arrow_up.png │ ├── ic_heart.png │ ├── ic_heart_border.png │ ├── ic_movie.png │ ├── ic_star.png │ └── ic_tv.png │ ├── drawable-xxhdpi │ ├── ic_arrow_back.png │ ├── ic_arrow_down.png │ ├── ic_arrow_up.png │ ├── ic_heart.png │ ├── ic_heart_border.png │ ├── ic_movie.png │ ├── ic_star.png │ └── ic_tv.png │ ├── drawable-xxxhdpi │ ├── ic_arrow_back.png │ ├── ic_arrow_down.png │ ├── ic_arrow_up.png │ ├── ic_heart.png │ ├── ic_heart_border.png │ ├── ic_movie.png │ └── ic_star.png │ ├── drawable │ ├── icon_youtube.png │ └── not_found.jpg │ ├── layout │ ├── item_movie.xml │ ├── item_movie_favourite.xml │ ├── item_person.xml │ ├── item_review.xml │ ├── item_tv.xml │ ├── item_tv_favourite.xml │ └── item_video.xml │ ├── values-v21 │ └── styles.xml │ └── values │ ├── colors.xml │ ├── strings.xml │ └── styles.xml ├── dependencies.gradle ├── entity ├── .gitignore ├── build.gradle ├── schemas │ └── com.skydoves.entity.database.AppDatabase │ │ ├── 1.json │ │ ├── 2.json │ │ └── 3.json └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── skydoves │ │ │ └── entity │ │ │ ├── Keyword.kt │ │ │ ├── NetworkResponseModel.kt │ │ │ ├── Review.kt │ │ │ ├── Video.kt │ │ │ ├── converters │ │ │ ├── IntegerListConverter.kt │ │ │ ├── KeywordListConverter.kt │ │ │ ├── ReviewListConverter.kt │ │ │ ├── StringListConverter.kt │ │ │ └── VideoListConverter.kt │ │ │ ├── database │ │ │ ├── AppDatabase.kt │ │ │ ├── MovieDao.kt │ │ │ ├── PeopleDao.kt │ │ │ ├── TvDao.kt │ │ │ └── migrations │ │ │ │ ├── Migration1_2.kt │ │ │ │ └── Migration2_3.kt │ │ │ ├── entities │ │ │ ├── Movie.kt │ │ │ ├── Person.kt │ │ │ └── Tv.kt │ │ │ └── response │ │ │ ├── DiscoverMovieResponse.kt │ │ │ ├── DiscoverTvResponse.kt │ │ │ ├── KeywordListResponse.kt │ │ │ ├── PeopleResponse.kt │ │ │ ├── PersonDetail.kt │ │ │ ├── ReviewListResponse.kt │ │ │ └── VideoListResponse.kt │ └── res │ │ └── values │ │ └── strings.xml │ └── test │ └── java │ └── com │ └── skydoves │ └── entity │ ├── LocalDatabase.kt │ ├── MigrationTest.kt │ ├── MovieDaoTest.kt │ ├── PeopleDaoTest.kt │ └── TvDaoTest.kt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── mvvm-coroutines ├── .gitignore ├── build.gradle └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── skydoves │ │ │ └── mvvm_coroutines │ │ │ ├── App.kt │ │ │ ├── base │ │ │ ├── DatabindingActivity.kt │ │ │ ├── DatabindingFragment.kt │ │ │ └── LiveCoroutinesViewModel.kt │ │ │ ├── di │ │ │ ├── NetworkModule.kt │ │ │ ├── PersistenceModule.kt │ │ │ ├── RepositoryModule.kt │ │ │ └── ViewModelModule.kt │ │ │ ├── repository │ │ │ ├── DiscoverRepository.kt │ │ │ ├── MovieRepository.kt │ │ │ ├── PeopleRepository.kt │ │ │ ├── Repository.kt │ │ │ └── TvRepository.kt │ │ │ └── ui │ │ │ ├── details │ │ │ ├── movie │ │ │ │ ├── MovieDetailActivity.kt │ │ │ │ └── MovieDetailViewModel.kt │ │ │ ├── person │ │ │ │ ├── PersonDetailActivity.kt │ │ │ │ └── PersonDetailViewModel.kt │ │ │ └── tv │ │ │ │ ├── TvDetailActivity.kt │ │ │ │ └── TvDetailViewModel.kt │ │ │ └── main │ │ │ ├── MainActivity.kt │ │ │ ├── MainActivityViewModel.kt │ │ │ ├── MainPagerAdapter.kt │ │ │ ├── MovieListFragment.kt │ │ │ ├── PersonListFragment.kt │ │ │ └── TvListFragment.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── activity_movie_detail.xml │ │ ├── activity_person_detail.xml │ │ ├── activity_tv_detail.xml │ │ ├── fragment_movie.xml │ │ ├── fragment_people.xml │ │ ├── fragment_tv.xml │ │ ├── layout_favourites.xml │ │ ├── layout_movie_detail_body.xml │ │ ├── layout_movie_detail_header.xml │ │ ├── layout_tv_detail_body.xml │ │ ├── layout_tv_detail_header.xml │ │ ├── toolbar_default.xml │ │ └── toolbar_home.xml │ │ ├── menu │ │ └── menus.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── 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 │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── skydoves │ └── mvvm_coroutines │ ├── MainCoroutinesRule.kt │ ├── repository │ ├── DiscoveryRepositoryTest.kt │ ├── MovieRepositoryTest.kt │ ├── PeopleRepositoryTest.kt │ └── TvRepositoryTest.kt │ └── viewmodel │ ├── MainActivityViewModelTest.kt │ ├── MovieDetailViewModelTest.kt │ ├── PersonDetailViewModelTest.kt │ └── TvDetailViewModelTest.kt ├── mvvm ├── .gitignore ├── build.gradle └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── skydoves │ │ │ └── mvvm │ │ │ ├── App.kt │ │ │ ├── base │ │ │ ├── ViewModelActivity.kt │ │ │ └── ViewModelFragment.kt │ │ │ ├── di │ │ │ ├── ActivityModule.kt │ │ │ ├── AppComponent.kt │ │ │ ├── AppViewModelFactory.kt │ │ │ ├── BaseModule.kt │ │ │ ├── MainActivityFragmentModule.kt │ │ │ ├── NetworkModule.kt │ │ │ ├── PersistenceModule.kt │ │ │ ├── ViewModelModule.kt │ │ │ └── annotations │ │ │ │ ├── ActivityScope.kt │ │ │ │ ├── FragmentScope.kt │ │ │ │ └── ViewModelKey.kt │ │ │ ├── repository │ │ │ ├── DiscoverRepository.kt │ │ │ ├── MovieRepository.kt │ │ │ ├── PeopleRepository.kt │ │ │ ├── Repository.kt │ │ │ └── TvRepository.kt │ │ │ └── ui │ │ │ ├── details │ │ │ ├── movie │ │ │ │ ├── MovieDetailActivity.kt │ │ │ │ └── MovieDetailViewModel.kt │ │ │ ├── person │ │ │ │ ├── PersonDetailActivity.kt │ │ │ │ └── PersonDetailViewModel.kt │ │ │ └── tv │ │ │ │ ├── TvDetailActivity.kt │ │ │ │ └── TvDetailViewModel.kt │ │ │ └── main │ │ │ ├── MainActivity.kt │ │ │ ├── MainActivityViewModel.kt │ │ │ ├── MainPagerAdapter.kt │ │ │ ├── MovieListFragment.kt │ │ │ ├── PersonListFragment.kt │ │ │ └── TvListFragment.kt │ └── res │ │ ├── drawable-hdpi │ │ └── ic_heart.png │ │ ├── drawable-mdpi │ │ └── ic_heart.png │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-xhdpi │ │ └── ic_heart.png │ │ ├── drawable-xxhdpi │ │ └── ic_heart.png │ │ ├── drawable-xxxhdpi │ │ └── ic_heart.png │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── activity_movie_detail.xml │ │ ├── activity_person_detail.xml │ │ ├── activity_tv_detail.xml │ │ ├── fragment_movie.xml │ │ ├── fragment_people.xml │ │ ├── fragment_tv.xml │ │ ├── layout_favourites.xml │ │ ├── layout_movie_detail_body.xml │ │ ├── layout_movie_detail_header.xml │ │ ├── layout_tv_detail_body.xml │ │ ├── layout_tv_detail_header.xml │ │ ├── toolbar_default.xml │ │ └── toolbar_home.xml │ │ ├── menu │ │ └── menus.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── 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 │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── skydoves │ └── mvvm │ ├── ApiUtil.kt │ ├── repository │ ├── DiscoveryRepositoryTest.kt │ ├── MovieRepositoryTest.kt │ ├── PeopleRepositoryTest.kt │ └── TvRepositoryTest.kt │ └── viewmodel │ ├── MainActivityViewModelTest.kt │ ├── MovieDetailViewModelTest.kt │ ├── PersonDetailViewModelTest.kt │ └── TvDetailViewModelTest.kt ├── network ├── .gitignore ├── build.gradle └── src │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── skydoves │ │ └── network │ │ ├── ApiResponse.kt │ │ ├── EndPoint.kt │ │ ├── RequestInterceptor.kt │ │ ├── ResponseTransformer.kt │ │ ├── client │ │ ├── MovieClient.kt │ │ ├── PeopleClient.kt │ │ ├── TheDiscoverClient.kt │ │ └── TvClient.kt │ │ └── service │ │ ├── MovieService.kt │ │ ├── PeopleService.kt │ │ ├── TheDiscoverService.kt │ │ └── TvService.kt │ └── test │ ├── java │ └── com │ │ └── skydoves │ │ └── network │ │ ├── ApiAbstract.kt │ │ ├── ApiResponseTest.kt │ │ ├── MovieServiceTest.kt │ │ ├── PeopleServiceTest.kt │ │ ├── TheDiscoverServiceTest.kt │ │ └── TvServiceTest.kt │ └── resources │ └── api-response │ ├── tmdb_movie.json │ ├── tmdb_movie_keywords.json │ ├── tmdb_movie_reviews.json │ ├── tmdb_movie_videos.json │ ├── tmdb_people.json │ ├── tmdb_person.json │ └── tmdb_tv.json ├── preview ├── preview0.gif ├── preview1.gif ├── preview2.gif ├── structure.png ├── unitTest0.png ├── unitTest1.png ├── unitTest2.png └── unitTest3.png ├── settings.gradle ├── spotless.gradle ├── spotless.license.kt ├── test-common └── java │ └── com │ └── skydoves │ └── common │ ├── ApiUtil.kt │ └── MockTestUtils.kt └── versionsPlugin.gradle /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Lines starting with '#' are comments. 2 | # Each line is a file pattern followed by one or more owners. 3 | 4 | # More details are here: https://help.github.com/articles/about-codeowners/ 5 | 6 | # The '*' pattern is global owners. 7 | # Not adding in this PR, but I'd like to try adding a global owner set with the entire team. 8 | # One interpretation of their docs is that global owners are added only if not removed 9 | # by a more local rule. 10 | 11 | # Order is important. The last matching pattern has the most precedence. 12 | # The folders are ordered as follows: 13 | 14 | # In each subsection folders are ordered first by depth, then alphabetically. 15 | # This should make it easy to add new rules without breaking existing ones. 16 | * @skydoves -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: skydoves 2 | custom: ["https://www.paypal.me/skydoves", "https://www.buymeacoffee.com/skydoves"] 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Something is crashing or not working as intended 4 | 5 | --- 6 | 7 | **Please complete the following information:** 8 | - Library Version [e.g. v1.0.0] 9 | - Affected Device(s) [e.g. Samsung Galaxy s10 with Android 9.0] 10 | 11 | **Describe the Bug:** 12 | 13 | Add a clear description about the problem. 14 | 15 | **Expected Behavior:** 16 | 17 | A clear description of what you expected to happen. 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem?** 8 | 9 | A clear and concise description of what the problem is. 10 | 11 | **Describe the solution you'd like:** 12 | 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered:** 16 | 17 | A clear description of any alternative solutions you've considered. 18 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Guidelines 2 | Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue. 3 | 4 | ### Types of changes 5 | What types of changes does your code introduce? 6 | 7 | - [ ] Bugfix (non-breaking change which fixes an issue) 8 | - [ ] New feature (non-breaking change which adds functionality) 9 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 10 | 11 | ### Preparing a pull request for review 12 | Ensure your change is properly formatted by running: 13 | 14 | ```gradle 15 | $ ./gradlew spotlessApply 16 | ``` 17 | 18 | Please correct any failures before requesting a review. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | /.idea 18 | .gradle/ 19 | build/ 20 | 21 | # DS_Store 22 | *.DS_Store 23 | **/DS_Store 24 | 25 | # Local configuration file (sdk path, etc) 26 | local.properties 27 | 28 | # Proguard folder generated by Eclipse 29 | proguard/ 30 | 31 | # Log Files 32 | *.log 33 | 34 | # Android Studio Navigation editor temp files 35 | .navigation/ 36 | 37 | # Android Studio captures folder 38 | captures/ 39 | 40 | # Intellij 41 | *.iml 42 | .idea/workspace.xml 43 | .idea/tasks.xml 44 | .idea/gradle.xml 45 | .idea/dictionaries 46 | .idea/libraries 47 | 48 | # Keystore files 49 | *.jks 50 | 51 | # External native build folder generated in Android Studio 2.2 and later 52 | .externalNativeBuild 53 | 54 | # Google Services (e.g. APIs or Firebase) 55 | google-services.json 56 | 57 | # Freeline 58 | freeline.py 59 | freeline/ 60 | freeline_project_description.json -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | 3 | android: 4 | components: 5 | - tools 6 | - platform-tools 7 | - build-tools-29.0.0 8 | - android-29 9 | - extra-android-support 10 | - extra-android-m2repository 11 | - extra-google-m2repository 12 | 13 | jdk: 14 | - openjdk8 15 | 16 | branches: 17 | except: 18 | - gh-pages 19 | 20 | licenses: 21 | - '.+' 22 | 23 | notifications: 24 | email: false 25 | 26 | cache: 27 | directories: 28 | - $HOME/.gradle 29 | 30 | script: 31 | - chmod +x ./gradlew -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | apply from: './versionsPlugin.gradle' 2 | buildscript { 3 | apply from: './dependencies.gradle' 4 | repositories { 5 | google() 6 | jcenter() 7 | } 8 | dependencies { 9 | classpath "com.android.tools.build:gradle:$versions.gradleBuildTool" 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin" 11 | classpath "com.diffplug.spotless:spotless-plugin-gradle:$versions.spotlessGradle" 12 | classpath "com.github.ben-manes:gradle-versions-plugin:$versions.versionPlugin" 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | google() 19 | jcenter() 20 | } 21 | } 22 | 23 | task clean(type: Delete) { 24 | delete rootProject.buildDir 25 | } 26 | -------------------------------------------------------------------------------- /common-ui/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /common-ui/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | apply plugin: 'kotlin-kapt' 5 | apply from: '../dependencies.gradle' 6 | 7 | android { 8 | compileSdkVersion versions.compileSdk 9 | defaultConfig { 10 | minSdkVersion versions.minSdk 11 | targetSdkVersion versions.compileSdk 12 | versionCode versions.versionCode 13 | versionName versions.versionName 14 | } 15 | dataBinding { 16 | enabled = true 17 | } 18 | } 19 | 20 | dependencies { 21 | // module dependencies 22 | implementation project(":entity") 23 | 24 | // kotlin 25 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$versions.kotlin" 26 | 27 | // google material 28 | api "com.google.android.material:material:$versions.materialVersion" 29 | 30 | // glide 31 | implementation "com.github.bumptech.glide:glide:$versions.glideVersion" 32 | implementation "com.github.florent37:glidepalette:$versions.glidePaletteVersion" 33 | kapt "com.github.bumptech.glide:compiler:$versions.glideVersion" 34 | 35 | // adapter 36 | api "com.github.skydoves:baserecyclerviewadapter:$versions.baseAdapter" 37 | 38 | // whatIf 39 | implementation "com.github.skydoves:whatif:$versions.whatIfVersion" 40 | 41 | // custom views 42 | api "com.github.skydoves:flourish:$versions.flourishVersion" 43 | implementation "com.github.skydoves:androidribbon:$versions.androidRibbonVersion" 44 | implementation "com.ms-square:expandableTextView:$versions.expandableTextViewVersion" 45 | } 46 | 47 | apply from: '../spotless.gradle' 48 | -------------------------------------------------------------------------------- /common-ui/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /common-ui/src/main/java/com/skydoves/common_ui/MovieGlide.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2019 skydoves (Jaewoong Eum) 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 com.skydoves.common_ui 18 | 19 | import com.bumptech.glide.annotation.GlideModule 20 | import com.bumptech.glide.module.AppGlideModule 21 | 22 | @GlideModule 23 | class MovieGlide : AppGlideModule() 24 | -------------------------------------------------------------------------------- /common-ui/src/main/java/com/skydoves/common_ui/PosterPath.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2019 skydoves (Jaewoong Eum) 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 com.skydoves.common_ui 18 | 19 | object PosterPath { 20 | 21 | private const val BASE_POSTER_PATH = "https://image.tmdb.org/t/p/w342" 22 | private const val BASE_BACKDROP_PATH = "https://image.tmdb.org/t/p/w780" 23 | private const val YOUTUBE_VIDEO_URL = "https://www.youtube.com/watch?v=" 24 | private const val YOUTUBE_THUMBNAIL_URL = "https://img.youtube.com/vi/" 25 | 26 | /** gets the poster's path. */ 27 | fun getPosterPath(posterPath: String) = BASE_POSTER_PATH + posterPath 28 | 29 | /** gets the back drop's path. */ 30 | fun getBackdropPath(backdropPath: String?) = BASE_BACKDROP_PATH + backdropPath 31 | 32 | /** gets the youtube video's path. */ 33 | fun getYoutubeVideoPath(videoPath: String) = YOUTUBE_VIDEO_URL + videoPath 34 | 35 | /** gets the youtube thumbnail's path. */ 36 | fun getYoutubeThumbnailPath(thumbnailPath: String) = "$YOUTUBE_THUMBNAIL_URL$thumbnailPath/default.jpg" 37 | } 38 | -------------------------------------------------------------------------------- /common-ui/src/main/java/com/skydoves/common_ui/adapters/MovieFavouriteDiffCallback.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2019 skydoves (Jaewoong Eum) 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 com.skydoves.common_ui.adapters 18 | 19 | import androidx.recyclerview.widget.DiffUtil 20 | import com.skydoves.entity.entities.Movie 21 | 22 | class MovieFavouriteDiffCallback( 23 | private val oldList: List, 24 | private val newList: List 25 | ) : DiffUtil.Callback() { 26 | 27 | override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int) = 28 | oldList[oldItemPosition].id == newList[newItemPosition].id 29 | 30 | override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int) = 31 | areItemsTheSame(oldItemPosition, newItemPosition) 32 | 33 | override fun getOldListSize() = oldList.size 34 | 35 | override fun getNewListSize() = newList.size 36 | } 37 | -------------------------------------------------------------------------------- /common-ui/src/main/java/com/skydoves/common_ui/adapters/MovieFavouriteListAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2019 skydoves (Jaewoong Eum) 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 com.skydoves.common_ui.adapters 18 | 19 | import android.view.View 20 | import androidx.recyclerview.widget.DiffUtil 21 | import com.skydoves.baserecyclerviewadapter.BaseAdapter 22 | import com.skydoves.baserecyclerviewadapter.SectionRow 23 | import com.skydoves.common_ui.R 24 | import com.skydoves.common_ui.viewholders.MovieFavouriteListViewHolder 25 | import com.skydoves.entity.entities.Movie 26 | 27 | /** MovieFavouriteListAdapter is an adapter class for binding favourite [Movie] items. */ 28 | @Suppress("UNCHECKED_CAST") 29 | class MovieFavouriteListAdapter( 30 | private val delegate: MovieFavouriteListViewHolder.Delegate 31 | ) : BaseAdapter() { 32 | 33 | init { 34 | addSection(ArrayList()) 35 | } 36 | 37 | fun addMovieList(movies: List) { 38 | val section = sections()[0] 39 | val callback = MovieFavouriteDiffCallback(section as List, movies) 40 | val result = DiffUtil.calculateDiff(callback) 41 | section.clear() 42 | section.addAll(movies) 43 | result.dispatchUpdatesTo(this) 44 | } 45 | 46 | override fun layout(sectionRow: SectionRow) = R.layout.item_movie_favourite 47 | 48 | override fun viewHolder(layout: Int, view: View) = MovieFavouriteListViewHolder(view, delegate) 49 | } 50 | -------------------------------------------------------------------------------- /common-ui/src/main/java/com/skydoves/common_ui/adapters/MovieListAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2019 skydoves (Jaewoong Eum) 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 com.skydoves.common_ui.adapters 18 | 19 | import android.view.View 20 | import com.skydoves.baserecyclerviewadapter.BaseAdapter 21 | import com.skydoves.baserecyclerviewadapter.SectionRow 22 | import com.skydoves.common_ui.R 23 | import com.skydoves.common_ui.viewholders.MovieListViewHolder 24 | import com.skydoves.entity.entities.Movie 25 | 26 | /** MovieListAdapter is an adapter class for binding [Movie] items. */ 27 | class MovieListAdapter( 28 | private val delegate: MovieListViewHolder.Delegate 29 | ) : BaseAdapter() { 30 | 31 | init { 32 | addSection(ArrayList()) 33 | } 34 | 35 | fun addMovieList(movies: List) { 36 | val section = sections()[0] 37 | section.addAll(movies) 38 | notifyItemRangeInserted(section.size - movies.size + 1, movies.size) 39 | } 40 | 41 | override fun layout(sectionRow: SectionRow) = R.layout.item_movie 42 | 43 | override fun viewHolder(layout: Int, view: View) = MovieListViewHolder(view, delegate) 44 | } 45 | -------------------------------------------------------------------------------- /common-ui/src/main/java/com/skydoves/common_ui/adapters/PeopleAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2019 skydoves (Jaewoong Eum) 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 com.skydoves.common_ui.adapters 18 | 19 | import android.view.View 20 | import com.skydoves.baserecyclerviewadapter.BaseAdapter 21 | import com.skydoves.baserecyclerviewadapter.SectionRow 22 | import com.skydoves.common_ui.R 23 | import com.skydoves.common_ui.viewholders.PeopleViewHolder 24 | import com.skydoves.entity.entities.Person 25 | 26 | /** PeopleAdapter is an adapter class for binding [Person] items. */ 27 | class PeopleAdapter( 28 | private val delegate: PeopleViewHolder.Delegate 29 | ) : BaseAdapter() { 30 | 31 | init { 32 | addSection(ArrayList()) 33 | } 34 | 35 | fun addPeople(people: List) { 36 | sections()[0].addAll(people) 37 | notifyDataSetChanged() 38 | } 39 | 40 | override fun layout(sectionRow: SectionRow) = R.layout.item_person 41 | 42 | override fun viewHolder(layout: Int, view: View) = PeopleViewHolder(view, delegate) 43 | } 44 | -------------------------------------------------------------------------------- /common-ui/src/main/java/com/skydoves/common_ui/adapters/ReviewListAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2019 skydoves (Jaewoong Eum) 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 com.skydoves.common_ui.adapters 18 | 19 | import android.view.View 20 | import com.skydoves.baserecyclerviewadapter.BaseAdapter 21 | import com.skydoves.baserecyclerviewadapter.SectionRow 22 | import com.skydoves.common_ui.R 23 | import com.skydoves.common_ui.viewholders.ReviewListViewHolder 24 | import com.skydoves.entity.Review 25 | 26 | /** ReviewListAdapter is an adapter class for binding [Review] items. */ 27 | class ReviewListAdapter : BaseAdapter() { 28 | 29 | init { 30 | addSection(ArrayList()) 31 | } 32 | 33 | fun addReviewList(reviews: List) { 34 | val section = sections()[0] 35 | section.addAll(reviews) 36 | notifyItemRangeInserted(section.size - reviews.size + 1, reviews.size) 37 | } 38 | 39 | override fun layout(sectionRow: SectionRow) = R.layout.item_review 40 | 41 | override fun viewHolder(layout: Int, view: View) = ReviewListViewHolder(view) 42 | } 43 | -------------------------------------------------------------------------------- /common-ui/src/main/java/com/skydoves/common_ui/adapters/TvFavouriteDiffCallback.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2019 skydoves (Jaewoong Eum) 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 com.skydoves.common_ui.adapters 18 | 19 | import androidx.recyclerview.widget.DiffUtil 20 | import com.skydoves.entity.entities.Tv 21 | 22 | class TvFavouriteDiffCallback( 23 | private val oldList: List, 24 | private val newList: List 25 | ) : DiffUtil.Callback() { 26 | 27 | override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int) = 28 | oldList[oldItemPosition].id == newList[newItemPosition].id 29 | 30 | override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int) = 31 | areItemsTheSame(oldItemPosition, newItemPosition) 32 | 33 | override fun getOldListSize() = oldList.size 34 | 35 | override fun getNewListSize() = newList.size 36 | } 37 | -------------------------------------------------------------------------------- /common-ui/src/main/java/com/skydoves/common_ui/adapters/TvFavouriteListAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2019 skydoves (Jaewoong Eum) 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 com.skydoves.common_ui.adapters 18 | 19 | import android.view.View 20 | import androidx.recyclerview.widget.DiffUtil 21 | import com.skydoves.baserecyclerviewadapter.BaseAdapter 22 | import com.skydoves.baserecyclerviewadapter.SectionRow 23 | import com.skydoves.common_ui.R 24 | import com.skydoves.common_ui.viewholders.TvFavouriteListViewHolder 25 | import com.skydoves.entity.entities.Tv 26 | 27 | /** TvFavouriteListAdapter is an adapter class for binding favourite [Tv] items. */ 28 | @Suppress("UNCHECKED_CAST") 29 | class TvFavouriteListAdapter( 30 | private val delegate: TvFavouriteListViewHolder.Delegate 31 | ) : BaseAdapter() { 32 | 33 | init { 34 | addSection(ArrayList()) 35 | } 36 | 37 | fun addTvList(tvList: List) { 38 | val section = sections()[0] 39 | val callback = TvFavouriteDiffCallback(section as List, tvList) 40 | val result = DiffUtil.calculateDiff(callback) 41 | section.clear() 42 | section.addAll(tvList) 43 | result.dispatchUpdatesTo(this) 44 | } 45 | 46 | override fun layout(sectionRow: SectionRow) = R.layout.item_tv_favourite 47 | 48 | override fun viewHolder(layout: Int, view: View) = TvFavouriteListViewHolder(view, delegate) 49 | } 50 | -------------------------------------------------------------------------------- /common-ui/src/main/java/com/skydoves/common_ui/adapters/TvListAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2019 skydoves (Jaewoong Eum) 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 com.skydoves.common_ui.adapters 18 | 19 | import android.view.View 20 | import com.skydoves.baserecyclerviewadapter.BaseAdapter 21 | import com.skydoves.baserecyclerviewadapter.SectionRow 22 | import com.skydoves.common_ui.R 23 | import com.skydoves.common_ui.viewholders.TvListViewHolder 24 | import com.skydoves.entity.entities.Tv 25 | 26 | /** TvFavouriteListAdapter is an adapter class for binding [Tv] items. */ 27 | class TvListAdapter( 28 | private val delegate: TvListViewHolder.Delegate 29 | ) : BaseAdapter() { 30 | 31 | init { 32 | addSection(ArrayList()) 33 | } 34 | 35 | fun addTvList(tvs: List) { 36 | val section = sections()[0] 37 | section.addAll(tvs) 38 | notifyItemRangeInserted(section.size - tvs.size + 1, tvs.size) 39 | } 40 | 41 | override fun layout(sectionRow: SectionRow) = R.layout.item_tv 42 | 43 | override fun viewHolder(layout: Int, view: View) = TvListViewHolder(view, delegate) 44 | } 45 | -------------------------------------------------------------------------------- /common-ui/src/main/java/com/skydoves/common_ui/adapters/VideoListAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Designed and developed by 2019 skydoves (Jaewoong Eum) 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 com.skydoves.common_ui.adapters 18 | 19 | import android.view.View 20 | import com.skydoves.baserecyclerviewadapter.BaseAdapter 21 | import com.skydoves.baserecyclerviewadapter.SectionRow 22 | import com.skydoves.common_ui.R 23 | import com.skydoves.common_ui.viewholders.VideoListViewHolder 24 | import com.skydoves.entity.Video 25 | 26 | /** TvFavouriteListAdapter is an adapter class for binding [Video] items. */ 27 | class VideoListAdapter : BaseAdapter() { 28 | 29 | init { 30 | addSection(ArrayList