This commit is contained in:
Mygod
2020-02-08 04:12:45 +08:00
parent 1507050eea
commit cae191b991
6 changed files with 38 additions and 26 deletions

View File

@@ -11,7 +11,7 @@ buildscript {
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.0.0-alpha09' classpath 'com.android.tools.build:gradle:4.0.0-alpha09'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.27.0' classpath 'com.github.ben-manes:gradle-versions-plugin:0.27.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta01' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta02'
classpath 'com.google.android.gms:oss-licenses-plugin:0.9.5' classpath 'com.google.android.gms:oss-licenses-plugin:0.9.5'
classpath 'com.google.gms:google-services:4.3.3' classpath 'com.google.gms:google-services:4.3.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"

View File

@@ -1,4 +1,4 @@
# https://github.com/arturbosch/detekt/blob/1.3.1/detekt-cli/src/main/resources/default-detekt-config.yml # https://github.com/arturbosch/detekt/blob/1.5.0/detekt-cli/src/main/resources/default-detekt-config.yml
comments: comments:
active: false active: false
@@ -56,6 +56,13 @@ complexity:
ignorePrivate: false ignorePrivate: false
ignoreOverridden: true ignoreOverridden: true
coroutines:
active: true
GlobalCoroutineUsage:
active: false
RedundantSuspendModifier:
active: true
empty-blocks: empty-blocks:
active: true active: true
EmptyCatchBlock: EmptyCatchBlock:
@@ -75,7 +82,7 @@ empty-blocks:
active: true active: true
EmptyFunctionBlock: EmptyFunctionBlock:
active: true active: true
ignoreOverriddenFunctions: true ignoreOverridden: true
EmptyIfBlock: EmptyIfBlock:
active: true active: true
EmptyInitBlock: EmptyInitBlock:
@@ -122,22 +129,22 @@ exceptions:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
exceptionNames: exceptionNames:
- ArrayIndexOutOfBoundsException - ArrayIndexOutOfBoundsException
- Error - Error
- Exception - Exception
- IllegalMonitorStateException - IllegalMonitorStateException
- NullPointerException - NullPointerException
- IndexOutOfBoundsException - IndexOutOfBoundsException
- RuntimeException - RuntimeException
- Throwable - Throwable
allowedExceptionNameRegex: "^(_|(ignore|expected).*)" allowedExceptionNameRegex: "^(_|(ignore|expected).*)"
TooGenericExceptionThrown: TooGenericExceptionThrown:
active: true active: true
exceptionNames: exceptionNames:
- Error - Error
- Exception - Exception
- Throwable - Throwable
- RuntimeException - RuntimeException
formatting: formatting:
active: true active: true
@@ -151,6 +158,9 @@ formatting:
autoCorrect: true autoCorrect: true
CommentSpacing: CommentSpacing:
active: false active: false
EnumEntryNameCase:
active: true
autoCorrect: false
Filename: Filename:
active: true active: true
FinalNewline: FinalNewline:
@@ -180,6 +190,9 @@ formatting:
NoEmptyClassBody: NoEmptyClassBody:
active: true active: true
autoCorrect: true autoCorrect: true
NoEmptyFirstLineInMethodBlock:
active: true
autoCorrect: true
NoLineBreakAfterElse: NoLineBreakAfterElse:
active: true active: true
autoCorrect: true autoCorrect: true
@@ -261,9 +274,7 @@ naming:
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
maximumFunctionNameLength: 30 maximumFunctionNameLength: 30
FunctionMinLength: FunctionMinLength:
active: true active: false
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
minimumFunctionNameLength: 3
FunctionNaming: FunctionNaming:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
@@ -275,7 +286,7 @@ naming:
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
parameterPattern: '[a-z][A-Za-z0-9]*' parameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^' excludeClassPattern: '$^'
ignoreOverriddenFunctions: true ignoreOverridden: true
InvalidPackageDeclaration: InvalidPackageDeclaration:
active: true active: true
rootPackage: '' rootPackage: ''
@@ -381,6 +392,8 @@ style:
active: true active: true
EqualsOnSignatureLine: EqualsOnSignatureLine:
active: true active: true
ExplicitCollectionElementAccessMethod:
active: true
ExplicitItLambdaParameter: ExplicitItLambdaParameter:
active: true active: true
ExpressionBodySyntax: ExpressionBodySyntax:

Binary file not shown.

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@@ -22,7 +22,7 @@ android {
targetSdkVersion 29 targetSdkVersion 29
resConfigs 'it', 'ru', 'zh-rCN' resConfigs 'it', 'ru', 'zh-rCN'
versionCode 221 versionCode 221
versionName '2.7.2' versionName '2.8.0'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions.annotationProcessorOptions.arguments = [ javaCompileOptions.annotationProcessorOptions.arguments = [
"room.incremental": "true", "room.incremental": "true",
@@ -71,9 +71,9 @@ dependencies {
kapt "androidx.room:room-compiler:$roomVersion" kapt "androidx.room:room-compiler:$roomVersion"
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.browser:browser:1.2.0' implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.core:core-ktx:1.2.0-rc01' implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.emoji:emoji:1.0.0' implementation 'androidx.emoji:emoji:1.0.0'
implementation 'androidx.fragment:fragment-ktx:1.2.0' implementation 'androidx.fragment:fragment-ktx:1.2.1'
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion" implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion" implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion" implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion"
@@ -83,7 +83,7 @@ dependencies {
implementation 'com.android.billingclient:billing-ktx:2.1.0' implementation 'com.android.billingclient:billing-ktx:2.1.0'
implementation 'com.github.topjohnwu.libsu:core:2.5.1' implementation 'com.github.topjohnwu.libsu:core:2.5.1'
implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0' implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'
implementation 'com.google.android.material:material:1.1.0-rc02' implementation 'com.google.android.material:material:1.1.0'
implementation 'com.google.firebase:firebase-analytics:17.2.2' implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta01' implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta01'
implementation 'com.google.zxing:core:3.4.0' implementation 'com.google.zxing:core:3.4.0'

View File

@@ -178,8 +178,7 @@ class ClientsFragment : Fragment() {
override fun onBindViewHolder(holder: ClientViewHolder, position: Int) { override fun onBindViewHolder(holder: ClientViewHolder, position: Int) {
val client = getItem(position) val client = getItem(position)
holder.binding.client = client holder.binding.client = client
holder.binding.rate = holder.binding.rate = rates.computeIfAbsent(Pair(client.iface, client.mac)) { TrafficRate() }
rates.computeIfAbsent(Pair(client.iface, client.mac)) { TrafficRate() }
holder.binding.executePendingBindings() holder.binding.executePendingBindings()
} }