diff --git a/app/build.gradle b/app/build.gradle index ee67f34..1193a31 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,7 +1,6 @@ apply plugin: "com.android.application" apply plugin: "kotlin-android" apply plugin: "kotlin-android-extensions" -apply from: "$rootProject.projectDir/spotless.gradle" android { compileSdkVersion androidCompileSdkVersion diff --git a/app/src/main/java/com/qifan/powerpermission/MainActivity.kt b/app/src/main/java/com/qifan/powerpermission/MainActivity.kt index 56eac4e..7cfb1f1 100644 --- a/app/src/main/java/com/qifan/powerpermission/MainActivity.kt +++ b/app/src/main/java/com/qifan/powerpermission/MainActivity.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission import android.content.Intent diff --git a/app/src/main/java/com/qifan/powerpermission/activity/ExampleActivity.kt b/app/src/main/java/com/qifan/powerpermission/activity/ExampleActivity.kt index fa7e8ac..96a2021 100644 --- a/app/src/main/java/com/qifan/powerpermission/activity/ExampleActivity.kt +++ b/app/src/main/java/com/qifan/powerpermission/activity/ExampleActivity.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.activity import android.Manifest @@ -6,7 +21,12 @@ import androidx.appcompat.app.AppCompatActivity import com.qifan.powerpermission.Permission import com.qifan.powerpermission.PowerPermission import com.qifan.powerpermission.R -import com.qifan.powerpermission.data.* +import com.qifan.powerpermission.data.granted +import com.qifan.powerpermission.data.hasAllGranted +import com.qifan.powerpermission.data.hasPermanentDenied +import com.qifan.powerpermission.data.hasRational +import com.qifan.powerpermission.data.permanentDenied +import com.qifan.powerpermission.data.rational import com.qifan.powerpermission.databinding.ActivityExampleBinding class ExampleActivity : AppCompatActivity() { diff --git a/app/src/main/java/com/qifan/powerpermission/childfragment/ExampleChildContainerFragment.kt b/app/src/main/java/com/qifan/powerpermission/childfragment/ExampleChildContainerFragment.kt index bb3f27b..b524fd8 100644 --- a/app/src/main/java/com/qifan/powerpermission/childfragment/ExampleChildContainerFragment.kt +++ b/app/src/main/java/com/qifan/powerpermission/childfragment/ExampleChildContainerFragment.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.childfragment import android.os.Bundle diff --git a/app/src/main/java/com/qifan/powerpermission/childfragment/ExampleChildFragment.kt b/app/src/main/java/com/qifan/powerpermission/childfragment/ExampleChildFragment.kt index eff1855..b6b0b0e 100644 --- a/app/src/main/java/com/qifan/powerpermission/childfragment/ExampleChildFragment.kt +++ b/app/src/main/java/com/qifan/powerpermission/childfragment/ExampleChildFragment.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.childfragment import android.Manifest @@ -10,7 +25,12 @@ import androidx.fragment.app.Fragment import com.qifan.powerpermission.Permission import com.qifan.powerpermission.R import com.qifan.powerpermission.askPermissions -import com.qifan.powerpermission.data.* +import com.qifan.powerpermission.data.granted +import com.qifan.powerpermission.data.hasAllGranted +import com.qifan.powerpermission.data.hasPermanentDenied +import com.qifan.powerpermission.data.hasRational +import com.qifan.powerpermission.data.permanentDenied +import com.qifan.powerpermission.data.rational import com.qifan.powerpermission.databinding.FragmentChildExampleBinding import com.qifan.powerpermission.rationale.createDialogRationale import com.qifan.powerpermission.rationale.delegate.RationaleDelegate diff --git a/app/src/main/java/com/qifan/powerpermission/coroutines/CoroutinesActivity.kt b/app/src/main/java/com/qifan/powerpermission/coroutines/CoroutinesActivity.kt index 7852e02..e60d6c1 100644 --- a/app/src/main/java/com/qifan/powerpermission/coroutines/CoroutinesActivity.kt +++ b/app/src/main/java/com/qifan/powerpermission/coroutines/CoroutinesActivity.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.coroutines import android.Manifest @@ -5,7 +20,13 @@ import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import com.qifan.powerpermission.Permission import com.qifan.powerpermission.R -import com.qifan.powerpermission.data.* +import com.qifan.powerpermission.data.PermissionResult +import com.qifan.powerpermission.data.granted +import com.qifan.powerpermission.data.hasAllGranted +import com.qifan.powerpermission.data.hasPermanentDenied +import com.qifan.powerpermission.data.hasRational +import com.qifan.powerpermission.data.permanentDenied +import com.qifan.powerpermission.data.rational import com.qifan.powerpermission.databinding.ActivityCoroutinesExmapleBinding import com.qifan.powerpermission.rationale.createDialogRationale import com.qifan.powerpermission.rationale.delegate.RationaleDelegate diff --git a/app/src/main/java/com/qifan/powerpermission/fragment/ExampleFragment.kt b/app/src/main/java/com/qifan/powerpermission/fragment/ExampleFragment.kt index 19b4225..366da5b 100644 --- a/app/src/main/java/com/qifan/powerpermission/fragment/ExampleFragment.kt +++ b/app/src/main/java/com/qifan/powerpermission/fragment/ExampleFragment.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.fragment import android.Manifest @@ -10,7 +25,12 @@ import androidx.fragment.app.Fragment import com.qifan.powerpermission.Permission import com.qifan.powerpermission.R import com.qifan.powerpermission.askPermissions -import com.qifan.powerpermission.data.* +import com.qifan.powerpermission.data.granted +import com.qifan.powerpermission.data.hasAllGranted +import com.qifan.powerpermission.data.hasPermanentDenied +import com.qifan.powerpermission.data.hasRational +import com.qifan.powerpermission.data.permanentDenied +import com.qifan.powerpermission.data.rational import com.qifan.powerpermission.databinding.FragmentExampleBinding import com.qifan.powerpermission.rationale.createDialogRationale import com.qifan.powerpermission.rationale.delegate.RationaleDelegate diff --git a/app/src/main/java/com/qifan/powerpermission/livedata/LiveDataActivity.kt b/app/src/main/java/com/qifan/powerpermission/livedata/LiveDataActivity.kt index c28cbcf..bef8d55 100644 --- a/app/src/main/java/com/qifan/powerpermission/livedata/LiveDataActivity.kt +++ b/app/src/main/java/com/qifan/powerpermission/livedata/LiveDataActivity.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.livedata import android.Manifest @@ -6,7 +21,13 @@ import androidx.appcompat.app.AppCompatActivity import androidx.lifecycle.Observer import com.qifan.powerpermission.Permission import com.qifan.powerpermission.R -import com.qifan.powerpermission.data.* +import com.qifan.powerpermission.data.PermissionResult +import com.qifan.powerpermission.data.granted +import com.qifan.powerpermission.data.hasAllGranted +import com.qifan.powerpermission.data.hasPermanentDenied +import com.qifan.powerpermission.data.hasRational +import com.qifan.powerpermission.data.permanentDenied +import com.qifan.powerpermission.data.rational import com.qifan.powerpermission.databinding.ActivityLiveDataBinding import com.qifan.powerpermission.rationale.createDialogRationale import com.qifan.powerpermission.rationale.delegate.RationaleDelegate diff --git a/app/src/main/java/com/qifan/powerpermission/rx/RxJava2Activity.kt b/app/src/main/java/com/qifan/powerpermission/rx/RxJava2Activity.kt index 0b67d80..cd39a0f 100644 --- a/app/src/main/java/com/qifan/powerpermission/rx/RxJava2Activity.kt +++ b/app/src/main/java/com/qifan/powerpermission/rx/RxJava2Activity.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.rx import android.Manifest @@ -7,7 +22,13 @@ import androidx.appcompat.app.AppCompatActivity import com.jakewharton.rxbinding3.view.clicks import com.qifan.powerpermission.Permission import com.qifan.powerpermission.R -import com.qifan.powerpermission.data.* +import com.qifan.powerpermission.data.PermissionResult +import com.qifan.powerpermission.data.granted +import com.qifan.powerpermission.data.hasAllGranted +import com.qifan.powerpermission.data.hasPermanentDenied +import com.qifan.powerpermission.data.hasRational +import com.qifan.powerpermission.data.permanentDenied +import com.qifan.powerpermission.data.rational import com.qifan.powerpermission.databinding.ActivityRx2ExmapleBinding import com.qifan.powerpermission.rationale.createDialogRationale import com.qifan.powerpermission.rationale.delegate.RationaleDelegate diff --git a/app/src/main/java/com/qifan/powerpermission/rx/RxJava3Activity.kt b/app/src/main/java/com/qifan/powerpermission/rx/RxJava3Activity.kt index 5d56603..c347137 100644 --- a/app/src/main/java/com/qifan/powerpermission/rx/RxJava3Activity.kt +++ b/app/src/main/java/com/qifan/powerpermission/rx/RxJava3Activity.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.rx import android.Manifest @@ -6,7 +21,13 @@ import android.util.Log import androidx.appcompat.app.AppCompatActivity import com.qifan.powerpermission.Permission import com.qifan.powerpermission.R -import com.qifan.powerpermission.data.* +import com.qifan.powerpermission.data.PermissionResult +import com.qifan.powerpermission.data.granted +import com.qifan.powerpermission.data.hasAllGranted +import com.qifan.powerpermission.data.hasPermanentDenied +import com.qifan.powerpermission.data.hasRational +import com.qifan.powerpermission.data.permanentDenied +import com.qifan.powerpermission.data.rational import com.qifan.powerpermission.databinding.ActivityRx3ExmapleBinding import com.qifan.powerpermission.rationale.createDialogRationale import com.qifan.powerpermission.rationale.delegate.RationaleDelegate diff --git a/app/src/test/java/com/qifan/powerpermission/ExampleUnitTest.kt b/app/src/test/java/com/qifan/powerpermission/ExampleUnitTest.kt index 064e65a..654623f 100644 --- a/app/src/test/java/com/qifan/powerpermission/ExampleUnitTest.kt +++ b/app/src/test/java/com/qifan/powerpermission/ExampleUnitTest.kt @@ -1,9 +1,23 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission +import org.junit.Assert.assertEquals import org.junit.Test -import org.junit.Assert.* - /** * Example local unit test, which will execute on the development machine (host). * diff --git a/build.gradle b/build.gradle index 81c06b0..e755e9c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { apply from: "dependencies.gradle" - ext.ktlint_version = "0.33.0" repositories { google() jcenter() @@ -9,16 +8,15 @@ buildscript { dependencies { classpath "com.android.tools.build:gradle:3.6.2" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" - classpath "com.diffplug.spotless:spotless-plugin-gradle:3.28.0" + classpath "com.diffplug.spotless:spotless-plugin-gradle:4.3.1" classpath "de.mannodermaus.gradle.plugins:android-junit5:1.5.2.0" classpath "com.novoda:bintray-release:0.9.2" - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files + classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4" + classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.9.3" } } - -task clean(type: Delete) { - delete rootProject.buildDir +apply { + from(rootProject.file("spotless/spotless.gradle")) } allprojects { diff --git a/dependencies.gradle b/dependencies.gradle index 07b9173..95bfcbc 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ ext { // APP VERSION androidVersionCode = 1 - androidVersionName = "1.0.0" + androidVersionName = "1.1.0" // ANDROID VERSION androidCompileSdkVersion = 29 @@ -9,7 +9,7 @@ ext { androidTargetSdkVersion = 29 // KOTLIN - kotlinVersion = "1.3.71" + kotlinVersion = "1.3.72" kotlinStdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion" kotlinReflect = "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion" @@ -49,7 +49,7 @@ ext { mockK = "io.mockk:mockk:$mockKVersion" - publishVersionID = "1.0.0" + publishVersionID = "1.1.0" groupProjectID = "com.qifan.powerpermission" userName = "undervoid" libName = "PowerPermission" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a723e8c..47ed9c1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ -#Thu Mar 26 23:09:37 CET 2020 +#Sun Jun 28 14:33:41 CEST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/powerpermission-coroutines/build.gradle b/powerpermission-coroutines/build.gradle index 85819e5..5b45145 100644 --- a/powerpermission-coroutines/build.gradle +++ b/powerpermission-coroutines/build.gradle @@ -1,6 +1,5 @@ apply plugin: "com.android.library" apply plugin: "kotlin-android" -apply from: "$rootProject.projectDir/spotless.gradle" apply plugin: "com.novoda.bintray-release" android { diff --git a/powerpermission-coroutines/src/main/java/com/qifan/powerpermission/coroutines/CheckOnMainThread.kt b/powerpermission-coroutines/src/main/java/com/qifan/powerpermission/coroutines/CheckOnMainThread.kt index ba222a8..b3e86a6 100644 --- a/powerpermission-coroutines/src/main/java/com/qifan/powerpermission/coroutines/CheckOnMainThread.kt +++ b/powerpermission-coroutines/src/main/java/com/qifan/powerpermission/coroutines/CheckOnMainThread.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.coroutines import android.os.Looper diff --git a/powerpermission-coroutines/src/main/java/com/qifan/powerpermission/coroutines/PowerPermissionCoroutines.kt b/powerpermission-coroutines/src/main/java/com/qifan/powerpermission/coroutines/PowerPermissionCoroutines.kt index 0535fbe..ea6ed86 100644 --- a/powerpermission-coroutines/src/main/java/com/qifan/powerpermission/coroutines/PowerPermissionCoroutines.kt +++ b/powerpermission-coroutines/src/main/java/com/qifan/powerpermission/coroutines/PowerPermissionCoroutines.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.coroutines import androidx.appcompat.app.AppCompatActivity diff --git a/powerpermission-coroutines/src/test/java/com/qifan/powerpermission/coroutines/ExampleUnitTest.kt b/powerpermission-coroutines/src/test/java/com/qifan/powerpermission/coroutines/ExampleUnitTest.kt index 5e9cd28..0c8fff9 100644 --- a/powerpermission-coroutines/src/test/java/com/qifan/powerpermission/coroutines/ExampleUnitTest.kt +++ b/powerpermission-coroutines/src/test/java/com/qifan/powerpermission/coroutines/ExampleUnitTest.kt @@ -1,9 +1,23 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.coroutines +import org.junit.Assert.assertEquals import org.junit.Test -import org.junit.Assert.* - /** * Example local unit test, which will execute on the development machine (host). * diff --git a/powerpermission-livedata/build.gradle b/powerpermission-livedata/build.gradle index c2bcb0e..31eaba6 100644 --- a/powerpermission-livedata/build.gradle +++ b/powerpermission-livedata/build.gradle @@ -1,7 +1,6 @@ apply plugin: "com.android.library" apply plugin: "kotlin-android" apply plugin: "kotlin-android-extensions" -apply from: "$rootProject.projectDir/spotless.gradle" apply plugin: "com.novoda.bintray-release" diff --git a/powerpermission-livedata/src/main/java/com/qifan/powerpermission/livedata/PowerPermissionLiveData.kt b/powerpermission-livedata/src/main/java/com/qifan/powerpermission/livedata/PowerPermissionLiveData.kt index c258677..5ccdc6a 100644 --- a/powerpermission-livedata/src/main/java/com/qifan/powerpermission/livedata/PowerPermissionLiveData.kt +++ b/powerpermission-livedata/src/main/java/com/qifan/powerpermission/livedata/PowerPermissionLiveData.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.livedata import androidx.appcompat.app.AppCompatActivity diff --git a/powerpermission-rxjava2/build.gradle b/powerpermission-rxjava2/build.gradle index 872b842..dc622cd 100644 --- a/powerpermission-rxjava2/build.gradle +++ b/powerpermission-rxjava2/build.gradle @@ -1,7 +1,6 @@ apply plugin: "com.android.library" apply plugin: "kotlin-android" apply plugin: "kotlin-android-extensions" -apply from: "$rootProject.projectDir/spotless.gradle" apply plugin: "com.novoda.bintray-release" android { diff --git a/powerpermission-rxjava2/src/main/java/com/qifan/powerpermission/rx2/CheckOnMainThreadRx2.kt b/powerpermission-rxjava2/src/main/java/com/qifan/powerpermission/rx2/CheckOnMainThreadRx2.kt index bdbcce1..de06f7b 100644 --- a/powerpermission-rxjava2/src/main/java/com/qifan/powerpermission/rx2/CheckOnMainThreadRx2.kt +++ b/powerpermission-rxjava2/src/main/java/com/qifan/powerpermission/rx2/CheckOnMainThreadRx2.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.rx2 import android.os.Looper diff --git a/powerpermission-rxjava2/src/main/java/com/qifan/powerpermission/rx2/PowerPermissionRx2.kt b/powerpermission-rxjava2/src/main/java/com/qifan/powerpermission/rx2/PowerPermissionRx2.kt index 667d48a..4f78f97 100644 --- a/powerpermission-rxjava2/src/main/java/com/qifan/powerpermission/rx2/PowerPermissionRx2.kt +++ b/powerpermission-rxjava2/src/main/java/com/qifan/powerpermission/rx2/PowerPermissionRx2.kt @@ -1,8 +1,26 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.rx2 import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment -import com.qifan.powerpermission.* +import com.qifan.powerpermission.Permission +import com.qifan.powerpermission.RequestCode +import com.qifan.powerpermission.askPermissions +import com.qifan.powerpermission.askPermissionsAllGranted import com.qifan.powerpermission.core.PERMISSION_REQUEST_CODE import com.qifan.powerpermission.data.Configuration import com.qifan.powerpermission.data.DefaultConfiguration diff --git a/powerpermission-rxjava3/build.gradle b/powerpermission-rxjava3/build.gradle index 034861c..fea80e8 100644 --- a/powerpermission-rxjava3/build.gradle +++ b/powerpermission-rxjava3/build.gradle @@ -1,7 +1,6 @@ apply plugin: "com.android.library" apply plugin: "kotlin-android" apply plugin: "kotlin-android-extensions" -apply from: "$rootProject.projectDir/spotless.gradle" apply plugin: "com.novoda.bintray-release" android { diff --git a/powerpermission-rxjava3/src/main/java/com/qifan/powerpermission/rx3/CheckOnMainThreadRx3.kt b/powerpermission-rxjava3/src/main/java/com/qifan/powerpermission/rx3/CheckOnMainThreadRx3.kt index af06261..cd92dde 100644 --- a/powerpermission-rxjava3/src/main/java/com/qifan/powerpermission/rx3/CheckOnMainThreadRx3.kt +++ b/powerpermission-rxjava3/src/main/java/com/qifan/powerpermission/rx3/CheckOnMainThreadRx3.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.rx3 import android.os.Looper diff --git a/powerpermission-rxjava3/src/main/java/com/qifan/powerpermission/rx3/PowerPermissionRx3.kt b/powerpermission-rxjava3/src/main/java/com/qifan/powerpermission/rx3/PowerPermissionRx3.kt index a06ecf5..73e9f77 100644 --- a/powerpermission-rxjava3/src/main/java/com/qifan/powerpermission/rx3/PowerPermissionRx3.kt +++ b/powerpermission-rxjava3/src/main/java/com/qifan/powerpermission/rx3/PowerPermissionRx3.kt @@ -1,8 +1,26 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.rx3 import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment -import com.qifan.powerpermission.* +import com.qifan.powerpermission.Permission +import com.qifan.powerpermission.RequestCode +import com.qifan.powerpermission.askPermissions +import com.qifan.powerpermission.askPermissionsAllGranted import com.qifan.powerpermission.core.PERMISSION_REQUEST_CODE import com.qifan.powerpermission.data.Configuration import com.qifan.powerpermission.data.DefaultConfiguration diff --git a/powerpermission/build.gradle b/powerpermission/build.gradle index 72d27fc..04a1285 100644 --- a/powerpermission/build.gradle +++ b/powerpermission/build.gradle @@ -2,7 +2,6 @@ apply plugin: "com.android.library" apply plugin: "kotlin-android" apply plugin: "kotlin-android-extensions" apply plugin: "de.mannodermaus.android-junit5" -apply from: "$rootProject.projectDir/spotless.gradle" apply plugin: "com.novoda.bintray-release" android { diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/Activities.kt b/powerpermission/src/main/java/com/qifan/powerpermission/Activities.kt index 3c86cee..e562ae8 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/Activities.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/Activities.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission import androidx.appcompat.app.AppCompatActivity diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/Fragments.kt b/powerpermission/src/main/java/com/qifan/powerpermission/Fragments.kt index eaf0437..321b150 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/Fragments.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/Fragments.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission import androidx.fragment.app.Fragment diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/PowerPermission.kt b/powerpermission/src/main/java/com/qifan/powerpermission/PowerPermission.kt index 78f1348..564349c 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/PowerPermission.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/PowerPermission.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission import com.qifan.powerpermission.core.PowerPermissionManager diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/core/PermissionFragment.kt b/powerpermission/src/main/java/com/qifan/powerpermission/core/PermissionFragment.kt index 2eef047..cf601b1 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/core/PermissionFragment.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/core/PermissionFragment.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.core import android.content.Context @@ -59,9 +74,9 @@ class PermissionFragment : Fragment() { grantResults = grantResults ) if (rationalHandler != null && rationalHandler.data.shouldInvokeRational( - this, - result - ) + this, + result + ) ) { rationalHandler.showRationale(::requestPermissions, code) } else { diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/core/PermissionRequestParams.kt b/powerpermission/src/main/java/com/qifan/powerpermission/core/PermissionRequestParams.kt index 01939ca..f14ebab 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/core/PermissionRequestParams.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/core/PermissionRequestParams.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.core import com.qifan.powerpermission.Permission diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/core/PowerPermissionManager.kt b/powerpermission/src/main/java/com/qifan/powerpermission/core/PowerPermissionManager.kt index f37828f..32f0c05 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/core/PowerPermissionManager.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/core/PowerPermissionManager.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.core import androidx.annotation.VisibleForTesting diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/core/extension/FragmentExt.kt b/powerpermission/src/main/java/com/qifan/powerpermission/core/extension/FragmentExt.kt index 06fcde4..d13583a 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/core/extension/FragmentExt.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/core/extension/FragmentExt.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.core.extension import android.content.Context diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/core/extension/LoggingExt.kt b/powerpermission/src/main/java/com/qifan/powerpermission/core/extension/LoggingExt.kt index 2401310..4ee2174 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/core/extension/LoggingExt.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/core/extension/LoggingExt.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.core.extension import android.util.Log diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/core/extension/PermissionExt.kt b/powerpermission/src/main/java/com/qifan/powerpermission/core/extension/PermissionExt.kt index 17e62ba..7cac1cd 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/core/extension/PermissionExt.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/core/extension/PermissionExt.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.core.extension import android.content.Context diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/data/Configuration.kt b/powerpermission/src/main/java/com/qifan/powerpermission/data/Configuration.kt index ebce16c..18dae38 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/data/Configuration.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/data/Configuration.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.data /** diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/data/GrantResult.kt b/powerpermission/src/main/java/com/qifan/powerpermission/data/GrantResult.kt index 2a7fce5..0364f40 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/data/GrantResult.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/data/GrantResult.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.data import android.content.pm.PackageManager diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/data/PermissionResult.kt b/powerpermission/src/main/java/com/qifan/powerpermission/data/PermissionResult.kt index 0343ff8..c73b25a 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/data/PermissionResult.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/data/PermissionResult.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.data import androidx.annotation.CheckResult @@ -45,8 +60,8 @@ data class PermissionData( override fun equals(other: Any?): Boolean { return other != null && - other is PermissionData && - this.data == other.data + other is PermissionData && + this.data == other.data } } diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/data/RationaleData.kt b/powerpermission/src/main/java/com/qifan/powerpermission/data/RationaleData.kt index 4b4ac93..4d026f9 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/data/RationaleData.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/data/RationaleData.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.data import androidx.annotation.CheckResult diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/rationale/DialogRationale.kt b/powerpermission/src/main/java/com/qifan/powerpermission/rationale/DialogRationale.kt index 4795db0..5f58eb9 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/rationale/DialogRationale.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/rationale/DialogRationale.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.rationale import android.app.Activity diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/rationale/delegate/RationaleActionCallback.kt b/powerpermission/src/main/java/com/qifan/powerpermission/rationale/delegate/RationaleActionCallback.kt index 8b5e607..8475254 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/rationale/delegate/RationaleActionCallback.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/rationale/delegate/RationaleActionCallback.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.rationale.delegate import com.qifan.powerpermission.core.extension.warn diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/rationale/delegate/RationaleDelegate.kt b/powerpermission/src/main/java/com/qifan/powerpermission/rationale/delegate/RationaleDelegate.kt index 79b963b..b04ce28 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/rationale/delegate/RationaleDelegate.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/rationale/delegate/RationaleDelegate.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.rationale.delegate import com.qifan.powerpermission.Permission diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/rationale/delegate/dialog/DialogRationaleDelegate.kt b/powerpermission/src/main/java/com/qifan/powerpermission/rationale/delegate/dialog/DialogRationaleDelegate.kt index 98e297c..76e7887 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/rationale/delegate/dialog/DialogRationaleDelegate.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/rationale/delegate/dialog/DialogRationaleDelegate.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.rationale.delegate.dialog import android.app.AlertDialog diff --git a/powerpermission/src/test/java/com/qifan/powerpermission/PowerPermissionManager.kt b/powerpermission/src/test/java/com/qifan/powerpermission/PowerPermissionManager.kt index a6840a7..152440d 100644 --- a/powerpermission/src/test/java/com/qifan/powerpermission/PowerPermissionManager.kt +++ b/powerpermission/src/test/java/com/qifan/powerpermission/PowerPermissionManager.kt @@ -1 +1,16 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission diff --git a/powerpermission/src/test/java/com/qifan/powerpermission/data/GrantResultTest.kt b/powerpermission/src/test/java/com/qifan/powerpermission/data/GrantResultTest.kt index 9738b97..2c8fb67 100644 --- a/powerpermission/src/test/java/com/qifan/powerpermission/data/GrantResultTest.kt +++ b/powerpermission/src/test/java/com/qifan/powerpermission/data/GrantResultTest.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.data import android.content.pm.PackageManager diff --git a/powerpermission/src/test/java/com/qifan/powerpermission/data/PermissionResultTest.kt b/powerpermission/src/test/java/com/qifan/powerpermission/data/PermissionResultTest.kt index 3b947ee..405e232 100644 --- a/powerpermission/src/test/java/com/qifan/powerpermission/data/PermissionResultTest.kt +++ b/powerpermission/src/test/java/com/qifan/powerpermission/data/PermissionResultTest.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.data import android.Manifest diff --git a/powerpermission/src/test/java/com/qifan/powerpermission/data/RationaleDataTest.kt b/powerpermission/src/test/java/com/qifan/powerpermission/data/RationaleDataTest.kt index e7acfd4..21d7f0c 100644 --- a/powerpermission/src/test/java/com/qifan/powerpermission/data/RationaleDataTest.kt +++ b/powerpermission/src/test/java/com/qifan/powerpermission/data/RationaleDataTest.kt @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2020 by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.qifan.powerpermission.data import org.assertj.core.api.Assertions.assertThat diff --git a/spotless.gradle b/spotless.gradle deleted file mode 100644 index caf7c3d..0000000 --- a/spotless.gradle +++ /dev/null @@ -1,17 +0,0 @@ -apply plugin: "com.diffplug.gradle.spotless" - -spotless { - java { - target "**/*.java" - trimTrailingWhitespace() - removeUnusedImports() - googleJavaFormat() - endWithNewline() - } - kotlin { - target "**/*.kt" - ktlint(rootProject.ktlint_version) - trimTrailingWhitespace() - endWithNewline() - } -} diff --git a/spotless/copyright.java b/spotless/copyright.java new file mode 100644 index 0000000..626e5cb --- /dev/null +++ b/spotless/copyright.java @@ -0,0 +1,13 @@ +/** + * Copyright (C) $YEAR by Qifan YANG (@underwindfall) + * + *
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + *
http://www.apache.org/licenses/LICENSE-2.0 + * + *
Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing permissions and + * limitations under the License. + */ \ No newline at end of file diff --git a/spotless/copyright.kt b/spotless/copyright.kt new file mode 100644 index 0000000..bf804ad --- /dev/null +++ b/spotless/copyright.kt @@ -0,0 +1,15 @@ +/** + * Copyright (C) $YEAR by Qifan YANG (@underwindfall) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ \ No newline at end of file diff --git a/spotless/spotless.gradle b/spotless/spotless.gradle new file mode 100644 index 0000000..748eb07 --- /dev/null +++ b/spotless/spotless.gradle @@ -0,0 +1,22 @@ +apply plugin: "com.diffplug.gradle.spotless" + +spotless { + java { + target "**/src/**/*.java" + targetExclude '**/spotless/*.java' + trimTrailingWhitespace() + removeUnusedImports() + googleJavaFormat("1.8") + endWithNewline() + licenseHeaderFile rootProject.file('spotless/copyright.java') + } + kotlin { + target "**/src/**/*.kt" + targetExclude '**/spotless/*.kt' + targetExclude '**/buildSrc/src/main/java/*.kt' + ktlint("0.37.2") + trimTrailingWhitespace() + endWithNewline() + licenseHeaderFile rootProject.file('spotless/copyright.kt') + } +} \ No newline at end of file