- 项目基于Kotlin语言,采用ViewModel+LiveData实现MVVM架构。
- 网络请求采用协程,数据库采用Room。
- 界面黑白配色,优雅美观,适合阅读。
- 适配了白天黑夜模式。
- 首页(搜索、热门、最新、广场、项目、公众号)
- 体系
- 发现(搜索、分享文章、Banner、热搜、常用网站)
- 导航
- 我的(登录、注册、我的积分、积分排行、我的分享、我的收藏、浏览历史)
- 系统设置(日夜间模式、文章字体大小、清除缓存)
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Kotlin+JetPack+协程实现的MVVM架构Wanandroid客户端
这个功能可以改变所有页面的字体大小吗?还是只是一个演示
kotlin-android-extensions已经弃用了
/**
* 创建并执行协程
* @param block 协程中执行
* @param error 错误时执行
* @return Job
*/
protected fun launch(block: Block, error: Error? = null, cancel: Cancel? = null): Job {
return viewModelScope.launch {
try {
block.invoke()
} catch (e: Exception) {
when (e) {
is CancellationException -> {
cancel?.invoke(e)
}
else -> {
onError(e)
error?.invoke(e)
}
}
}
}
}
如题,为什么不加注释?
感谢大佬的开源,在代码中很多地方有点不懂,希望大佬可以写上注释,谢谢了
这个框架很不错,给作者个赞!基础框架要达到实际应用还少一些功能,上传文件和下载文件、证书之类的 有没有考虑加呢
比如 val topArticleListDefferd = async {
popularRepository.getTopArticleList()
}
这个async又调用到BaseViewModel的async 方法,而BaseViewModel的async 方法又调用:
return viewModelScope.async { block.invoke() }
为什么要多转一道呢?
字体大小设置不了
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.