- 该项目基于 鸿洋 大佬的 玩Android 接口
- 项目采用 Kotlin 语言
- 整体采用 MVVM 架构编写
- 使用到的 JetPack组件有 LiveData 、 ViewModel 、 Lifecycle 、 DataBinding 、 Navigation
- 使用协程Flow代替rxjava,开发更加顺滑
public fun <T> Flow<BaseResult<T>>.subscribe(scope: CoroutineScope,success: (T?) -> Unit,
onServerError: (ResponseThrowable) -> Unit = {}){
this.onEach {
when(it.errorCode){
0->success(it.data)
}
}.catch {
val exception = ExceptionHandle.handleException(it)
onServerError(exception)
LogUtils.d("error",exception.message)
}
.launchIn(scope)
}
NetworkManager.instance.getBanner()
.onStart { showLoading() }
.onCompletion { dismissLoading() }
.subscribe(viewModelScope,{
})
- 首页最新文章
- 公众号列表
- 搜索
- 每日一问文章列表
- 广场文章列表
- 项目文章列表
- 知识体系
- 网站导航
- 收藏、分享文章
- 代办清单
- 用户详细页
- 积分详细、排名
- 换肤
- 玩Android 网站 - 鸿洋大佬
- Kotlin - JetBrains
- Kotlinx.Coroutines - Kotlin
- Retrofit - Square
- OkHttp - Square
- Gson - Google
- Coil - coil-kt
- CircleImageView - hdodenhof
- Bindingcollectionadapter - evant
- AgentWeb - Justson
- banner - youth5201314
如果本项目对你有帮助,请点击右上角的 start 支持一下