├── app ├── .gitignore ├── keystore.jks ├── src │ ├── main │ │ ├── assets │ │ │ ├── get_user.json │ │ │ ├── banner.json │ │ │ └── game.json │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── styles.xml │ │ │ │ ├── base_dimens.xml │ │ │ │ └── base_colors.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 │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── ic_recommond.png │ │ │ │ ├── icon_firefly.png │ │ │ │ ├── banner_gray_mask.png │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── xml │ │ │ │ └── network_security_config.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── activity_no_cover.xml │ │ │ │ ├── custom_loading_view.xml │ │ │ │ ├── game_item_date.xml │ │ │ │ ├── activity_databinding.xml │ │ │ │ ├── challenge_home_item_see_more.xml │ │ │ │ ├── activity_feed_article.xml │ │ │ │ ├── activity_paging_list.xml │ │ │ │ ├── fragment_paging_list.xml │ │ │ │ ├── activity_list.xml │ │ │ │ ├── activity_game_list.xml │ │ │ │ ├── item.xml │ │ │ │ ├── activity_normal_fragment.xml │ │ │ │ ├── game_item.xml │ │ │ │ ├── fragment_cover.xml │ │ │ │ ├── activity_cover.xml │ │ │ │ ├── activity_cover_fragment.xml │ │ │ │ ├── recyclerview_item_banner.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── challenge_home_item_challenge.xml │ │ │ │ ├── challenge_home_item_circle.xml │ │ │ │ ├── recyclerview_item_banner_content.xml │ │ │ │ └── recyclerview_item_feed_article.xml │ │ │ ├── drawable │ │ │ │ ├── challenge_see_more_bg.xml │ │ │ │ ├── challenge_home_recomand_subcribe_bg.xml │ │ │ │ ├── challenge_home_score_bg.xml │ │ │ │ └── ic_launcher_background.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── czq │ │ │ │ └── kotlinarch │ │ │ │ ├── template │ │ │ │ ├── list │ │ │ │ │ ├── Item.java │ │ │ │ │ ├── ListContact.kt │ │ │ │ │ ├── ListPresenter.kt │ │ │ │ │ ├── ItemBinder.kt │ │ │ │ │ ├── ListActivity.kt │ │ │ │ │ └── ListFragment.kt │ │ │ │ └── cover │ │ │ │ │ ├── CoverContact.kt │ │ │ │ │ ├── CoverPresenter.kt │ │ │ │ │ ├── CoverFragment.kt │ │ │ │ │ └── CoverActivity.kt │ │ │ │ ├── data │ │ │ │ ├── local │ │ │ │ │ └── LocalDataRepository.kt │ │ │ │ ├── viewModel │ │ │ │ │ ├── GameDate.kt │ │ │ │ │ ├── DataBindingVM.kt │ │ │ │ │ ├── ChallengeRecommandSeeMoreVm.kt │ │ │ │ │ ├── BannerList.kt │ │ │ │ │ ├── ChallengeRecomandCircleVm.kt │ │ │ │ │ └── ChallengeRecommandItemVm.kt │ │ │ │ ├── model │ │ │ │ │ ├── Result.kt │ │ │ │ │ ├── Page.kt │ │ │ │ │ ├── User.kt │ │ │ │ │ ├── Game.kt │ │ │ │ │ ├── Banner.kt │ │ │ │ │ ├── ChallengeRecomand.kt │ │ │ │ │ └── FeedArticle.kt │ │ │ │ ├── remote │ │ │ │ │ ├── api │ │ │ │ │ │ └── RemoteApi.kt │ │ │ │ │ ├── MockDataRepository.kt │ │ │ │ │ └── RemoteDataRepository.kt │ │ │ │ └── converter │ │ │ │ │ └── ChallengeRecomondCoverter.kt │ │ │ │ ├── example │ │ │ │ ├── NoCoverPresenter.kt │ │ │ │ ├── DatabindingPresenter.kt │ │ │ │ ├── CoverContact.kt │ │ │ │ ├── NoCoverContract.kt │ │ │ │ ├── DatabindingContract.kt │ │ │ │ ├── fragment │ │ │ │ │ ├── CoverContact.kt │ │ │ │ │ ├── PagingListContact.kt │ │ │ │ │ ├── CoverFragment.kt │ │ │ │ │ ├── CoverPresenter.kt │ │ │ │ │ ├── PagingListPresenter.kt │ │ │ │ │ └── PagingListFragment.kt │ │ │ │ ├── FeedArticleContract.kt │ │ │ │ ├── PagingListContact.kt │ │ │ │ ├── GameListContact.kt │ │ │ │ ├── CoverPresenter.kt │ │ │ │ ├── NoCoverActivity.kt │ │ │ │ ├── itembinder │ │ │ │ │ ├── SeeMoreViewbinder.kt │ │ │ │ │ ├── GameDateViewbinder.kt │ │ │ │ │ ├── GameViewbinder.kt │ │ │ │ │ ├── ChallengeViewbinder.kt │ │ │ │ │ ├── CircleViewbinder.kt │ │ │ │ │ ├── BannerItembinder.kt │ │ │ │ │ ├── BannerContentItembinder.kt │ │ │ │ │ └── FeedArticleItembinder.kt │ │ │ │ ├── CoverActivity.kt │ │ │ │ ├── FeedArticleActivity.kt │ │ │ │ ├── DatabindingActivity.kt │ │ │ │ ├── NormalFragmentActivity.kt │ │ │ │ ├── CoverFragmentActivity.kt │ │ │ │ ├── PagingListPresenter.kt │ │ │ │ ├── GameListPresenter.kt │ │ │ │ ├── PagingListActivity.kt │ │ │ │ ├── GameListActivity.kt │ │ │ │ └── FeedArticlePresenter.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ └── App.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── czq │ │ │ └── kotlinarch │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── czq │ │ └── kotlinarch │ │ └── ExampleInstrumentedTest.kt ├── build.gradle └── proguard-rules.pro ├── kotlin_arch ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ └── colors.xml │ │ │ ├── drawable │ │ │ │ └── state_error_btn_bg.xml │ │ │ └── layout │ │ │ │ ├── fragment_base.xml │ │ │ │ ├── activity_base.xml │ │ │ │ ├── common_empty_view.xml │ │ │ │ ├── common_loading_view.xml │ │ │ │ ├── fragment_base_paging.xml │ │ │ │ ├── activity_base_paging.xml │ │ │ │ └── common_error_view.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── czq │ │ │ │ └── kotlin_arch │ │ │ │ ├── paging │ │ │ │ ├── PagingStrategy.kt │ │ │ │ ├── offset │ │ │ │ │ ├── OffsetPageInfo.kt │ │ │ │ │ └── OffsetStrategy.kt │ │ │ │ └── normal │ │ │ │ │ ├── NormalPagingInfo.kt │ │ │ │ │ └── NormalPagingStrategy.kt │ │ │ │ ├── basePage │ │ │ │ ├── paging │ │ │ │ │ ├── IBasePagingPrensenter.kt │ │ │ │ │ ├── IBasePagingView.kt │ │ │ │ │ ├── BasePagingPrensenterImpl.kt │ │ │ │ │ ├── BasePagingActivity.kt │ │ │ │ │ └── BasePagingFragment.kt │ │ │ │ └── base │ │ │ │ │ ├── IBasePrensenter.kt │ │ │ │ │ ├── IBaseView.kt │ │ │ │ │ ├── BaseFragment.kt │ │ │ │ │ └── BaseActivity.kt │ │ │ │ ├── component │ │ │ │ └── cover │ │ │ │ │ ├── CoverListener.kt │ │ │ │ │ ├── CoverFrameViewConfig.kt │ │ │ │ │ └── CoverFrameLayout.kt │ │ │ │ └── common │ │ │ │ └── util │ │ │ │ ├── ext │ │ │ │ ├── Activity.kt │ │ │ │ └── Density.kt │ │ │ │ ├── MockUtil.kt │ │ │ │ └── AssetUtil.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── czq │ │ │ └── kotlin_arch │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── czq │ │ └── kotlin_arch │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── 截图 ├── sc1.png ├── sc2.png ├── sc3.png └── sc4.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── LICENSE ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /kotlin_arch/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':kotlin_arch' 2 | -------------------------------------------------------------------------------- /截图/sc1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/HEAD/截图/sc1.png -------------------------------------------------------------------------------- /截图/sc2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/HEAD/截图/sc2.png -------------------------------------------------------------------------------- /截图/sc3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/HEAD/截图/sc3.png -------------------------------------------------------------------------------- /截图/sc4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/HEAD/截图/sc4.png -------------------------------------------------------------------------------- /app/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/HEAD/app/keystore.jks -------------------------------------------------------------------------------- /app/src/main/assets/get_user.json: -------------------------------------------------------------------------------- 1 | {"avtar":"","id":1,"sex":0,"userName":"manondidi"} 2 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | kotlinArch 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/template/list/Item.java: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.template.list; 2 | 3 | public class Item { 4 | } 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/data/local/LocalDataRepository.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.data.local 2 | 3 | class LocalDataRepository { 4 | } -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_recommond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/HEAD/app/src/main/res/drawable-xxhdpi/ic_recommond.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/icon_firefly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/HEAD/app/src/main/res/drawable-xxhdpi/icon_firefly.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/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/manondidi/kotlinArch/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/manondidi/kotlinArch/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/banner_gray_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/HEAD/app/src/main/res/drawable-xxhdpi/banner_gray_mask.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manondidi/kotlinArch/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/manondidi/kotlinArch/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/data/viewModel/GameDate.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.data.viewModel 2 | 3 | class GameDate { 4 | var date: String? = null 5 | } -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/data/viewModel/DataBindingVM.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.data.viewModel 2 | 3 | class DataBindingVM { 4 | var txt: String? = null 5 | } -------------------------------------------------------------------------------- /app/src/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/data/viewModel/ChallengeRecommandSeeMoreVm.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.data.viewModel 2 | 3 | class ChallengeRecommandSeeMoreVm { 4 | var id: String? = null 5 | } 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/data/model/Result.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.data.model 2 | 3 | class Result { 4 | var status: Int = 0 5 | var msg: String? = null 6 | var data: T? = null 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/data/viewModel/BannerList.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.data.viewModel 2 | 3 | import com.czq.kotlinarch.data.model.Banner 4 | 5 | class BannerList { 6 | var banners: List? = null 7 | } -------------------------------------------------------------------------------- /kotlin_arch/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | kotlin_arch 3 | 加载失败 4 | 空空如也 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/data/model/Page.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.data.model 2 | 3 | class Page { 4 | var totalNum: Int = 0 5 | var pageNo: Int = 0 6 | var pageSize: Int = 0 7 | var listData: List? = null 8 | } -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/NoCoverPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example 2 | 3 | 4 | class NoCoverPresenter(var mView: NoCoverContract.IView) : NoCoverContract.IPrensenter { 5 | 6 | override fun start() { 7 | 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/DatabindingPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example 2 | 3 | 4 | class DatabindingPresenter(var mView: DatabindingContract.IView) : DatabindingContract.IPrensenter { 5 | 6 | override fun start() { 7 | 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Aug 09 08:57:38 CST 2021 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.7.1-bin.zip 7 | -------------------------------------------------------------------------------- /kotlin_arch/src/main/java/com/czq/kotlin_arch/paging/PagingStrategy.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlin_arch.paging 2 | 3 | interface PagingStrategy { 4 | 5 | fun addPage(info:Any?) 6 | fun resetPage() 7 | fun getPageInfo():Any 8 | fun checkFinish(result:Any?,listSize: Int):Boolean 9 | } -------------------------------------------------------------------------------- /kotlin_arch/src/main/res/drawable/state_error_btn_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /kotlin_arch/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/data/viewModel/ChallengeRecomandCircleVm.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.data.viewModel 2 | 3 | class ChallengeRecomandCircleVm { 4 | var id: String? = null 5 | var title: String? = null 6 | var subscribedCount = 0 7 | var challengeCount = 0 8 | var icon: String? = null 9 | var hasSubscribed = false 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/data/model/User.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.data.model 2 | 3 | class User { 4 | 5 | /** 6 | * avtar : 7 | * id : 1 8 | * sex : 0 9 | * userName : manondidi 10 | */ 11 | 12 | var avtar: String? = null 13 | var id: Int = 0 14 | var sex: Int = 0 15 | var userName: String? = null 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/data/viewModel/ChallengeRecommandItemVm.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.data.viewModel 2 | 3 | class ChallengeRecommandItemVm { 4 | var index = 0 5 | var id: String? = null 6 | var title: String? = null 7 | var candidateCount = 0 8 | var takeOnCount = 0 9 | var candidatePoint = 0 10 | var cover: String? = null 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/CoverContact.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example 2 | 3 | import com.czq.kotlin_arch.basePage.base.IBasePrensenter 4 | import com.czq.kotlin_arch.basePage.base.IBaseView 5 | 6 | interface CoverContact { 7 | 8 | interface CoverView : IBaseView { 9 | 10 | } 11 | 12 | interface CoverPrensenter : IBasePrensenter { 13 | 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/NoCoverContract.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example 2 | 3 | import com.czq.kotlin_arch.basePage.base.IBasePrensenter 4 | import com.czq.kotlin_arch.basePage.base.IBaseView 5 | 6 | interface NoCoverContract { 7 | 8 | interface IView : IBaseView { 9 | 10 | } 11 | 12 | interface IPrensenter : IBasePrensenter { 13 | 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /kotlin_arch/src/main/java/com/czq/kotlin_arch/paging/offset/OffsetPageInfo.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlin_arch.paging.offset 2 | 3 | class OffsetPageInfo { 4 | var type = "new" 5 | var pageSize = 20 6 | var offsetId: String? = null 7 | 8 | init { 9 | this.pageSize = pageSize 10 | } 11 | 12 | fun isFirstPage(): Boolean { 13 | return type == "new" 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/DatabindingContract.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example 2 | 3 | import com.czq.kotlin_arch.basePage.base.IBasePrensenter 4 | import com.czq.kotlin_arch.basePage.base.IBaseView 5 | 6 | interface DatabindingContract { 7 | 8 | interface IView : IBaseView { 9 | 10 | } 11 | 12 | interface IPrensenter : IBasePrensenter { 13 | 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /kotlin_arch/src/main/java/com/czq/kotlin_arch/paging/normal/NormalPagingInfo.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlin_arch.paging.normal 2 | 3 | class NormalPagingInfo { 4 | 5 | var pageSize: Int = 0 6 | var pageNum: Int = 0 7 | var totalCount: Int = 0 8 | var startPageNum: Int = 0//从多少开始计算的 一般分页要么是0 要么是1 9 | 10 | fun isFirstPage(): Boolean { 11 | return startPageNum == pageNum 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/template/cover/CoverContact.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.template.cover 2 | 3 | import com.czq.kotlin_arch.basePage.base.IBasePrensenter 4 | import com.czq.kotlin_arch.basePage.base.IBaseView 5 | 6 | interface CoverContact { 7 | 8 | interface CoverView : IBaseView { 9 | 10 | } 11 | 12 | interface CoverPrensenter : IBasePrensenter { 13 | 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/fragment/CoverContact.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example.fragment 2 | 3 | import com.czq.kotlin_arch.basePage.base.IBasePrensenter 4 | import com.czq.kotlin_arch.basePage.base.IBaseView 5 | 6 | interface CoverContact { 7 | 8 | interface CoverView : IBaseView { 9 | 10 | } 11 | 12 | interface CoverPrensenter : IBasePrensenter { 13 | 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /kotlin_arch/src/main/java/com/czq/kotlin_arch/basePage/paging/IBasePagingPrensenter.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlin_arch.basePage.base 2 | 3 | import com.czq.kotlin_arch.paging.PagingStrategy 4 | 5 | interface IBasePagingPrensenter : IBasePrensenter { 6 | 7 | 8 | fun getPagingStrategy(): PagingStrategy? 9 | 10 | fun onLoadData(pagingStrategy: PagingStrategy?) 11 | 12 | fun resetPage() 13 | 14 | fun loadData() 15 | } -------------------------------------------------------------------------------- /kotlin_arch/src/main/res/layout/fragment_base.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /kotlin_arch/src/main/java/com/czq/kotlin_arch/basePage/base/IBasePrensenter.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlin_arch.basePage.base 2 | 3 | import androidx.lifecycle.Lifecycle 4 | import androidx.lifecycle.LifecycleObserver 5 | import androidx.lifecycle.LifecycleOwner 6 | import androidx.lifecycle.OnLifecycleEvent 7 | import org.jetbrains.annotations.NotNull 8 | 9 | 10 | interface IBasePrensenter : LifecycleObserver { 11 | fun start() 12 | 13 | } -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/FeedArticleContract.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example 2 | 3 | import com.czq.kotlin_arch.basePage.base.IBasePagingPrensenter 4 | import com.czq.kotlin_arch.basePage.base.IBasePagingView 5 | 6 | interface FeedArticleContract { 7 | 8 | interface IView : IBasePagingView { 9 | 10 | } 11 | 12 | interface IPresenter : IBasePagingPrensenter { 13 | 14 | } 15 | 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/PagingListContact.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example 2 | 3 | import com.czq.kotlin_arch.basePage.base.IBasePagingPrensenter 4 | import com.czq.kotlin_arch.basePage.base.IBasePagingView 5 | 6 | class PagingListContact { 7 | 8 | 9 | interface PagingListView : IBasePagingView { 10 | 11 | } 12 | 13 | interface PagingListPresenter : IBasePagingPrensenter { 14 | 15 | } 16 | 17 | 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/template/list/ListContact.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.template.list 2 | 3 | import com.czq.kotlin_arch.basePage.base.IBasePagingPrensenter 4 | import com.czq.kotlin_arch.basePage.base.IBasePagingView 5 | 6 | class ListContact { 7 | 8 | 9 | interface PagingListView : IBasePagingView { 10 | 11 | } 12 | 13 | interface PagingListPresenter : IBasePagingPrensenter { 14 | 15 | } 16 | 17 | 18 | } -------------------------------------------------------------------------------- /kotlin_arch/src/main/java/com/czq/kotlin_arch/component/cover/CoverListener.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlin_arch.component.cover 2 | 3 | import android.view.View 4 | 5 | interface CoverListener { 6 | fun onShowContent() { 7 | 8 | } 9 | 10 | fun onShowLoading(loadingView: View?) { 11 | 12 | } 13 | 14 | fun onShowError(errorView: View?) { 15 | 16 | } 17 | 18 | fun onShowEmpty(emptyView: View?) { 19 | 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /kotlin_arch/src/main/java/com/czq/kotlin_arch/component/cover/CoverFrameViewConfig.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlin_arch.component.cover 2 | 3 | import com.czq.kotlin_arch.R 4 | 5 | class CoverFrameViewConfig { 6 | 7 | companion object { 8 | var defaultLoadingViewLayout = R.layout.common_loading_view 9 | var defaultEmptyViewLayout = R.layout.common_empty_view 10 | var defaultErrorViewLayout = R.layout.common_error_view 11 | } 12 | } -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/fragment/PagingListContact.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example.fragment 2 | 3 | import com.czq.kotlin_arch.basePage.base.IBasePagingPrensenter 4 | import com.czq.kotlin_arch.basePage.base.IBasePagingView 5 | 6 | class PagingListContact { 7 | 8 | 9 | interface PagingListView : IBasePagingView { 10 | 11 | } 12 | 13 | interface PagingListPresenter : IBasePagingPrensenter { 14 | 15 | } 16 | 17 | 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/GameListContact.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example 2 | 3 | import com.czq.kotlin_arch.basePage.base.IBasePagingPrensenter 4 | import com.czq.kotlin_arch.basePage.base.IBasePagingView 5 | 6 | class GameListContact { 7 | 8 | 9 | interface PagingListView : IBasePagingView { 10 | fun hello() 11 | 12 | } 13 | 14 | interface PagingListPresenter : IBasePagingPrensenter { 15 | 16 | } 17 | 18 | 19 | } -------------------------------------------------------------------------------- /app/src/test/java/com/czq/kotlinarch/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /kotlin_arch/src/main/res/layout/activity_base.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/data/model/Game.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.data.model 2 | 3 | class Game( 4 | var createTime: Int? = 0, // 1526374588 5 | var hasRecord: Boolean? = false, // false 6 | var icon: String? = "", // http://i1.17173cdn.com/9axtlo/YWxqaGBf/gamelib/20180515/aDEuWEbmnrqkrku.png!a-3-240x.png 7 | var iconType: String? = "", // normal 8 | var id: String? = "", // 10089387 9 | var title: String? = "" // Octocopter: Double or Squids 10 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/CoverPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example 2 | 3 | import com.czq.kotlinarch.data.remote.RemoteDataRepository 4 | import com.uber.autodispose.lifecycle.autoDisposable 5 | import io.reactivex.android.schedulers.AndroidSchedulers 6 | import io.reactivex.schedulers.Schedulers 7 | 8 | class CoverPresenter(var mView: CoverContact.CoverView) : CoverContact.CoverPrensenter { 9 | 10 | override fun start() { 11 | 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /kotlin_arch/src/main/java/com/czq/kotlin_arch/basePage/base/IBaseView.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlin_arch.basePage.base 2 | 3 | import android.content.Context 4 | import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider 5 | 6 | interface IBaseView { 7 | 8 | fun showContent() 9 | fun showLoading() 10 | fun showEmpty() 11 | fun showError(it: Throwable? = null) 12 | fun getContext(): Context 13 | fun autoDispose(): AndroidLifecycleScopeProvider 14 | 15 | } -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/template/cover/CoverPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.template.cover 2 | 3 | import com.czq.kotlinarch.data.remote.RemoteDataRepository 4 | import com.uber.autodispose.lifecycle.autoDisposable 5 | import io.reactivex.android.schedulers.AndroidSchedulers 6 | import io.reactivex.schedulers.Schedulers 7 | 8 | class CoverPresenter(var mView: CoverContact.CoverView) : CoverContact.CoverPrensenter { 9 | 10 | override fun start() { 11 | 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /kotlin_arch/src/test/java/com/czq/kotlin_arch/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.czq.kotlin_arch; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_no_cover.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /kotlin_arch/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #008577 5 | #00574B 6 | #D81B60 7 | 8 | 9 | #f5f5f5 10 | @color/colorPrimary 11 | @color/colorPrimary 12 | #ffffff 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/challenge_see_more_bg.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/challenge_home_recomand_subcribe_bg.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/challenge_home_score_bg.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/custom_loading_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /kotlin_arch/src/main/res/layout/common_empty_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/NoCoverActivity.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example 2 | 3 | 4 | import com.czq.kotlin_arch.basePage.base.BaseActivity 5 | import com.czq.kotlinarch.R 6 | 7 | class NoCoverActivity : BaseActivity(), NoCoverContract.IView { 8 | 9 | override fun createPresenter(): NoCoverContract.IPrensenter { 10 | return NoCoverPresenter(this) 11 | } 12 | 13 | override fun initView() { 14 | super.initView() 15 | } 16 | 17 | override fun getLayoutId(): Int { 18 | return R.layout.activity_no_cover 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /kotlin_arch/src/main/java/com/czq/kotlin_arch/basePage/paging/IBasePagingView.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlin_arch.basePage.base 2 | 3 | interface IBasePagingView : IBaseView { 4 | 5 | fun showRecyclerViewEmpty() 6 | 7 | fun showRecyclerViewError(it: Throwable? = null) 8 | 9 | fun showRecyclerViewContent() 10 | 11 | fun showRecyclerViewLoading() 12 | 13 | fun beginRefresh() 14 | 15 | fun stopRefresh() 16 | 17 | fun stopLoadingdMore(finish: Boolean) 18 | 19 | fun setRecyclerViewData(datasource: ArrayList) 20 | 21 | fun isRefreshLoading():Boolean 22 | 23 | 24 | fun notifyDataChange() 25 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/game_item_date.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/template/list/ListPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.template.list 2 | 3 | import android.annotation.SuppressLint 4 | import com.czq.kotlin_arch.basePage.base.BasePagingPrensenterImpl 5 | import com.czq.kotlin_arch.paging.PagingStrategy 6 | 7 | open class ListPresenter(mView: ListContact.PagingListView) : BasePagingPrensenterImpl(mView), 8 | ListContact.PagingListPresenter { 9 | 10 | 11 | override fun getPagingStrategy(): PagingStrategy? { 12 | return null 13 | } 14 | 15 | @SuppressLint("CheckResult") 16 | override fun onLoadData(pagingStrategy: PagingStrategy?) { 17 | 18 | } 19 | } -------------------------------------------------------------------------------- /kotlin_arch/src/main/res/layout/common_loading_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_databinding.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/challenge_home_item_see_more.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/data/model/Banner.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.data.model 2 | 3 | class Banner { 4 | 5 | /** 6 | * id : 6 7 | * title : 使用指南·如何玩转记忆点 8 | * summary : 欢迎各位玩家来到记忆点社区! 9 | * 这里有一份记忆点新手引导教学将助你踏出在记忆点社区的第一步! 10 | * cover : https://i.17173cdn.com/gdthue/YWxqaGBf/snsapp/20180511/EjgNUMbmnhofvAc.png 11 | * isFirefly : false 12 | * relatedType : article 13 | * relatedId : 104044 14 | * feedId : 159237 15 | */ 16 | 17 | var id: Int = 0 18 | var title: String? = null 19 | var summary: String? = null 20 | var cover: String? = null 21 | var isIsFirefly: Boolean = false 22 | var relatedType: String? = null 23 | var relatedId: Int = 0 24 | var feedId: Int = 0 25 | } 26 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/czq/kotlinarch/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch 2 | 3 | import androidx.test.InstrumentationRegistry 4 | import androidx.test.runner.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getTargetContext() 22 | assertEquals("com.czq.kotlinarch", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/template/list/ItemBinder.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.template.list 2 | 3 | import android.view.LayoutInflater 4 | import android.view.View 5 | import android.view.ViewGroup 6 | import androidx.recyclerview.widget.RecyclerView 7 | import com.czq.kotlinarch.R 8 | import com.drakeet.multitype.ItemViewBinder 9 | 10 | 11 | class ItemBinder : ItemViewBinder() { 12 | 13 | override fun onCreateViewHolder(inflater: LayoutInflater, parent: ViewGroup): ViewHolder = 14 | ViewHolder(inflater.inflate(R.layout.item, parent, false)) 15 | 16 | override fun onBindViewHolder(holder: ViewHolder, itemData: Item) { 17 | } 18 | 19 | class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {} 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/template/list/ListActivity.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.template.list 2 | 3 | import com.czq.kotlin_arch.basePage.paging.BasePagingActivity 4 | import com.czq.kotlinarch.R 5 | 6 | 7 | class ListActivity : BasePagingActivity(), 8 | ListContact.PagingListView { 9 | 10 | 11 | override fun registItemBinder() { 12 | multiAdapter.register(ItemBinder()) 13 | 14 | } 15 | 16 | override fun initView() { 17 | super.initView() 18 | 19 | } 20 | 21 | 22 | 23 | 24 | override fun getLayoutId(): Int { 25 | return R.layout.activity_list 26 | } 27 | 28 | override fun createPresenter(): ListContact.PagingListPresenter { 29 | return ListPresenter(this) 30 | } 31 | 32 | 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/fragment/CoverFragment.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example.fragment 2 | 3 | import com.czq.kotlin_arch.basePage.base.BaseFragment 4 | import com.czq.kotlinarch.R 5 | import kotlinx.android.synthetic.main.fragment_cover.* 6 | 7 | class CoverFragment : BaseFragment(), CoverContact.CoverView { 8 | 9 | 10 | companion object { 11 | fun newInstance():CoverFragment{ 12 | return CoverFragment() 13 | } 14 | } 15 | 16 | override fun createPresenter(): CoverContact.CoverPrensenter { 17 | return CoverPresenter(this) 18 | } 19 | 20 | override fun initView() { 21 | super.initView() 22 | 23 | } 24 | 25 | override fun getLayoutId(): Int { 26 | return R.layout.fragment_cover 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/template/cover/CoverFragment.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.template.cover 2 | 3 | import com.czq.kotlin_arch.basePage.base.BaseFragment 4 | import com.czq.kotlinarch.R 5 | import kotlinx.android.synthetic.main.fragment_cover.* 6 | 7 | class CoverFragment : BaseFragment(), CoverContact.CoverView { 8 | 9 | 10 | companion object { 11 | fun newInstance():CoverFragment{ 12 | return CoverFragment() 13 | } 14 | } 15 | 16 | override fun createPresenter(): CoverContact.CoverPrensenter { 17 | return CoverPresenter(this) 18 | } 19 | 20 | override fun initView() { 21 | super.initView() 22 | 23 | } 24 | 25 | override fun getLayoutId(): Int { 26 | return R.layout.fragment_cover 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /kotlin_arch/src/main/java/com/czq/kotlin_arch/common/util/ext/Activity.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlin_arch.common.util.ext 2 | 3 | import android.content.res.Resources 4 | import android.os.Build 5 | import android.view.View 6 | import androidx.appcompat.app.AppCompatActivity 7 | 8 | fun AppCompatActivity.hideBottom() { 9 | //隐藏虚拟按键,并且全屏 10 | if (Build.VERSION.SDK_INT > 11 && Build.VERSION.SDK_INT < 19) { // lower api 11 | val v = window.decorView 12 | v.systemUiVisibility = View.GONE 13 | } else if (Build.VERSION.SDK_INT >= 19) { //for new api versions. 14 | val decorView = window.decorView 15 | val uiOptions = (View.SYSTEM_UI_FLAG_HIDE_NAVIGATION 16 | or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY or View.SYSTEM_UI_FLAG_FULLSCREEN) 17 | decorView.systemUiVisibility = uiOptions 18 | } 19 | } -------------------------------------------------------------------------------- /kotlin_arch/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_feed_article.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/template/list/ListFragment.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.template.list 2 | 3 | import com.czq.kotlin_arch.basePage.paging.BasePagingFragment 4 | import com.czq.kotlinarch.R 5 | 6 | class ListFragment : BasePagingFragment(), ListContact.PagingListView { 7 | 8 | companion object { 9 | fun newInstance():ListFragment{ 10 | return ListFragment() 11 | } 12 | } 13 | 14 | override fun registItemBinder() { 15 | multiAdapter.register(ItemBinder()) 16 | } 17 | 18 | override fun createPresenter(): ListContact.PagingListPresenter { 19 | return ListPresenter(this) 20 | } 21 | 22 | override fun getLayoutId(): Int { 23 | return R.layout.fragment_paging_list 24 | } 25 | 26 | override fun initView() { 27 | super.initView() 28 | } 29 | 30 | 31 | } -------------------------------------------------------------------------------- /kotlin_arch/src/androidTest/java/com/czq/kotlin_arch/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.czq.kotlin_arch; 2 | 3 | import android.content.Context; 4 | import androidx.test.InstrumentationRegistry; 5 | import androidx.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.czq.kotlin_arch.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /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 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # Kotlin code style for this project: "official" or "obsolete": 15 | kotlin.code.style=official 16 | android.useAndroidX=true 17 | android.enableJetifier=true 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_paging_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_paging_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 20 | 21 | -------------------------------------------------------------------------------- /kotlin_arch/src/main/res/layout/fragment_base_paging.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 13 | 14 | 19 | 20 | -------------------------------------------------------------------------------- /kotlin_arch/src/main/res/layout/activity_base_paging.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/data/remote/api/RemoteApi.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.data.remote.api 2 | 3 | import com.czq.kotlinarch.data.model.* 4 | import io.reactivex.Observable 5 | import retrofit2.http.GET 6 | import retrofit2.http.Headers 7 | import retrofit2.http.Path 8 | import retrofit2.http.Query 9 | 10 | interface RemoteApi { 11 | 12 | @Headers( 13 | "X-Requested-With: XMLHttpRequest" 14 | ) 15 | 16 | @GET("user/{userId}") 17 | fun getUser(@Path("userId") userId: String, @Query("password") password: String): Observable> 18 | 19 | 20 | @GET("archServer/games") 21 | fun getGames(@Query("pageNum") pageNum: Int, @Query("pageSize") pageSize: Int): Observable>> 22 | 23 | @GET("archServer/feeds") 24 | fun getArticleFeeds(@Query("pageSize") pageSize: Int, @Query("offsetId") offsetId: String?, @Query("direction") direction: String) 25 | : Observable>> 26 | 27 | } -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/itembinder/SeeMoreViewbinder.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.viewbinder 2 | 3 | import android.view.LayoutInflater 4 | import android.view.View 5 | import android.view.ViewGroup 6 | import androidx.recyclerview.widget.RecyclerView 7 | import com.czq.kotlinarch.R 8 | import com.czq.kotlinarch.data.viewModel.ChallengeRecommandSeeMoreVm 9 | import com.drakeet.multitype.ItemViewBinder 10 | 11 | 12 | class SeeMoreViewbinder : ItemViewBinder() { 13 | 14 | override fun onCreateViewHolder(inflater: LayoutInflater, parent: ViewGroup): SeeMoreViewbinder.ViewHolder = 15 | ViewHolder(inflater.inflate(R.layout.challenge_home_item_see_more, parent, false)) 16 | 17 | override fun onBindViewHolder(holder: SeeMoreViewbinder.ViewHolder, itemData: ChallengeRecommandSeeMoreVm) { 18 | } 19 | 20 | class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {} 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/fragment/CoverPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example.fragment 2 | 3 | import com.czq.kotlinarch.data.remote.RemoteDataRepository 4 | import com.uber.autodispose.lifecycle.autoDisposable 5 | import io.reactivex.android.schedulers.AndroidSchedulers 6 | import io.reactivex.schedulers.Schedulers 7 | 8 | class CoverPresenter(var mView: CoverContact.CoverView) : CoverContact.CoverPrensenter { 9 | val mRemoteDataRepository: RemoteDataRepository by lazy { 10 | RemoteDataRepository() 11 | } 12 | 13 | override fun start() { 14 | 15 | mView.showLoading() 16 | mRemoteDataRepository.getUser() 17 | .subscribeOn(Schedulers.io()) 18 | .observeOn(AndroidSchedulers.mainThread()) 19 | .autoDisposable(mView.autoDispose()) 20 | .subscribe({ it -> 21 | mView.showContent() 22 | }, { 23 | mView.showError(it) 24 | }) 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_game_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/CoverActivity.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example 2 | 3 | import com.czq.kotlin_arch.basePage.base.BaseActivity 4 | import com.czq.kotlinarch.R 5 | import kotlinx.android.synthetic.main.activity_cover.* 6 | 7 | class CoverActivity : BaseActivity(), CoverContact.CoverView { 8 | 9 | override fun createPresenter(): CoverContact.CoverPrensenter { 10 | return CoverPresenter(this) 11 | } 12 | 13 | override fun initView() { 14 | super.initView() 15 | 16 | btnContent.setOnClickListener { 17 | showContent() 18 | } 19 | btnEmpty.setOnClickListener { 20 | showEmpty() 21 | } 22 | btnError.setOnClickListener { 23 | showError() 24 | } 25 | btnLoading.setOnClickListener { 26 | showLoading() 27 | } 28 | } 29 | 30 | override fun getLayoutId(): Int { 31 | return R.layout.activity_cover 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/template/cover/CoverActivity.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.template.cover 2 | 3 | import com.czq.kotlin_arch.basePage.base.BaseActivity 4 | import com.czq.kotlinarch.R 5 | import kotlinx.android.synthetic.main.activity_cover.* 6 | 7 | class CoverActivity : BaseActivity(), CoverContact.CoverView { 8 | 9 | override fun createPresenter(): CoverContact.CoverPrensenter { 10 | return CoverPresenter(this) 11 | } 12 | 13 | override fun initView() { 14 | super.initView() 15 | 16 | btnContent.setOnClickListener { 17 | showContent() 18 | } 19 | btnEmpty.setOnClickListener { 20 | showEmpty() 21 | } 22 | btnError.setOnClickListener { 23 | showError() 24 | } 25 | btnLoading.setOnClickListener { 26 | showLoading() 27 | } 28 | } 29 | 30 | override fun getLayoutId(): Int { 31 | return R.layout.activity_cover 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/itembinder/GameDateViewbinder.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.viewbinder 2 | 3 | import android.view.LayoutInflater 4 | import android.view.View 5 | import android.view.ViewGroup 6 | import androidx.recyclerview.widget.RecyclerView 7 | import com.czq.kotlinarch.R 8 | import com.czq.kotlinarch.data.viewModel.GameDate 9 | import com.drakeet.multitype.ItemViewBinder 10 | import kotlinx.android.synthetic.main.game_item_date.view.* 11 | 12 | 13 | class GameDateViewbinder : ItemViewBinder() { 14 | 15 | override fun onCreateViewHolder(inflater: LayoutInflater, parent: ViewGroup): GameDateViewbinder.ViewHolder = 16 | ViewHolder(inflater.inflate(R.layout.game_item_date, parent, false)) 17 | 18 | override fun onBindViewHolder(holder: GameDateViewbinder.ViewHolder, itemData: GameDate) { 19 | holder.itemView.tvDate.text = itemData.date 20 | } 21 | 22 | class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {} 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/czq/kotlinarch/example/FeedArticleActivity.kt: -------------------------------------------------------------------------------- 1 | package com.czq.kotlinarch.example 2 | 3 | 4 | import android.annotation.SuppressLint 5 | import com.czq.kotlin_arch.basePage.paging.BasePagingActivity 6 | import com.czq.kotlinarch.R 7 | import com.czq.kotlinarch.example.itembinder.BannerItembinder 8 | import com.czq.kotlinarch.example.itembinder.FeedArticleItembinder 9 | 10 | 11 | class FeedArticleActivity : BasePagingActivity(), FeedArticleContract.IView { 12 | 13 | @SuppressLint("CheckResult") 14 | override fun registItemBinder() { 15 | 16 | multiAdapter.register(FeedArticleItembinder()) 17 | multiAdapter.register(BannerItembinder()) 18 | } 19 | 20 | override fun createPresenter(): FeedArticleContract.IPresenter { 21 | return FeedArticlePresenter(this) 22 | } 23 | 24 | override fun getLayoutId(): Int { 25 | return R.layout.activity_feed_article 26 | } 27 | 28 | override fun initView() { 29 | super.initView() 30 | } 31 | 32 | 33 | 34 | 35 | } -------------------------------------------------------------------------------- /kotlin_arch/src/main/res/layout/common_error_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 |