- Notifications
You must be signed in to change notification settings - Fork17
☘☘Relax 基于Kotlin语言编写的一套组件化框架,不紧整体组件化、内部也高度组件化🎋你可配置MVP、MVVM的开发模式、也可以配置所需要的业务组件🍁🍁
License
NotificationsYou must be signed in to change notification settings
UCodeUStory/Relax
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Relax 基于Kotlin语言编写的一套组件化框架,内部可以实现灵活的配置
Relax is a android frame by Component Frame
业务层,分解成独立的模块 module-business-news module-business-weather module-business-welfare module-business-four 每个模块内部可以实现插件化跟细粒度小功能
基础业务层和可变的第三方业务(比如地图封装、IM封装、日志上传封装、友盟统计封装、Bugly封装,这些业务我们 情景1:可能实现方式会变(如图片加载之前用glide,现在想用Fresco,所以通过接口统一实现; 情景2:有些业务可能在不同的App宿主中不需要,所以提供动态配置来减少安装包体积)) 所以针对第三方业务实现,通过分别实现不同的依赖库封装在BusinessFactory中,同时通过factoryinterface提供 统一接口
数据层,提供业务数据,包含网络数据、本地数据,SP数据
基础组件层, 一些框架必须要用的library、核心的架构实现、如mvvm、mvp基础架构、自定义UI组件等
公共依赖集合,提供统一配置
### 库和应用两种模式间切换### 只有app 为false 其他模块才可以设置truerelaxBusinessPlugin_isApp = falserelaxBusinessNews_isApp = falserelaxBusinessWeather_isApp = truerelaxBusinessWelfare_isApp = falserelaxBusinessComponent_isApp= false### 启用检查代码 启用会牺牲打包时间isCheckCode = false### 动态配置减少打包体积glideEnable = truepicassoEnable = falseisMVVM = trueisMVP = falseisApp = false
内部我们可以通过Retrofit、OkHttp、Volley等来实现网络请求,(项目核心使用rxjava来完成数据流,如果用其他网络框架,也尽量返回Observable,来保证封装一致性)
例子:module-business-plugin模块就是用插件化实现的,具体插件式项目中的RelaxPluginDemo
- Lifecycles - Create a UI that automatically responds to lifecycle events.
- LiveData - Build data objects that notify views when the underlying database changes.
- Navigation - Handle everything needed for in-app navigation.
- Room - Access your app's SQLite database with in-app objects and compile-time checks.
- ViewModel - Store UI-related data that isn't destroyed on app rotations. Easily scheduleasynchronous tasks for optimal execution.
- WorkManager - Manage your Android background jobs.
- UI - Details on why and how to use UI Components in your apps - together or separate
- Animations & Transitions - Move widgets and transition between screens.
- Fragment - A basic unit of composable UI.
- Layout - Lay out widgets using different algorithms.
- Third party
- Glide for image loading
- Rxjava for Reactive Programming
- ARouter A framework for assisting in the renovation of Android app componentization
- Retrofit A restful client
- EventBus An Android event publish/subscribe lightweight framework
- Dagger a fully static, compile-time dependency injection framework for both Java and Android.
- GSON Tool class for converting Java objects to Json strings and Json strings to objects
- LeakCannary Is the main tool for Android to find memory leaks.
- Aspect optimize your contact center performance through improved customer service and efficiency.
- Koin A pragmatic lightweight dependency injection framework for Kotlin developers. Written in pure Kotlin using functional resolution only: no proxy, no code generation, no reflection!