Files
zhanglei 7ea14ab925 feat(init): 初始化健康专家客户端 Android 项目
- 搭建项目基础架构,包含 Activity/Fragment/ViewModel 层
- 添加登录、主页、AI聊天、工作台、消息、知识库等核心模块
- 配置 Gradle 构建脚本及依赖管理
- 添加基础 UI 组件:自定义密码输入框、标题栏、Tab 布局等
- 添加图标、主题、drawable 等资源文件
2026-04-22 16:34:35 +08:00

227 lines
12 KiB
Groovy

ext {
minSdkVersion = 26
targetSdkVersion = 33
compileSdkVersion = 34
versionCode = 15
versionName = "1.0.25"
//Dependencies
junitVersion = "4.12"
lifecycleVersion = "2.6.0-alpha01"
kotlinVersion = "1.7.10"
glideVersion = "4.13.0"
recycleViewVersion = "1.2.1"
appcompatVersion = "1.5.0"
materialVersion = "1.5.0-alpha04"
rxPermissions = "0.10.2"
archCore = "2.1.0"
agentWebVersion = "v5.0.6-androidx"
immersionbar = "3.2.2"
coroutinesVersion = "1.6.4"
pictureselector = "v3.10.8"
androidPicker = "4.1.11"
materialDialogs = "3.3.0"
composeBomVersion = "2024.09.00"
activityComposeVersion = "1.8.0"
viewModelComposeVersion = "2.6.2"
androidxDeps = [
"appcompat" : "androidx.appcompat:appcompat:$appcompatVersion",
"multidex" : "androidx.multidex:multidex:2.0.1",
"vectordrawable" : "androidx.vectordrawable:vectordrawable:1.1.0",
"vectordrawable-animated": "androidx.vectordrawable:vectordrawable-animated:1.1.0",
"annotation" : "androidx.annotation:annotation:1.2.0",
"material" : "com.google.android.material:material:$materialVersion",
"core-common" : "androidx.arch.core:core-common:$archCore",
"core-testing" : "androidx.arch.core:core-testing:$archCore",
"core-runtime" : "androidx.arch.core:core-runtime:$archCore",
"coreKtx" : "androidx.core:core-ktx:1.8.0",
"kotlin-reflect" : "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion",
//协程
"coroutines-core" : "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion",
"coroutines-android" : "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion",
//RecycleView
"recyclerview" : "androidx.recyclerview:recyclerview:$recycleViewVersion"
]
jetpackDeps = [
// Lifecycles only (without ViewModel or LiveData)
"runtime" : "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion",
// Saved state module for ViewModel
"savedstate" : "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycleVersion",
// Annotation processor
"lifecycle-compiler": "androidx.lifecycle:lifecycle-compiler:$lifecycleVersion",
// alternately - if using Java8, use the following instead of lifecycle-compiler
"common-java8" : "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion",
// optional - helpers for implementing LifecycleOwner in a Service
"service" : "androidx.lifecycle:lifecycle-service:$lifecycleVersion",
// optional - ProcessLifecycleOwner provides a lifecycle for the whole application process
"process" : "androidx.lifecycle:lifecycle-process:$lifecycleVersion",
// optional - ReactiveStreams support for LiveData
"reactivestreams" : "androidx.lifecycle:lifecycle-reactivestreams-ktx:$lifecycleVersion",
"viewModelKtx" : "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion",
"liveDataKtx" : "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion",
"activityKtx" : "androidx.activity:activity-ktx:1.2.3",
"exifinterface" : "androidx.exifinterface:exifinterface:1.3.6",
//ViewPager2
"viewpager2" : "androidx.viewpager2:viewpager2:1.0.0",
// CardView
"cardview" : "androidx.cardview:cardview:1.0.0",
// google官方的flex布局
"flexbox" : "com.google.android.flexbox:flexbox:3.0.0",
/*dataStore库*/
"datastore" : "androidx.datastore:datastore-preferences:1.0.0",
/*数据库*/
"room-ktx" : "androidx.room:room-ktx:2.2.5",
"room-compiler" : "androidx.room:room-compiler:2.2.5",
/*activity拓展库,因compileSdkVersion为32,所以使用1.5.1版本,需要升级更高版本的话需同时升级compileSdkVersion版本*/
"activity" : "androidx.activity:activity-ktx:1.5.1",
"fragment" : "androidx.fragment:fragment-ktx:1.5.5"
]
glideDeps = [
"glide" : "com.github.bumptech.glide:glide:$glideVersion",
"compiler": "com.github.bumptech.glide:compiler:$glideVersion"
]
agentWebDeps = [
"agentweb-core" : "com.github.Justson.AgentWeb:agentweb-core:$agentWebVersion",
"agentweb-filechooser": "com.github.Justson.AgentWeb:agentweb-filechooser:$agentWebVersion",
"Downloader" : "com.github.Justson:Downloader:v5.0.0-androidx"
]
networkDeps = [
//retrofit请求框架
"retrofit" : "com.squareup.retrofit2:retrofit:2.9.0",
"converter-moshi" : "com.squareup.retrofit2:converter-moshi:2.9.0",
//Gson转换
"converterGson" : "com.squareup.retrofit2:converter-gson:2.9.0",
//okhttp3 日志拦截器
"loggingInterceptor" : "com.squareup.okhttp3:logging-interceptor:4.8.0",
//okhttp3 缓存
"PersistentCookieJar": "com.github.franmontiel:PersistentCookieJar:v1.0.1"
]
mapDeps = [
//高德地图
"map3d" : "com.amap.api:3dmap:10.0.600",
"search" : "com.amap.api:search:9.7.0",
// "location" : "com.amap.api:location:latest.integration",
]
// jPushDeps = [
// "jpush" : "cn.jiguang.sdk:jpush:$jPushVersion",
// // 接入华为厂商
// "hms-push" : "com.huawei.hms:push:6.11.0.300",
// "huawei-plugin" : "cn.jiguang.sdk.plugin:huawei:$jPushVersion",
// // 接入 VIVO 厂商
// "vivo-plugin" : "cn.jiguang.sdk.plugin:vivo:$jPushVersion",
// // 接入小米厂商
// "xiaomi-plugin" : "cn.jiguang.sdk.plugin:xiaomi:$jPushVersion",
// // 接入 OPPO 厂商
// "oppo-plugin" : "cn.jiguang.sdk.plugin:oppo:$jPushVersion",
// //以下为 OPPO 3.1.0 aar需要依赖
// "gson" : "com.google.code.gson:gson:2.6.2",
// "commons-codec" : "commons-codec:commons-codec:1.6",
// // 接入荣耀厂商
// "honor-plugin" : "cn.jiguang.sdk.plugin:honor:$jPushVersion",
// ]
commonDeps = [
/*下拉刷新*/
"swiperefreshlayout" : "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0",
/*EventBus*/
"eventbus" : "org.greenrobot:eventbus:3.1.1",
/*BaseRecyclerViewAdapterHelper*/
"BaseRecyclerViewAdapterHelper": "com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.10",
// immersionbar基础依赖包,必须要依赖
"immersionbar" : "com.geyifeng.immersionbar:immersionbar:$immersionbar",
// fragment快速实现(可选)
"immersionbar-ktx" : "com.geyifeng.immersionbar:immersionbar-ktx:$immersionbar",
//多图片选择器 基础 (必须)
"pictureselector" : "io.github.lucksiege:pictureselector:$pictureselector",
// 图片压缩 (按需引入)
"compress" : "io.github.lucksiege:compress:$pictureselector",
// 图片裁剪 (按需引入)
"ucrop" : "io.github.lucksiege:ucrop:$pictureselector",
//检查更新
"UpdatePlugin" : "com.github.yjfnypeu:UpdatePlugin:3.1.3",
// // 屏幕适配https://github.com/JessYanCoding/AndroidAutoSize
// "AndroidAutoSize" : 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1',
"assent" : "com.afollestad:assent:2.3.1",
"dots_indicator" : "com.afollestad:viewpagerdots:1.0.0",
"date_picker" : "com.afollestad:date-picker:0.6.1",
//图片轮播控件
"banner" : "io.github.youth5201314:banner:2.2.2",
//满足日常大部分布局样式的TextView
"SuperTextView" : "com.github.lygttpod:SuperTextView:2.4.6",
//动态权限申请
"permissionx" : "com.guolindev.permissionx:permissionx:1.7.1",
//recyclerview分组,顶部浮动
// "stickyheadersrecyclerview" : "com.timehop.stickyheadersrecyclerview:library:0.4.3@aar",
//圆形ImageView
"RoundImageView" : "com.github.xiaofeidev:round:1.1.1",
//小红点
"badgeview" : "q.rorbin:badgeview:1.1.3",
//log打印工具
"logger" : "com.orhanobut:logger:2.2.0",
// //首页框架
// "MarqueeView" : "com.sunfusheng:MarqueeView:1.4.0",
//加密数据库
"android-database-sqlcipher" : "net.zetetic:android-database-sqlcipher:4.3.0@aar",
// material风格功能强大的Dialog
"materialDialogsCore" : "com.afollestad.material-dialogs:core:$materialDialogs",
"materialDialogsLifecycle" : "com.afollestad.material-dialogs:lifecycle:$materialDialogs",
"materialDialogsbottomsheets" : "com.afollestad.material-dialogs:bottomsheets:$materialDialogs",
/*日期和时间选择器*/
"CalendarPicker" : "com.github.gzu-liyujiang.AndroidPicker:CalendarPicker:$androidPicker",
/*基础通用选择器*/
"AndroidPicker" : "com.github.gzu-liyujiang.AndroidPicker:Common:$androidPicker",
/*滚轮选择器的滚轮控件*/
"WheelPicker" : "com.github.gzu-liyujiang.AndroidPicker:WheelPicker:$androidPicker",
/*滚轮选择器的滚轮控件*/
"WheelView" : "com.github.gzu-liyujiang.AndroidPicker:WheelView:$androidPicker",
//图表
"MPAndroidChart" : "com.github.PhilJay:MPAndroidChart:v3.1.0",
/*虚线*/
// "dashview" : "com.fang:dashview:v1.0.0"
]
composeDeps = [
/*Compose BOM 统一版本管理*/
"compose-bom" : "androidx.compose:compose-bom:$composeBomVersion",
/*Compose UI 核心*/
"ui" : "androidx.compose.ui:ui",
/*Compose 图形*/
"ui-graphics" : "androidx.compose.ui:ui-graphics",
/*Compose 预览支持*/
"ui-tooling-preview": "androidx.compose.ui:ui-tooling-preview",
/*Material3 组件库*/
"material3" : "androidx.compose.material3:material3",
/*Activity 与 Compose 集成*/
"activity-compose" : "androidx.activity:activity-compose:$activityComposeVersion",
/*ViewModel 与 Compose 集成*/
"viewmodel-compose" : "androidx.lifecycle:lifecycle-viewmodel-compose:$viewModelComposeVersion",
]
composeDebugDeps = [
/*Compose UI 调试工具*/
"ui-tooling" : "androidx.compose.ui:ui-tooling",
/*Compose 测试 Manifest*/
"ui-test-manifest": "androidx.compose.ui:ui-test-manifest",
]
androidxLibs = androidxDeps.values()
jetpackLibs = jetpackDeps.values()
glideLibs = glideDeps.values()
agentWebLibs = agentWebDeps.values()
networkLibs = networkDeps.values()
mapLibs = mapDeps.values()
// jPushLibs = jPushDeps.values()
commonLibs = commonDeps.values()
composeLibs = composeDeps.values()
composeDebugLibs = composeDebugDeps.values()
annotationProcessorLibs = [
jetpackDeps["lifecycle-compiler"],
jetpackDeps["room-compiler"],
glideDeps["compiler"]
]
}