Commit 9fc165e3ca16d4ee1b42d66610c3d5b58142f0f5
1 parent
9d201a4dbb
Exists in
master
取消Arouter引用
Showing
5 changed files
with
6 additions
and
233 deletions
Show diff stats
app/build.gradle
1 | apply plugin: 'com.android.application' | 1 | apply plugin: 'com.android.application' |
2 | apply from: '../config.gradle' | ||
3 | 2 | ||
4 | 3 | ||
5 | def androidId = rootProject.ext.androidId | 4 | def androidId = rootProject.ext.androidId |
6 | def support = rootProject.ext.dependencies | 5 | def support = rootProject.ext.dependencies |
7 | def url = rootProject.ext.url | 6 | def url = rootProject.ext.url |
8 | 7 | ||
9 | 8 | ||
10 | android { | 9 | android { |
11 | signingConfigs { | 10 | signingConfigs { |
12 | 11 | ||
13 | config { | 12 | config { |
14 | keyAlias 'alias' | 13 | keyAlias 'alias' |
15 | keyPassword '123456' | 14 | keyPassword '123456' |
16 | storeFile file('key.jks') | 15 | storeFile file('key.jks') |
17 | storePassword '123456' | 16 | storePassword '123456' |
18 | } | 17 | } |
19 | debug { | 18 | debug { |
20 | } | 19 | } |
21 | } | 20 | } |
22 | compileSdk 32 | 21 | compileSdk 32 |
23 | 22 | ||
24 | defaultConfig { | 23 | defaultConfig { |
25 | applicationId "com.hjx.parent" | 24 | applicationId "com.hjx.parent" |
26 | minSdk 26 | 25 | minSdk 26 |
27 | targetSdk 32 | 26 | targetSdk 32 |
28 | versionCode 1006 | 27 | versionCode 1006 |
29 | versionName "1.0.0.6" | 28 | versionName "1.0.0.6" |
30 | 29 | ||
31 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | 30 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
32 | } | 31 | } |
33 | 32 | ||
34 | android.applicationVariants.all { | 33 | android.applicationVariants.all { |
35 | variant -> | 34 | variant -> |
36 | variant.outputs.all { | 35 | variant.outputs.all { |
37 | //在这里修改apk文件名 | 36 | //在这里修改apk文件名 |
38 | outputFileName = "parent-${variant.name}-v${variant.versionName}.apk" | 37 | outputFileName = "parent-${variant.name}-v${variant.versionName}.apk" |
39 | } | 38 | } |
40 | } | 39 | } |
41 | buildTypes { | 40 | buildTypes { |
42 | debug { | 41 | debug { |
43 | debuggable true | 42 | debuggable true |
44 | minifyEnabled false | 43 | minifyEnabled false |
45 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | 44 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
46 | signingConfig signingConfigs.config | 45 | signingConfig signingConfigs.config |
47 | } | 46 | } |
48 | release { | 47 | release { |
49 | debuggable true | 48 | debuggable true |
50 | minifyEnabled false | 49 | minifyEnabled false |
51 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | 50 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
52 | signingConfig signingConfigs.config | 51 | signingConfig signingConfigs.config |
53 | } | 52 | } |
54 | } | 53 | } |
55 | lintOptions { | 54 | lintOptions { |
56 | checkReleaseBuilds false | 55 | checkReleaseBuilds false |
57 | abortOnError false | 56 | abortOnError false |
58 | } | 57 | } |
59 | buildFeatures { | 58 | buildFeatures { |
60 | viewBinding true | 59 | viewBinding true |
61 | dataBinding true | 60 | dataBinding true |
62 | } | 61 | } |
63 | compileOptions { | 62 | compileOptions { |
64 | sourceCompatibility JavaVersion.VERSION_1_8 | 63 | sourceCompatibility JavaVersion.VERSION_1_8 |
65 | targetCompatibility JavaVersion.VERSION_1_8 | 64 | targetCompatibility JavaVersion.VERSION_1_8 |
66 | } | 65 | } |
67 | } | 66 | } |
68 | 67 | ||
69 | dependencies { | 68 | dependencies { |
70 | support.each { k, v -> implementation v } | 69 | support.each { k, v -> implementation v } |
71 | api project(path: ':libs:common') | 70 | api project(path: ':libs:common') |
72 | implementation 'androidx.appcompat:appcompat:1.5.1' | 71 | implementation 'androidx.appcompat:appcompat:1.5.1' |
73 | implementation 'com.google.android.material:material:1.6.1' | 72 | implementation 'com.google.android.material:material:1.6.1' |
74 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | 73 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' |
75 | implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50' | 74 | implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50' |
76 | implementation 'com.github.ForgetAll:LoadingDialog:1.1.2' | 75 | implementation 'com.github.ForgetAll:LoadingDialog:1.1.2' |
77 | implementation 'com.github.DL-ZhangTeng:ImagePicker:1.5.0' | 76 | implementation 'com.github.DL-ZhangTeng:ImagePicker:1.5.0' |
78 | //使用的三方 | 77 | //使用的三方 |
79 | implementation 'com.yalantis:ucrop:2.2.0' | 78 | implementation 'com.yalantis:ucrop:2.2.0' |
80 | implementation 'com.github.DL-ZhangTeng:RequestPermission:1.3.0' | 79 | implementation 'com.github.DL-ZhangTeng:RequestPermission:1.3.0' |
81 | implementation 'com.github.DL-ZhangTeng:Utils:2.2.0' | 80 | implementation 'com.github.DL-ZhangTeng:Utils:2.2.0' |
82 | 81 | ||
83 | // rx | 82 | // rx |
84 | implementation("com.trello.rxlifecycle2:rxlifecycle:2.2.2") | 83 | implementation("com.trello.rxlifecycle2:rxlifecycle:2.2.2") |
85 | implementation("com.trello.rxlifecycle2:rxlifecycle-android:2.2.2") | 84 | implementation("com.trello.rxlifecycle2:rxlifecycle-android:2.2.2") |
86 | 85 | ||
87 | implementation("com.github.PhilJay:MPAndroidChart:v3.1.0") | 86 | implementation("com.github.PhilJay:MPAndroidChart:v3.1.0") |
88 | implementation("com.contrarywind:Android-PickerView:4.1.9") | 87 | implementation("com.contrarywind:Android-PickerView:4.1.9") |
89 | 88 | ||
90 | implementation 'com.google.android:flexbox:1.0.0' | 89 | implementation 'com.google.android:flexbox:1.0.0' |
91 | 90 | ||
92 | // 沉浸式状态栏和他的Kotlin拓展 | 91 | // 沉浸式状态栏和他的Kotlin拓展 |
93 | implementation 'com.geyifeng.immersionbar:immersionbar:3.2.2' | 92 | implementation 'com.geyifeng.immersionbar:immersionbar:3.2.2' |
94 | implementation 'com.geyifeng.immersionbar:immersionbar-ktx:3.2.2' | 93 | implementation 'com.geyifeng.immersionbar:immersionbar-ktx:3.2.2' |
95 | 94 | ||
96 | // 图片查看 | 95 | // 图片查看 |
97 | implementation 'com.github.chrisbanes:PhotoView:2.0.0' | 96 | implementation 'com.github.chrisbanes:PhotoView:2.0.0' |
97 | |||
98 | implementation 'com.jakewharton:butterknife:10.2.3' | ||
99 | annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3' |
build.gradle
1 | buildscript { | 1 | buildscript { |
2 | 2 | ||
3 | 3 | ||
4 | ext { | 4 | ext { |
5 | 5 | ||
6 | 6 | ||
7 | androidId = [ | 7 | androidId = [ |
8 | compileSdkVersion: 32, | 8 | compileSdkVersion: 32, |
9 | minSdkVersion : 26, | 9 | minSdkVersion : 26, |
10 | targetSdkVersion : 32, | 10 | targetSdkVersion : 32, |
11 | versionCode : 1, | 11 | versionCode : 1, |
12 | versionName : "0.0.1" | 12 | versionName : "0.0.1" |
13 | 13 | ||
14 | 14 | ||
15 | ] | 15 | ] |
16 | 16 | ||
17 | 17 | ||
18 | url = [ | 18 | url = [ |
19 | server_url : "http://192.168.3.144:8088", //http 请求指令 | 19 | server_url : "http://192.168.3.144:8088", //http 请求指令 |
20 | server_url_online: "https://mgr.hjx.com", //http 请求指令 | 20 | server_url_online: "https://mgr.hjx.com", //http 请求指令 |
21 | ] | 21 | ] |
22 | 22 | ||
23 | 23 | ||
24 | dependencies = [ | 24 | dependencies = [ |
25 | appcompat : 'androidx.appcompat:appcompat:1.0.0', | 25 | appcompat : 'androidx.appcompat:appcompat:1.0.0', |
26 | constraint : 'androidx.constraintlayout:constraintlayout:1.1.3', | 26 | constraint : 'androidx.constraintlayout:constraintlayout:1.1.3', |
27 | cardview : 'androidx.cardview:cardview:1.0.0', | 27 | cardview : 'androidx.cardview:cardview:1.0.0', |
28 | recyclerview : 'androidx.recyclerview:recyclerview:1.0.0', | 28 | recyclerview : 'androidx.recyclerview:recyclerview:1.0.0', |
29 | material : 'com.google.android.material:material:1.0.0', | 29 | material : 'com.google.android.material:material:1.0.0', |
30 | // 依赖RxAndroid 2X 的依赖库 | 30 | // 依赖RxAndroid 2X 的依赖库 |
31 | // 增加RxJava 2X 的依赖库 | 31 | // 增加RxJava 2X 的依赖库 |
32 | rxandroid : 'io.reactivex.rxjava2:rxandroid:2.0.1', | 32 | rxandroid : 'io.reactivex.rxjava2:rxandroid:2.0.1', |
33 | rxjava : 'io.reactivex.rxjava2:rxjava:2.0.7', | 33 | rxjava : 'io.reactivex.rxjava2:rxjava:2.0.7', |
34 | 34 | ||
35 | // 以下需要使用Retrofit | 35 | // 以下需要使用Retrofit |
36 | //retrofit | 36 | //retrofit |
37 | retrofit : 'com.squareup.retrofit2:retrofit:2.1.0', | 37 | retrofit : 'com.squareup.retrofit2:retrofit:2.1.0', |
38 | //Gson converter | 38 | //Gson converter |
39 | converter : 'com.squareup.retrofit2:converter-gson:2.1.0', | 39 | converter : 'com.squareup.retrofit2:converter-gson:2.1.0', |
40 | //RxJava2 Adapter | 40 | //RxJava2 Adapter |
41 | retrofit2 : 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0', | 41 | retrofit2 : 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0', |
42 | //okhttp | 42 | //okhttp |
43 | okhttp : 'com.squareup.okhttp3:okhttp:3.8.1', | 43 | okhttp : 'com.squareup.okhttp3:okhttp:3.8.1', |
44 | logging : 'com.squareup.okhttp3:logging-interceptor:3.4.1', | 44 | logging : 'com.squareup.okhttp3:logging-interceptor:3.4.1', |
45 | // utils : 'com.github.wang-developer:AndroidUtilsDemo:1.0.6', | 45 | // utils : 'com.github.wang-developer:AndroidUtilsDemo:1.0.6', |
46 | commons_lang : 'org.apache.commons:commons-lang3:3.7', | 46 | commons_lang : 'org.apache.commons:commons-lang3:3.7', |
47 | commons_compress: 'org.apache.commons:commons-compress:1.19', | 47 | commons_compress: 'org.apache.commons:commons-compress:1.19', |
48 | commons_c_lang : 'commons-lang:commons-lang:2.3', | 48 | commons_c_lang : 'commons-lang:commons-lang:2.3', |
49 | commons_codec : 'commons-codec:commons-codec:1.7', | 49 | commons_codec : 'commons-codec:commons-codec:1.7', |
50 | eventbus : 'org.greenrobot:eventbus:3.2.0', | 50 | eventbus : 'org.greenrobot:eventbus:3.2.0', |
51 | eventbus2 : 'org.simple:androideventbus:1.0.5.1', | 51 | eventbus2 : 'org.simple:androideventbus:1.0.5.1', |
52 | glide : 'com.github.bumptech.glide:glide:4.6.1', | 52 | glide : 'com.github.bumptech.glide:glide:4.6.1', |
53 | permissions : 'com.github.getActivity:XXPermissions:18.5', | 53 | permissions : 'com.github.getActivity:XXPermissions:18.5', |
54 | orcode : 'cn.yipianfengye.android:zxing-library:2.2' | 54 | orcode : 'cn.yipianfengye.android:zxing-library:2.2' |
55 | // push : 'com.umeng.sdk:push:4.1.0', | 55 | // push : 'com.umeng.sdk:push:4.1.0', |
56 | // litepal : 'org.litepal.android:java:3.0.0', | 56 | // litepal : 'org.litepal.android:java:3.0.0', |
57 | 57 | ||
58 | 58 | ||
59 | // AlivcFFmpeg : 'com.aliyun.video.android:AlivcFFmpeg:2.0.0', | 59 | // AlivcFFmpeg : 'com.aliyun.video.android:AlivcFFmpeg:2.0.0', |
60 | 60 | ||
61 | // | 61 | // |
62 | // basequickadapter : 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34', | 62 | // basequickadapter : 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34', |
63 | // SwipeDelMenuLayout: 'com.github.mcxtzhang:SwipeDelMenuLayout:V1.3.0', | 63 | // SwipeDelMenuLayout: 'com.github.mcxtzhang:SwipeDelMenuLayout:V1.3.0', |
64 | // flycoTabLayout : 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar' | 64 | // flycoTabLayout : 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar' |
65 | 65 | ||
66 | 66 | ||
67 | ] | 67 | ] |
68 | } | 68 | } |
69 | 69 | ||
70 | 70 | ||
71 | repositories { | 71 | repositories { |
72 | maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } | 72 | maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } |
73 | maven { url 'https://maven.aliyun.com/repository/public' } | 73 | maven { url 'https://maven.aliyun.com/repository/public' } |
74 | maven { url 'https://maven.aliyun.com/repository/google' } | 74 | maven { url 'https://maven.aliyun.com/repository/google' } |
75 | maven { url 'https://repo.huaweicloud.com/repository/maven-public/' } | 75 | maven { url 'https://repo.huaweicloud.com/repository/maven-public/' } |
76 | //maven { url 'https://mirrors.cloud.tencent.com/nexus/repository/maven-public/' } | 76 | //maven { url 'https://mirrors.cloud.tencent.com/nexus/repository/maven-public/' } |
77 | 77 | ||
78 | google() | 78 | google() |
79 | mavenCentral() | 79 | mavenCentral() |
80 | gradlePluginPortal() | 80 | gradlePluginPortal() |
81 | maven { url "https://jitpack.io" } | 81 | maven { url "https://jitpack.io" } |
82 | } | 82 | } |
83 | dependencies { | 83 | dependencies { |
84 | classpath 'com.android.tools.build:gradle:4.2.2' | 84 | classpath 'com.android.tools.build:gradle:4.2.2' |
85 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' | 85 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' |
86 | classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' | 86 | classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' |
87 | classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3' | 87 | classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3' |
88 | classpath "com.alibaba:arouter-register:1.0.2" | 88 | //classpath "com.alibaba:arouter-register:1.0.2" |
89 | // NOTE: Do not place your application dependencies here; they belong | 89 | // NOTE: Do not place your application dependencies here; they belong |
90 | // in the individual module build.gradle files | 90 | // in the individual module build.gradle files |
91 | } | 91 | } |
92 | 92 | ||
93 | 93 | ||
94 | } | 94 | } |
95 | 95 | ||
96 | 96 | ||
97 | allprojects { | 97 | allprojects { |
98 | repositories { | 98 | repositories { |
99 | maven { url 'https://maven.aliyun.com/repository/public' } | 99 | maven { url 'https://maven.aliyun.com/repository/public' } |
100 | maven { url 'https://maven.aliyun.com/repository/google' } | 100 | maven { url 'https://maven.aliyun.com/repository/google' } |
101 | maven { url 'https://repo.huaweicloud.com/repository/maven-public/' } | 101 | maven { url 'https://repo.huaweicloud.com/repository/maven-public/' } |
102 | //maven { url 'https://mirrors.cloud.tencent.com/nexus/repository/maven-public/' } | 102 | //maven { url 'https://mirrors.cloud.tencent.com/nexus/repository/maven-public/' } |
103 | 103 | ||
104 | google() | 104 | google() |
105 | mavenCentral() | 105 | mavenCentral() |
106 | maven { url "https://jitpack.io" } | 106 | maven { url "https://jitpack.io" } |
107 | } | 107 | } |
108 | } | 108 | } |
109 | task clean(type: Delete) { | 109 | task clean(type: Delete) { |
110 | delete rootProject.buildDir | 110 | delete rootProject.buildDir |
111 | } | 111 | } |
112 | 112 |
libs/common/build.gradle
1 | apply plugin: 'com.android.library' | 1 | apply plugin: 'com.android.library' |
2 | apply from: '../../config.gradle' | ||
3 | 2 | ||
4 | 3 | ||
5 | def androidId = rootProject.ext.androidId | 4 | def androidId = rootProject.ext.androidId |
6 | def support = rootProject.ext.dependencies | 5 | def support = rootProject.ext.dependencies |
7 | def url = rootProject.ext.url | 6 | def url = rootProject.ext.url |
8 | 7 | ||
9 | 8 | ||
10 | android { | 9 | android { |
11 | compileSdkVersion androidId.compileSdkVersion | 10 | compileSdkVersion androidId.compileSdkVersion |
12 | 11 | ||
13 | 12 | ||
14 | defaultConfig { | 13 | defaultConfig { |
15 | minSdkVersion androidId.minSdkVersion | 14 | minSdkVersion androidId.minSdkVersion |
16 | targetSdkVersion androidId.targetSdkVersion | 15 | targetSdkVersion androidId.targetSdkVersion |
17 | versionCode androidId.versionCode | 16 | versionCode androidId.versionCode |
18 | versionName androidId.versionName | 17 | versionName androidId.versionName |
19 | 18 | ||
20 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | 19 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
21 | 20 | ||
22 | buildConfigField("String", "APIKey1", "\"eCa3YzEjTBBiNjlXcNnjnldP\"") | 21 | buildConfigField("String", "APIKey1", "\"eCa3YzEjTBBiNjlXcNnjnldP\"") |
23 | buildConfigField("String", "SecretKey1", "\"KnZPmjF0ZzmxWV964mzmm6yuDljnETLt\"") | 22 | buildConfigField("String", "SecretKey1", "\"KnZPmjF0ZzmxWV964mzmm6yuDljnETLt\"") |
24 | } | 23 | } |
25 | 24 | ||
26 | buildTypes { | 25 | buildTypes { |
27 | debug { | 26 | debug { |
28 | minifyEnabled false | 27 | minifyEnabled false |
29 | buildConfigField("String", "SERVER_URL", "\"${url.server_url}\"") | 28 | buildConfigField("String", "SERVER_URL", "\"${url.server_url}\"") |
30 | buildConfigField("String", "APIKey", "\"OmmSqorNFXjVHXlZWhHAyGyQ\"") | 29 | buildConfigField("String", "APIKey", "\"OmmSqorNFXjVHXlZWhHAyGyQ\"") |
31 | buildConfigField("String", "SecretKey", "\"Uwjz4XGi89RN4Mvl5mievKpjqpGgUy6D\"") | 30 | buildConfigField("String", "SecretKey", "\"Uwjz4XGi89RN4Mvl5mievKpjqpGgUy6D\"") |
32 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | 31 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
33 | } | 32 | } |
34 | release { | 33 | release { |
35 | minifyEnabled false | 34 | minifyEnabled false |
36 | buildConfigField("String", "SERVER_URL", "\"${url.server_url_online}\"") | 35 | buildConfigField("String", "SERVER_URL", "\"${url.server_url_online}\"") |
37 | buildConfigField("String", "APIKey", "\"OmmSqorNFXjVHXlZWhHAyGyQ\"") | 36 | buildConfigField("String", "APIKey", "\"OmmSqorNFXjVHXlZWhHAyGyQ\"") |
38 | buildConfigField("String", "SecretKey", "\"Uwjz4XGi89RN4Mvl5mievKpjqpGgUy6D\"") | 37 | buildConfigField("String", "SecretKey", "\"Uwjz4XGi89RN4Mvl5mievKpjqpGgUy6D\"") |
39 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | 38 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
40 | } | 39 | } |
41 | } | 40 | } |
42 | 41 | ||
43 | compileOptions { | 42 | compileOptions { |
44 | sourceCompatibility JavaVersion.VERSION_1_8 | 43 | sourceCompatibility JavaVersion.VERSION_1_8 |
45 | targetCompatibility JavaVersion.VERSION_1_8 | 44 | targetCompatibility JavaVersion.VERSION_1_8 |
46 | } | 45 | } |
47 | } | 46 | } |
48 | 47 | ||
49 | dependencies { | 48 | dependencies { |
50 | implementation fileTree(include: ['*.jar'], dir: 'libs') | 49 | implementation fileTree(include: ['*.jar'], dir: 'libs') |
51 | 50 | ||
52 | 51 | ||
53 | support.each { k, v -> implementation v } | 52 | support.each { k, v -> implementation v } |
54 | 53 | ||
55 | // 抓包, OkHttp拦截 | 54 | // 抓包, OkHttp拦截 |
56 | def chuckerVersion = "3.5.2" | 55 | def chuckerVersion = "3.5.2" |
57 | debugImplementation("com.github.chuckerteam.chucker:library:$chuckerVersion") { | 56 | debugImplementation("com.github.chuckerteam.chucker:library:$chuckerVersion") { |
58 | exclude module: 'lifecycle-viewmodel-ktx' | 57 | exclude module: 'lifecycle-viewmodel-ktx' |
59 | } | 58 | } |
60 | releaseImplementation("com.github.chuckerteam.chucker:library-no-op:$chuckerVersion") { | 59 | releaseImplementation("com.github.chuckerteam.chucker:library-no-op:$chuckerVersion") { |
61 | exclude module: 'lifecycle-viewmodel-ktx' | 60 | exclude module: 'lifecycle-viewmodel-ktx' |
62 | } | 61 | } |
63 | 62 | ||
63 | implementation 'com.jakewharton:butterknife:10.2.3' | ||
64 | annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3' |
libs/common/src/main/java/com/prws/common/router/RouterFragmentUtils.java
1 | package com.prws.common.router; | File was deleted | |
2 | |||
3 | import androidx.fragment.app.Fragment; | ||
4 | |||
5 | import com.alibaba.android.arouter.launcher.ARouter; | ||
6 | |||
7 | public class RouterFragmentUtils { | ||
8 | /****************************** SettingActivity *********************/ | ||
9 | public static Fragment getSpeekFragment() { | ||
10 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_SPEEK).navigation(); | ||
11 | } | ||
12 | |||
13 | public static Fragment getWorkFragment() { | ||
14 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_WORK).navigation(); | ||
15 | } | ||
16 | |||
17 | public static Fragment getWifiFragment() { | ||
18 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_WIFI).navigation(); | ||
19 | } | ||
20 | |||
21 | public static Fragment getAccountFragment() { | ||
22 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_ACCOUNT).navigation(); | ||
23 | } | ||
24 | |||
25 | public static Fragment getAlarmFragment() { | ||
26 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_ALARM).navigation(); | ||
27 | } | ||
28 | |||
29 | public static Fragment getVoiceFragment() { | ||
30 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_VOICE).navigation(); | ||
31 | } | ||
32 | |||
33 | public static Fragment getPwdFragment() { | ||
34 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_PWD).navigation(); | ||
35 | } | ||
36 | |||
37 | public static Fragment getRunFragment() { | ||
38 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_RUN).navigation(); | ||
39 | } | ||
40 | |||
41 | public static Fragment getLanguageFragment() { | ||
42 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_LANGUAGE).navigation(); | ||
43 | } | ||
44 | public static Fragment getWashSweepSettingFragment(){ | ||
45 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_WASH_SWEEP_SETTING).navigation(); | ||
46 | } | ||
47 | |||
48 | public static Fragment getMachineFragment() { | ||
49 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_MACHINE).navigation(); | ||
50 | } | ||
51 | |||
52 | public static Fragment getTaskFragment() { | ||
53 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_TASK).navigation(); | ||
54 | } | ||
55 | public static Fragment getCaiFragment() { | ||
56 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_CAI).navigation(); | ||
57 | } | ||
58 | public static Fragment getShuiFragment() { | ||
59 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_SHUI).navigation(); | ||
60 | } | ||
61 | public static Fragment getxdFragment() { | ||
62 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_XDS).navigation(); | ||
63 | } | ||
64 | public static Fragment getxdaFragment() { | ||
65 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_XDSA).navigation(); | ||
66 | } | ||
67 | |||
68 | |||
69 | /******************************** RemoteActivity *************************/ | ||
70 | public static Fragment getWashSweepFragment(){ | ||
71 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_WASH_SWEEP).navigation(); | ||
72 | } | ||
73 | public static Fragment getDustFragment() { | ||
74 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_DUST).navigation(); | ||
75 | } | ||
76 | |||
77 | public static Fragment getDisinfectFragment() { | ||
78 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_DISINFECT).navigation(); | ||
79 | } | ||
80 | |||
81 | public static Fragment getSidePushFragment() { | ||
82 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_SIDE_PUSH).navigation(); | ||
83 | } | ||
84 | |||
85 | public static Fragment getChargeFragment() { | ||
86 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_CHARGE).navigation(); | ||
87 | } | ||
88 | |||
89 | public static Fragment getPenLinFragment() { | ||
90 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_PENLIN).navigation(); | ||
91 | } | ||
92 | public static Fragment getGSFragment() { | ||
93 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_GS).navigation(); | ||
94 | } | ||
95 | public static Fragment getXCFragment() { | ||
96 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_XC).navigation(); | ||
97 | } | ||
98 | public static Fragment getCJFragment() { | ||
99 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_CJ).navigation(); | ||
100 | } | ||
101 | public static Fragment getJHFragment() { | ||
102 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_JH).navigation(); | ||
103 | } | ||
104 | public static Fragment getWSJFragment() { | ||
105 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_WSJ).navigation(); | ||
106 | } | ||
107 | public static Fragment getPDFragment() { | ||
108 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_PD).navigation(); | ||
109 | } | ||
110 | public static Fragment getXDABFragment() { | ||
111 | return (Fragment) ARouter.getInstance().build(RouterConfig.FRAGMENT_XDAB).navigation(); | ||
112 | } | ||
113 | |||
114 | } | ||
115 | 1 | package com.prws.common.router; |
libs/common/src/main/java/com/prws/common/router/RouterUtils.java
1 | package com.prws.common.router; | File was deleted | |
2 | |||
3 | import android.content.pm.ApplicationInfo; | ||
4 | import android.content.pm.PackageManager; | ||
5 | import com.prws.common.CommonApplication; | ||
6 | |||
7 | import com.alibaba.android.arouter.launcher.ARouter; | ||
8 | |||
9 | import java.util.ArrayList; | ||
10 | |||
11 | |||
12 | public class RouterUtils { | ||
13 | |||
14 | public static void goTestActivity(){ | ||
15 | if (isPaimo()) | ||
16 | ARouter.getInstance().build(RouterConfig.PAIMO_TEST).navigation(); | ||
17 | else | ||
18 | ARouter.getInstance().build(RouterConfig.TEST).navigation(); | ||
19 | } | ||
20 | |||
21 | public static void getMapTestActivity(){ | ||
22 | ARouter.getInstance().build(RouterConfig.MAP_ACTY_TEST).navigation(); | ||
23 | } | ||
24 | |||
25 | public static void goMapListActivity(){ | ||
26 | ARouter.getInstance().build(RouterConfig.MAP_LIST).navigation(); | ||
27 | } | ||
28 | public static void goMapCreateActivity(ArrayList<String> mapNameList){ | ||
29 | ARouter.getInstance().build(RouterConfig.MAP_CREATE) | ||
30 | .withStringArrayList("mapNameList",mapNameList) | ||
31 | .navigation(); | ||
32 | } | ||
33 | |||
34 | public static void goEditMapActivity(String projectId,String mapMd5){ | ||
35 | ARouter.getInstance().build(RouterConfig.MAP_EDIT) | ||
36 | .withString("projectId",projectId) | ||
37 | .withString("mapMd5",mapMd5) | ||
38 | .navigation(); | ||
39 | } | ||
40 | |||
41 | public static void goMenuActivity(){ | ||
42 | |||
43 | if (isPaiwee()) | ||
44 | ARouter.getInstance().build(RouterConfig.PAIWEE_MENU).navigation(); | ||
45 | else if (isPaipo()) | ||
46 | ARouter.getInstance().build(RouterConfig.PAIPO_MENU).navigation(); | ||
47 | else | ||
48 | ARouter.getInstance().build(RouterConfig.PAIMO_MENU).navigation(); | ||
49 | |||
50 | } | ||
51 | public static void goTaskActivity(){ | ||
52 | ARouter.getInstance().build(RouterConfig.TASK).navigation(); | ||
53 | } | ||
54 | public static void goRemoteActivity(){ | ||
55 | if (isPaiwee()) | ||
56 | ARouter.getInstance().build(RouterConfig.PAIWEE_REMOTE).navigation(); | ||
57 | else | ||
58 | ARouter.getInstance().build(RouterConfig.REMOTE).navigation(); | ||
59 | } | ||
60 | |||
61 | public static void goSettingActivity(){ | ||
62 | |||
63 | if (isPaiwee()) | ||
64 | ARouter.getInstance().build(RouterConfig.PAIWEE_SETTING).navigation(); | ||
65 | else | ||
66 | ARouter.getInstance().build(RouterConfig.SETTING).navigation(); | ||
67 | |||
68 | } | ||
69 | |||
70 | public static void goMainActivity(){ | ||
71 | if (isPaimo()){ | ||
72 | |||
73 | }else if (isPaipo()){ | ||
74 | |||
75 | }else if (isPaisam()){ | ||
76 | |||
77 | } | ||
78 | |||
79 | // if (BuildConfig.PROJECT_NAME.equals("paimo")) | ||
80 | // ARouter.getInstance().build(RouterConfig.PAIMO_MAIN).navigation(); | ||
81 | // else if (BuildConfig.PROJECT_NAME.equals("paipo")) | ||
82 | // ARouter.getInstance().build(RouterConfig.PAIPO_MAIN).navigation(); | ||
83 | // else if (BuildConfig.PROJECT_NAME.equals("paisam")) | ||
84 | // ARouter.getInstance().build(RouterConfig.PAISAM_MAIN).navigation(); | ||
85 | } | ||
86 | |||
87 | |||
88 | |||
89 | /************************* 判断项目类型 **********************************/ | ||
90 | |||
91 | public static boolean isPaimo(){ return getProjectName().equals("paimo"); } | ||
92 | private static boolean isPaipo(){ | ||
93 | return getProjectName().equals("paipo"); | ||
94 | } | ||
95 | private static boolean isPaisam(){ | ||
96 | return getProjectName().equals("paisam"); | ||
97 | } | ||
98 | public static boolean isPaiwee(){ | ||
99 | return getProjectName().equals("paiwee"); | ||
100 | } | ||
101 | |||
102 | |||
103 | public static String getProjectName(){ | ||
104 | // ApplicationInfo applicationInfo = null; | ||
105 | // try { | ||
106 | // applicationInfo = CommonApplication.getAppContext().getPackageManager().getApplicationInfo(CommonApplication.getAppContext().getPackageName(), PackageManager.GET_META_DATA); | ||
107 | // } catch (PackageManager.NameNotFoundException e) { | ||
108 | // e.printStackTrace(); | ||
109 | // } | ||
110 | // if (applicationInfo == null)return ""; | ||
111 | // return applicationInfo.metaData.getString("PROJECT_NAME"); | ||
112 | return "paicu"; | ||
113 | } | ||
114 | |||
115 | |||
116 | } | ||
117 | 1 | package com.prws.common.router; |