All Projects → guofudong → Kotlinandroid

guofudong / Kotlinandroid

组件化 + MVP + Retrofit + RxKotlin + Dagger2实现的一款用Kotlin语言编写的多媒体类应用。

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Kotlinandroid

Fineract-CN-mobile
DEPRECATED project - Check the Apache fineract-cn-mobile project instead
Stars: ✭ 17 (-96.23%)
Mutual labels:  mvp, dagger2
KotlinMvpTemplateGenerator
Android Studio template for Kotlin with MVP + Dagger2 + Retrofit2
Stars: ✭ 65 (-85.59%)
Mutual labels:  mvp, dagger2
Clean Marvel Kotlin
This repository contains a detailed sample app that implements Clean architecture and MVP in Kotlin using RxJava2, Retrofit
Stars: ✭ 27 (-94.01%)
Mutual labels:  mvp, dagger2
Weather-Guru-MVP
Sample Material-design Android weather application build with MVP architectural approach using Dagger2, RxJava2, Retrofit2, Event-Bus, GreenDao, Butterknife, Lottie etc.
Stars: ✭ 15 (-96.67%)
Mutual labels:  mvp, dagger2
Bilisoleil
An unofficial bilibili client for android --rxjava2+mvp+okhttp3+retrofit2+dagger2
Stars: ✭ 430 (-4.66%)
Mutual labels:  dagger2, mvp
idreminder
Simple reminder app build with Kotlin + Clean Architecture + RxJava + Dagger2 + MVP + Room
Stars: ✭ 29 (-93.57%)
Mutual labels:  mvp, dagger2
AndroidMVPArchitecture
Android MVP architecture sample project with or without RxJava and Dagger2 and Kotlin
Stars: ✭ 78 (-82.71%)
Mutual labels:  mvp, dagger2
CleanArchitecture-SocketIO
CleanArchitecture with SocketIo 📡
Stars: ✭ 32 (-92.9%)
Mutual labels:  mvp, dagger2
Kotlin Android Mvp Starter
Create/Generate your kotlin MVP projects easily
Stars: ✭ 270 (-40.13%)
Mutual labels:  dagger2, mvp
UTair-MVP-Sample
Android Clean Architecture + MVP Sample written in Kotlin
Stars: ✭ 27 (-94.01%)
Mutual labels:  mvp, dagger2
GithubApp-android-architecture
Let's learn a deep look at the Android architecture
Stars: ✭ 16 (-96.45%)
Mutual labels:  mvp, dagger2
Crazydaily
[开源项目] 一款程序员日常放松的App,基于Material Design + MVP-Clean + Weex + Flutter + RxJava2 + Retrofit + Dagger2 + Glide + Okhttp + MTRVA + BRVAH + 炫酷控件 + 炫酷动画
Stars: ✭ 294 (-34.81%)
Mutual labels:  dagger2, mvp
DaggerAutoInject
Inject automatically your Activities & Fragments, just with a simple annotation
Stars: ✭ 49 (-89.14%)
Mutual labels:  mvp, dagger2
BookReader
📕 "任阅" 网络小说阅读器,3D翻页效果、txt/pdf/epub书籍阅读、Wifi传书~
Stars: ✭ 6,113 (+1255.43%)
Mutual labels:  mvp, dagger2
android-template
Template for android development at Tiki
Stars: ✭ 17 (-96.23%)
Mutual labels:  mvp, dagger2
mvp-android-template
MVP Android Template to give you a Quick Head Start for your next Android Project. It implements MVP Architecture using Dagger2, Room, RxJava2 , Retrofit2
Stars: ✭ 20 (-95.57%)
Mutual labels:  mvp, dagger2
DaggerAndroidMVP
Demonstrates using Dagger 2.10+ in MVP app that follows Clean Architecture, RxJava 2, RxRelay
Stars: ✭ 43 (-90.47%)
Mutual labels:  mvp, dagger2
Klean-ArchiteKture
Kotlin Android clean-architecture demo project for a meetup talk. Slides: https://docs.google.com/presentation/d/1CxnntHf3CorNDicx_cDN5s1t5pEbUwjwWHZ5PNmfe6Y/edit?usp=sharing
Stars: ✭ 10 (-97.78%)
Mutual labels:  mvp, dagger2
rxify
Now: RxJava Playground, Previous: Demo for the talk at DroidconIN 2016, Droidcon Boston 2017 and Codelab for GDG January Meetup
Stars: ✭ 59 (-86.92%)
Mutual labels:  mvp, dagger2
Mvp Dagger2 Rxjava2
Android 基本mvp+dagger(dagger2.android)+rxjava2+retrofit+ormdb框架。简单组件化架构 with Base Activity,Presenter ,View,Model 的抽象封装,http 请求封装&错误统一处理
Stars: ✭ 274 (-39.25%)
Mutual labels:  dagger2, mvp

