WeBuzzProject
一款項目的基礎框架搭建
主要運用mvp模式編程+相關插件的運用,可複用借鑑到自己項目中去
基本架構Architecture
- 主流框架:Glide + Retrofit + RxJava2.0 + butterknife
- 採用MVP模式進行解耦
本項目用到的主要開源庫Dependencies
- Butterknife
- Glide
- Rxjava2
- Retrofit
- Fragmention
- Bugly
- RxPapazzo
- DBFlow
- AndroidUtilCode
- SHSegmentControl
- logger
- RxPermission
設計相關代碼:
- MultiDex/Logger /CrashReport/FlowManager/Rxpaparazzo初始化
MultiDex.install(this);
Logger.addLogAdapter(new AndroidLogAdapter());
CrashReport.initCrashReport(this, "fe25273ca", true);
FlowManager.init(this);
RxPaparazzo.register(this);
- 定義apk名字
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
// 獲取渠道
def flavor = variant.productFlavors[0]
def flavorName
if (flavor == null) {
flavorName = "webuzz"
} else {
flavorName = flavor.name
}
if (outputFile != null && outputFile.name.endsWith('.apk')) {
def fileName = "webuzz_v${defaultConfig.versionName}_${buildTime()}_${flavorName}.apk"
output.outputFile = new File(outputFile.parent, fileName)
}
}
}