KotlinAndroid

基于组件化 + MVP + Retrofit + RxKotlin + Dagger2实现的一款用Kotlin语言编写的影视类应用。

说明

PluginSwitch:插件项目

如何使用Android Studio开发Gradle插件

实现了两个功能:

  • 1.自动切换library和Application

如果gradle.properties中配置了isRunAlone=true,也就是能够独立运行,那么点击运行按钮可以选择该模块自动运行,无需在build.gradle文件中配置。如果运行的是主module,不管其依赖的module是否可以独立运行,插件自动设置为library。实现真正的自动切换。

//不需要再通过变量来控制了
if(isHomeModule.toBoolean()){
    apply plugin: 'com.android.library'
}else{
    apply plugin: 'com.android.application'
}
//省略资源目录的配置

效果图:

  • 2.主Module在开发时不依赖业务模块,只要在运行打包时才依赖,彻底避免业务模块之间的耦合

通过在build.gradle配置,通过字节码插桩来实现的。

主module依赖其他模块配置在该目录下的gradle.properties中配置:
debugComponent=Home,Crosstalk,Music,Player //debug时依赖的
compileComponent=Home,Crosstalk,Music,Player //release时依赖的

不需要在build.gradle中依赖了
api project(':Home')
api project(':Music')
.....

这样主Module在开发时不再依赖具体的业务模块,只是使用业务模块提供的服务,所以业务模块需要实现Provider模块定义的接口,提供具体的业务。

interface IApplicationLike {

    /** 组件加载*/
    fun registered()

    /** 组件卸载*/
    fun unregistered()
}

//定义Music模块提供的服务
interface MusicService {

    fun getMusicFragment(): BaseFragment

}

组件之间页面跳转(通信)使用的是路由:ARouter

componentrelease:文件夹

该文件夹存放的是业务模块的.aar包,在执行业务Module的assembleRelease命令后会生成对应的.aar包,也可以上传到maven仓库。这样的话主Module只需要依赖.arr包。 哪个业务Module改变只需要编译哪个生成对应的.aar包即可,实现真正的组件化。

如果项目中的module很多,gradle在编译的时候会去检测module的依赖链,gradle会帮助我们层层梳理module之间的关系,避免因为module之间相互引用而来带的问题。 这些梳理工作和module的合并工作都会带来build的时间,会造成build十分缓慢,所以将稳定的module打包为aar,上传到公司的maven仓库,借此来加快build速度。

API说明

项目中用到的数据都是通过解析网站数据而来,所以没有固定的接口格式。因此没有封装统一的网络工具类,而使用三方库okhttp-OkGo来请求,便于解析数据。

Jsoup

音乐API

build文件

common.gradle:三方依赖库和版本管理,统一放在该文件中。

and_res_guard.gradle:微信开源工具AndResGuard资源文件"混淆"配置文件。

Android打包那些事

libbase.gradle:多Module build文件公共部分抽取。

releaseinfo.gradle:版本发布文档自动维护脚本

<?xml version="1.0" encoding="GBK"?>
<!-- 该文档自动生成,只需要在build中配置版本更新日志。-->
<releases>
  <release>
    <versionCode>1</versionCode>
    <versionName>1.0.0</versionName>
    <versionInfo>App的第1个版本,上线了一些最基础核心的功能。</versionInfo>
  </release>

<release>
  <versionCode>110</versionCode>
  <versionName>1.1.0</versionName>
  <versionInfo>App的第2个版本,修复网络数据解析问题,处于稳定版本。</versionInfo>
</release>
</releases>

Gradle实战

屏幕适配

采用smallestWidth适配

smallestWidth限定符适配和宽高限定符适配最大的区别在于,前者有很好的容错机制,如果没有对应dp文件夹,系统会向下寻找,比如离360dp最近的只有value-sw350dp,那么Android就会选择value-sw350dp文件夹下面的资源文件。这个特性就完美的解决了上文提到的宽高限定符的容错问题。

自动生成适配文件工具 AndroidUI屏幕适配

模块化结构图

Common为公共库,主要包含一些基类和常用的工具类,Provider依赖于Common,是模块真正依赖的库。其中业务模块包括:Home,Music,User,Player。每个业务模块对应一个Module。主模块APP和业务模块都依赖Provider,主模块APP在开发阶段不再依赖具体的业务模块,彻底隔离业务模块之间的耦合。业务模块统一实现Provider中定义的接口,暴露需要提供的服务。

效果图

首页模块

音乐模块

电视直播,相声模块

关注公众号,获取更多资源

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].