From 2f2733aad77c9cdc574d21b342f09499d7aa141b Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 15 Jan 2020 02:29:27 +0100 Subject: [PATCH 001/135] Migrate gradle files to kotlin dsl --- app/build.gradle | 102 ----------------------- app/build.gradle.kts | 95 +++++++++++++++++++++ build.gradle | 68 --------------- build.gradle.kts | 16 ++++ gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle | 12 --- settings.gradle.kts | 38 +++++++++ 7 files changed, 150 insertions(+), 183 deletions(-) delete mode 100644 app/build.gradle create mode 100644 app/build.gradle.kts delete mode 100644 build.gradle create mode 100644 build.gradle.kts delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index cab961bd..00000000 --- a/app/build.gradle +++ /dev/null @@ -1,102 +0,0 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'eu.appcom.gradle.android-versioning' - -android { - compileSdkVersion rootProject.compileSdkVersion - buildToolsVersion rootProject.buildToolsVersion - defaultConfig { - applicationId 'com.g00fy2.developerwidget' - minSdkVersion rootProject.minSdkVersion - targetSdkVersion rootProject.targetSdkVersion - versionCode versioning.getVersionCode() - versionName versioning.getVersionName() - - vectorDrawables.useSupportLibrary = true - } - signingConfigs { - release { - storeFile file('../keystore.jks') - storePassword project.hasProperty('my_storepass') ? my_storepass : '' - keyAlias project.hasProperty('my_keyalias') ? my_keyalias : '' - keyPassword project.hasProperty('my_keypass') ? my_keypass : '' - v1SigningEnabled true - v2SigningEnabled true - } - } - buildTypes { - debug { - applicationIdSuffix '.debug' - } - release { - signingConfig signingConfigs.release - shrinkResources true - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - buildFeatures { - viewBinding = true - } - versioning { - baseName = 'developerwidget' - } - applicationVariants.all { variant -> - if (variant.getName().toLowerCase().contains('release')) { - variant.outputs.all { - outputFileName = versioning.getApkName(variant) - } - } - } - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - compileOptions { - sourceCompatibility = '1.8' - targetCompatibility = '1.8' - } - kotlinOptions { - jvmTarget = '1.8' - } -} - -repositories { - google() - mavenCentral() - jcenter { - content { - includeModule 'com.g00fy2', 'versioncompare' - includeModule 'org.jetbrains.trove4j', 'trove4j' // required by com.android.tools.lint:lint-gradle - } - } -} -dependencies { - // Kotlin - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion" - - // AndroidX - implementation "androidx.appcompat:appcompat:$appcompatVersion" - implementation "androidx.core:core-ktx:$coreKtxVersion" - implementation "androidx.activity:activity:$activityVersion" - implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion" - implementation "androidx.recyclerview:recyclerview:$recyclerviewVersion" - implementation "androidx.constraintlayout:constraintlayout:$constraintlayoutVersion" - implementation "androidx.vectordrawable:vectordrawable:$vectorDrawableVersion" - - // UI - implementation "com.google.android.material:material:$materialVersion" - - // Misc - implementation "com.jakewharton.timber:timber:$timberVersion" - implementation "com.g00fy2:versioncompare:$versCompVersion" - - // Dagger - implementation "com.google.dagger:dagger:$daggerVersion" - kapt "com.google.dagger:dagger-compiler:$daggerVersion" - implementation "com.google.dagger:dagger-android:$daggerVersion" - implementation "com.google.dagger:dagger-android-support:$daggerVersion" - kapt "com.google.dagger:dagger-android-processor:$daggerVersion" - compileOnly 'javax.annotation:javax.annotation-api:1.3.2' -} \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 00000000..880d1920 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,95 @@ +plugins { + id("com.android.application") + kotlin("android") + kotlin("kapt") + id("eu.appcom.gradle.android-versioning") +} + +android { + compileSdkVersion(29) + buildToolsVersion = "29.0.2" + defaultConfig { + applicationId = "com.g00fy2.developerwidget" + minSdkVersion(14) + targetSdkVersion(29) + versionCode = versioning.getVersionCode() + versionName = versioning.getVersionName() + + vectorDrawables.useSupportLibrary = true + setProperty("archivesBaseName", "developerwidget-$versionName-$versionCode") + } + signingConfigs { + create("release") { + storeFile = file("../keystore.jks") + storePassword = findProperty("my_storepass") as String? ?: "" + keyAlias = findProperty("my_keyalias") as String? ?: "" + keyPassword = findProperty("my_keypass") as String? ?: "" + isV1SigningEnabled = true + isV2SigningEnabled = true + } + } + buildTypes { + getByName("debug") { + applicationIdSuffix = ".debug" + } + getByName("release") { + signingConfig = signingConfigs.getByName("release") + isShrinkResources = true + isMinifyEnabled = true + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + buildFeatures { + viewBinding = true + } + sourceSets { + getByName("main").java.srcDirs("src/main/kotlin") + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } +} + +repositories { + google() + mavenCentral() + jcenter { + content { + includeModule("com.g00fy2", "versioncompare") + includeModule("org.jetbrains.trove4j", "trove4j") // required by com.android.tools.lint:lint-gradle + } + } +} +dependencies { + // Kotlin + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3") + +// AndroidX + implementation("androidx.appcompat:appcompat:1.2.0-alpha01") + implementation("androidx.core:core-ktx:1.2.0-rc01") + implementation("androidx.activity:activity:1.1.0-rc03") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.2.0-rc03") + implementation("androidx.recyclerview:recyclerview:1.2.0-alpha01") + implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta4") + implementation("androidx.vectordrawable:vectordrawable:1.1.0") + +// UI + implementation("com.google.android.material:material:1.2.0-alpha03") + +// Misc + implementation("com.jakewharton.timber:timber:4.7.1") + implementation("com.g00fy2:versioncompare:1.3.4") + +// Dagger + implementation("com.google.dagger:dagger:2.25.4") + kapt("com.google.dagger:dagger-compiler:2.25.4") + implementation("com.google.dagger:dagger-android:2.25.4") + implementation("com.google.dagger:dagger-android-support:2.25.4") + kapt("com.google.dagger:dagger-android-processor:2.25.4") + compileOnly("javax.annotation:javax.annotation-api:1.3.2") +} \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index e185f339..00000000 --- a/build.gradle +++ /dev/null @@ -1,68 +0,0 @@ -import com.android.tools.r8.Version -import com.github.jk1.license.filter.* -import com.github.jk1.license.render.* - -apply plugin: 'com.github.jk1.dependency-license-report' - -buildscript { - ext { - // SDK and plugins - compileSdkVersion = 29 - buildToolsVersion = '29.0.2' - minSdkVersion = 14 - targetSdkVersion = 29 - androidGradleVersion = '4.0.0-alpha08' - versioningPluginVersion = '1.0.2' - licenseReportVersion = '1.12' - - // Library versions - kotlinVersion = '1.3.61' - coroutinesVersion = '1.3.3' - appcompatVersion = '1.2.0-alpha01' - coreKtxVersion = '1.2.0-rc01' - activityVersion = '1.1.0-rc03' - lifecycleVersion = '2.2.0-rc03' - materialVersion = '1.2.0-alpha03' - recyclerviewVersion = '1.2.0-alpha01' - vectorDrawableVersion = '1.1.0' - constraintlayoutVersion = '2.0.0-beta4' - timberVersion = '4.7.1' - daggerVersion = '2.25.4' - versCompVersion = '1.3.4' - } - repositories { - google() - mavenCentral() - jcenter() { - content { - includeModule 'eu.appcom.gradle', 'android-versioning' - includeModule 'org.jetbrains.trove4j', 'trove4j' - } - } - gradlePluginPortal() - } - dependencies { - classpath "com.android.tools.build:gradle:$androidGradleVersion" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" - classpath "eu.appcom.gradle:android-versioning:$versioningPluginVersion" - classpath "com.github.jk1:gradle-license-report:$licenseReportVersion" - } -} - -licenseReport { - configurations = ['releaseRuntimeClasspath'] - renderers = [new SimpleHtmlReportRenderer(), new JsonReportRenderer()] - filters = [new LicenseBundleNormalizer()] -} - -task clean(type: Delete) { - delete rootProject.buildDir -} - -task printR8Version() { - try { - println "R8 version: " + Version.getVersionString() - } catch (ignored) { - println 'R8 version: unknown' - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..d72caf09 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,16 @@ +import com.github.jk1.license.filter.* +import com.github.jk1.license.render.* + +plugins { + id("com.github.jk1.dependency-license-report") version "1.12" +} + +licenseReport { + configurations = arrayOf("releaseRuntimeClasspath") + renderers = arrayOf(SimpleHtmlReportRenderer(), JsonReportRenderer()) + filters = arrayOf(LicenseBundleNormalizer()) +} + +tasks.register("clean", Delete::class) { + delete(rootProject.buildDir) +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e3185a77..301bc82b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-rc-2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-rc-3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 0c0a85aa..00000000 --- a/settings.gradle +++ /dev/null @@ -1,12 +0,0 @@ -plugins { - id 'com.gradle.enterprise' version '3.1.1' -} - -gradleEnterprise { - buildScan { - termsOfServiceUrl = 'https://gradle.com/terms-of-service' - termsOfServiceAgree = 'yes' - } -} - -include ':app' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..a3a0e3cf --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,38 @@ +pluginManagement { + repositories { + google() + gradlePluginPortal() + mavenCentral() + jcenter { + content { + includeModule("eu.appcom.gradle", "android-versioning") + } + } + } + resolutionStrategy { + eachPlugin { + if (requested.id.namespace == "com.android") { + useModule("com.android.tools.build:gradle:4.0.0-alpha08") + } + if (requested.id.id == "eu.appcom.gradle.android-versioning") { + useModule("eu.appcom.gradle:android-versioning:1.0.2") + } + if (requested.id.namespace == "org.jetbrains.kotlin") { + useVersion("1.3.61") + } + } + } +} + +plugins { + id("com.gradle.enterprise") version "3.1.1" +} + +gradleEnterprise { + buildScan { + termsOfServiceUrl = "https://gradle.com/terms-of-service" + termsOfServiceAgree = "yes" + } +} + +include(":app") \ No newline at end of file From e4b8a9c14db6f222b47e9e2315fea34dd000e220 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 15 Jan 2020 21:02:14 +0100 Subject: [PATCH 002/135] Add apk permission check logic and setup ui --- .../activities/apkinstall/ApkActivity.kt | 6 +- .../activities/apkinstall/ApkContract.kt | 4 + .../activities/apkinstall/ApkFile.kt | 29 ++++++- .../activities/apkinstall/ApkPresenterImpl.kt | 14 ++++ .../activities/apkinstall/ApkWarningDialog.kt | 39 +++++++++ .../drawable-v21/bg_dialog_warning_button.xml | 14 ++++ .../res/drawable/bg_dialog_warning_button.xml | 31 +++++++ .../main/res/layout/apk_warning_dialog.xml | 81 +++++++++++++++++++ app/src/main/res/values/strings.xml | 2 + app/src/main/res/values/styles.xml | 8 ++ 10 files changed, 226 insertions(+), 2 deletions(-) create mode 100644 app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkWarningDialog.kt create mode 100644 app/src/main/res/drawable-v21/bg_dialog_warning_button.xml create mode 100644 app/src/main/res/drawable/bg_dialog_warning_button.xml create mode 100644 app/src/main/res/layout/apk_warning_dialog.xml diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt index 446eba38..bcb7bbfd 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt @@ -28,7 +28,7 @@ class ApkActivity : BaseActivity(true), ApkContract.ApkView { override fun initView() { adapter = ApkAdapter() - adapter.setOnApkClicked { apkFile -> presenter.installApk(apkFile) } + adapter.setOnApkClicked { apkFile -> presenter.installOrShowPermissionWarning(apkFile) } adapter.setOnApkSelect { selectedCount -> showOptions(selectedCount > 0) } adapter.setCommitCallback(Runnable { adapter.itemCount.let { @@ -77,6 +77,10 @@ class ApkActivity : BaseActivity(true), ApkContract.ApkView { adapter.submitList(apkFiles) } + override fun showPermissionWarning(apkFile: ApkFile) { + ApkWarningDialog(this).init { }.show() + } + private fun showOptions(show: Boolean) { binding.deleteHeaderGroup.visibility = if (show) View.VISIBLE else View.GONE } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkContract.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkContract.kt index 8706a99b..601f7ca6 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkContract.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkContract.kt @@ -7,10 +7,14 @@ interface ApkContract { interface ApkView : BaseContract.BaseView { fun toggleResultView(apkFiles: List, missingPermissions: Boolean) + + fun showPermissionWarning(apkFile: ApkFile) } interface ApkPresenter : BaseContract.BasePresenter { + fun installOrShowPermissionWarning(apkFile: ApkFile?) + fun installApk(apkFile: ApkFile?) fun deleteApkFiles(apkFiles: List?) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt index 17d41413..a03ed3fd 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt @@ -2,6 +2,8 @@ package com.g00fy2.developerwidget.activities.apkinstall import android.content.Context import android.content.pm.ApplicationInfo +import android.content.pm.PackageManager +import android.content.pm.PermissionInfo import android.graphics.drawable.AdaptiveIconDrawable import android.graphics.drawable.Drawable import android.graphics.drawable.InsetDrawable @@ -45,6 +47,10 @@ class ApkFile private constructor() : Comparable { private set var fileUri: Uri? = null private set + var dangerousPermissions: Map = emptyMap() + private set + var targetSdkVersion: Int = 0 + private set override fun compareTo(other: ApkFile) = compareValues(other.lastModifiedTimestamp, lastModifiedTimestamp) @@ -67,12 +73,14 @@ class ApkFile private constructor() : Comparable { size = getFormattedSize(file.length()) file.absolutePath.let { filePath -> - packageManager.getPackageArchiveInfo(filePath, 0)?.let { packageInfo -> + packageManager.getPackageArchiveInfo(filePath, PackageManager.GET_PERMISSIONS)?.let { packageInfo -> packageInfo.versionName?.let { versionName = it } PackageInfoCompat.getLongVersionCode(packageInfo).let { versionCode = it.toString() } + dangerousPermissions = extractDangerousPermissions(packageInfo.requestedPermissions) packageInfo.applicationInfo }?.let { appInfo -> valid = true + targetSdkVersion = appInfo.targetSdkVersion appInfo.sourceDir = filePath appInfo.publicSourceDir = filePath packageManager.getApplicationLabel(appInfo).let { appName = it.toString() } @@ -100,6 +108,25 @@ class ApkFile private constructor() : Comparable { } } + private fun extractDangerousPermissions(requestedPermissions: Array?): Map { + return mutableMapOf().apply { + requestedPermissions?.distinct()?.forEach { permission -> + try { + packageManager.getPermissionInfo(permission, 0).let { + @Suppress("DEPRECATION") + if ((VERSION.SDK_INT >= VERSION_CODES.P && it.protection == PermissionInfo.PROTECTION_DANGEROUS) + || it.protectionLevel == PermissionInfo.PROTECTION_DANGEROUS + ) { + put(it.name.substringAfterLast("."), it.loadDescription(packageManager)?.toString()) + } + } + } catch (e: Exception) { + // unknown permission qualifier + } + } + } + } + private fun getFormattedSize(bytes: Long): String { return (round(bytes / 1048576.0 * 100.0) / 100.0).let { sizeMB -> if (sizeMB < 1) { diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt index e06a7bc6..cf2a5303 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt @@ -1,6 +1,8 @@ package com.g00fy2.developerwidget.activities.apkinstall import android.Manifest +import android.os.Build.VERSION +import android.os.Build.VERSION_CODES import androidx.lifecycle.Lifecycle.Event import androidx.lifecycle.OnLifecycleEvent import androidx.lifecycle.lifecycleScope @@ -60,6 +62,18 @@ class ApkPresenterImpl @Inject constructor() : BasePresenterImpl(), ApkContract. .toList() } + override fun installOrShowPermissionWarning(apkFile: ApkFile?) { + apkFile?.let { + if (VERSION.SDK_INT >= VERSION_CODES.M && it.targetSdkVersion < VERSION_CODES.M + && it.dangerousPermissions.isNotEmpty() + ) { + view.showPermissionWarning(it) + } else { + installApk(it) + } + } + } + override fun installApk(apkFile: ApkFile?) { apkFile?.let { intentController.installApk(it) } } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkWarningDialog.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkWarningDialog.kt new file mode 100644 index 00000000..8b4b257f --- /dev/null +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkWarningDialog.kt @@ -0,0 +1,39 @@ +package com.g00fy2.developerwidget.activities.apkinstall + +import android.content.Context +import androidx.appcompat.app.AppCompatDialog +import com.g00fy2.developerwidget.R +import com.g00fy2.developerwidget.databinding.ApkWarningDialogBinding + +class ApkWarningDialog(context: Context) { + + private var binding: ApkWarningDialogBinding + private val dialog = AppCompatDialog(context, R.style.DialogTheme).apply { + setCancelable(true) + binding = ApkWarningDialogBinding.inflate(layoutInflater) + setContentView(binding.root) + binding.dialogCancelTextview.setOnClickListener { dismiss() } + } + + fun deleteMessage(count: Int): ApkWarningDialog { + binding.dialogMessageTextview.text = if (count > 1) String.format( + dialog.context.resources.getString(R.string.message_delete_multi), + count + ) else dialog.context.resources.getString(R.string.message_delete_single) + + return this + } + + fun deleteAction(deleteAction: () -> Unit): ApkWarningDialog { + binding.dialogInstallTextview.setOnClickListener { + dialog.dismiss() + deleteAction() + } + return this + } + + fun init(func: ApkWarningDialog.() -> Unit): AppCompatDialog { + func() + return dialog + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/bg_dialog_warning_button.xml b/app/src/main/res/drawable-v21/bg_dialog_warning_button.xml new file mode 100644 index 00000000..63d853ca --- /dev/null +++ b/app/src/main/res/drawable-v21/bg_dialog_warning_button.xml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_dialog_warning_button.xml b/app/src/main/res/drawable/bg_dialog_warning_button.xml new file mode 100644 index 00000000..a82d4cad --- /dev/null +++ b/app/src/main/res/drawable/bg_dialog_warning_button.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/apk_warning_dialog.xml b/app/src/main/res/layout/apk_warning_dialog.xml new file mode 100644 index 00000000..d95de36e --- /dev/null +++ b/app/src/main/res/layout/apk_warning_dialog.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6cc3b7e6..713d28d7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -62,6 +62,8 @@ You have to manually add a new widget using your launcher. You may need to restart the app to fully take effect. Share device data + Keep me safe + Install anyway Device System diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 6e2d40d9..1dd7c8ba 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -42,6 +42,8 @@ @color/textPrimary @color/textTertiary + 100% + 100% true @drawable/bg_dialog_shape @@ -59,4 +61,10 @@ @drawable/bg_config_button_ripple @color/white + + From ee62050cbb259ff33851c5c5e8ce971b55b13354 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sun, 19 Jan 2020 20:36:13 +0100 Subject: [PATCH 003/135] Add dangerous permissions dialog logic and refactor previous dialogs --- .../activities/about/AboutActivity.kt | 1 + .../{ => dialogs}/AboutFeedbackDialog.kt | 4 +- .../activities/apkinstall/ApkActivity.kt | 7 +- .../activities/apkinstall/ApkFile.kt | 8 +- .../{ => dialogs}/ApkDeleteDialog.kt | 4 +- .../{ => dialogs}/ApkWarningDialog.kt | 31 ++++---- .../apkinstall/dialogs/PermissionsAdapter.kt | 24 ++++++ .../developerwidget/base/BaseAdapter.kt | 9 ++- .../main/res/layout/about_feedback_dialog.xml | 12 +-- .../main/res/layout/apk_warning_dialog.xml | 75 ++++++++++++++----- app/src/main/res/layout/permission_item.xml | 29 +++++++ app/src/main/res/values/strings.xml | 3 + app/src/main/res/values/styles.xml | 2 + 13 files changed, 161 insertions(+), 48 deletions(-) rename app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/{ => dialogs}/AboutFeedbackDialog.kt (89%) rename app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/{ => dialogs}/ApkDeleteDialog.kt (90%) rename app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/{ => dialogs}/ApkWarningDialog.kt (50%) create mode 100644 app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/PermissionsAdapter.kt create mode 100644 app/src/main/res/layout/permission_item.xml diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt index 45156673..8de7d494 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt @@ -11,6 +11,7 @@ import androidx.core.view.updatePadding import androidx.viewbinding.ViewBinding import com.g00fy2.developerwidget.BuildConfig import com.g00fy2.developerwidget.R +import com.g00fy2.developerwidget.activities.about.dialogs.AboutFeedbackDialog import com.g00fy2.developerwidget.activities.widgetconfig.ConfigLauncherActivity import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.base.BaseContract.BasePresenter diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutFeedbackDialog.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/dialogs/AboutFeedbackDialog.kt similarity index 89% rename from app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutFeedbackDialog.kt rename to app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/dialogs/AboutFeedbackDialog.kt index 5fc55e7b..bdefcc81 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutFeedbackDialog.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/dialogs/AboutFeedbackDialog.kt @@ -1,4 +1,4 @@ -package com.g00fy2.developerwidget.activities.about +package com.g00fy2.developerwidget.activities.about.dialogs import android.content.Context import androidx.appcompat.app.AppCompatDialog @@ -7,7 +7,7 @@ import com.g00fy2.developerwidget.databinding.AboutFeedbackDialogBinding class AboutFeedbackDialog(context: Context) { - private var binding: AboutFeedbackDialogBinding + private val binding: AboutFeedbackDialogBinding private val dialog = AppCompatDialog(context, R.style.DialogTheme).apply { setCancelable(true) setCanceledOnTouchOutside(true) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt index bcb7bbfd..658729e6 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt @@ -6,6 +6,8 @@ import androidx.core.view.ViewCompat import androidx.recyclerview.widget.LinearLayoutManager import androidx.viewbinding.ViewBinding import com.g00fy2.developerwidget.R +import com.g00fy2.developerwidget.activities.apkinstall.dialogs.ApkDeleteDialog +import com.g00fy2.developerwidget.activities.apkinstall.dialogs.ApkWarningDialog import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.base.BaseContract.BasePresenter import com.g00fy2.developerwidget.databinding.ActivityApkBinding @@ -78,7 +80,10 @@ class ApkActivity : BaseActivity(true), ApkContract.ApkView { } override fun showPermissionWarning(apkFile: ApkFile) { - ApkWarningDialog(this).init { }.show() + ApkWarningDialog(this).init { + installCallback { presenter.installApk(apkFile) } + permissionList(apkFile.dangerousPermissions) + }.show() } private fun showOptions(show: Boolean) { diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt index a03ed3fd..86f9597a 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt @@ -47,7 +47,7 @@ class ApkFile private constructor() : Comparable { private set var fileUri: Uri? = null private set - var dangerousPermissions: Map = emptyMap() + var dangerousPermissions: List> = emptyList() private set var targetSdkVersion: Int = 0 private set @@ -108,8 +108,8 @@ class ApkFile private constructor() : Comparable { } } - private fun extractDangerousPermissions(requestedPermissions: Array?): Map { - return mutableMapOf().apply { + private fun extractDangerousPermissions(requestedPermissions: Array?): List> { + return mutableListOf>().apply { requestedPermissions?.distinct()?.forEach { permission -> try { packageManager.getPermissionInfo(permission, 0).let { @@ -117,7 +117,7 @@ class ApkFile private constructor() : Comparable { if ((VERSION.SDK_INT >= VERSION_CODES.P && it.protection == PermissionInfo.PROTECTION_DANGEROUS) || it.protectionLevel == PermissionInfo.PROTECTION_DANGEROUS ) { - put(it.name.substringAfterLast("."), it.loadDescription(packageManager)?.toString()) + add(Pair(it.name.substringAfterLast("."), it.loadDescription(packageManager)?.toString())) } } } catch (e: Exception) { diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkDeleteDialog.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/ApkDeleteDialog.kt similarity index 90% rename from app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkDeleteDialog.kt rename to app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/ApkDeleteDialog.kt index 641ec618..44f2e427 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkDeleteDialog.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/ApkDeleteDialog.kt @@ -1,4 +1,4 @@ -package com.g00fy2.developerwidget.activities.apkinstall +package com.g00fy2.developerwidget.activities.apkinstall.dialogs import android.content.Context import androidx.appcompat.app.AppCompatDialog @@ -7,7 +7,7 @@ import com.g00fy2.developerwidget.databinding.ApkDeleteDialogBinding class ApkDeleteDialog(context: Context) { - private var binding: ApkDeleteDialogBinding + private val binding: ApkDeleteDialogBinding private val dialog = AppCompatDialog(context, R.style.DialogTheme).apply { setCancelable(true) binding = ApkDeleteDialogBinding.inflate(layoutInflater) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkWarningDialog.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/ApkWarningDialog.kt similarity index 50% rename from app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkWarningDialog.kt rename to app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/ApkWarningDialog.kt index 8b4b257f..cca5a2d0 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkWarningDialog.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/ApkWarningDialog.kt @@ -1,34 +1,39 @@ -package com.g00fy2.developerwidget.activities.apkinstall +package com.g00fy2.developerwidget.activities.apkinstall.dialogs import android.content.Context import androidx.appcompat.app.AppCompatDialog +import androidx.recyclerview.widget.LinearLayoutManager import com.g00fy2.developerwidget.R import com.g00fy2.developerwidget.databinding.ApkWarningDialogBinding class ApkWarningDialog(context: Context) { - private var binding: ApkWarningDialogBinding + private val binding: ApkWarningDialogBinding + private val adapter: PermissionsAdapter + private var installAction: () -> Unit = {} private val dialog = AppCompatDialog(context, R.style.DialogTheme).apply { setCancelable(true) binding = ApkWarningDialogBinding.inflate(layoutInflater) setContentView(binding.root) binding.dialogCancelTextview.setOnClickListener { dismiss() } - } + binding.dialogInstallTextview.setOnClickListener { + dismiss() + installAction() + } - fun deleteMessage(count: Int): ApkWarningDialog { - binding.dialogMessageTextview.text = if (count > 1) String.format( - dialog.context.resources.getString(R.string.message_delete_multi), - count - ) else dialog.context.resources.getString(R.string.message_delete_single) + adapter = PermissionsAdapter() + binding.recyclerview.setHasFixedSize(true) + binding.recyclerview.layoutManager = LinearLayoutManager(context) + binding.recyclerview.adapter = adapter + } + fun permissionList(permissions: List>): ApkWarningDialog { + adapter.submitList(permissions) return this } - fun deleteAction(deleteAction: () -> Unit): ApkWarningDialog { - binding.dialogInstallTextview.setOnClickListener { - dialog.dismiss() - deleteAction() - } + fun installCallback(action: () -> Unit): ApkWarningDialog { + installAction = action return this } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/PermissionsAdapter.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/PermissionsAdapter.kt new file mode 100644 index 00000000..ddb72575 --- /dev/null +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/PermissionsAdapter.kt @@ -0,0 +1,24 @@ +package com.g00fy2.developerwidget.activities.apkinstall.dialogs + +import android.view.LayoutInflater +import android.view.ViewGroup +import com.g00fy2.developerwidget.activities.apkinstall.dialogs.PermissionsAdapter.PermissionViewHolder +import com.g00fy2.developerwidget.base.BaseAdapter +import com.g00fy2.developerwidget.base.BaseViewHolder +import com.g00fy2.developerwidget.databinding.PermissionItemBinding + +class PermissionsAdapter : BaseAdapter, PermissionViewHolder>(null) { + + inner class PermissionViewHolder(val binding: PermissionItemBinding) : + BaseViewHolder>(binding) { + override fun onBind(item: Pair) { + item.run { + binding.permissionTitle.text = item.first + binding.permissionDescription.text = item.second ?: "" + } + } + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = + PermissionViewHolder(PermissionItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)) +} \ No newline at end of file diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseAdapter.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseAdapter.kt index a92a2dc7..eb23df63 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseAdapter.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseAdapter.kt @@ -3,8 +3,8 @@ package com.g00fy2.developerwidget.base import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.ListAdapter -abstract class BaseAdapter> constructor(diffCallback: DiffUtil.ItemCallback) : - ListAdapter(diffCallback) { +abstract class BaseAdapter> constructor(diffCallback: DiffUtil.ItemCallback?) : + ListAdapter(diffCallback ?: EmptyDiffUtil()) { private var commitCallback: Runnable? = null @@ -23,4 +23,9 @@ abstract class BaseAdapter> constructor(diffCallback: fun setCommitCallback(commitCallback: Runnable) { this.commitCallback = commitCallback } + + class EmptyDiffUtil : DiffUtil.ItemCallback() { + override fun areItemsTheSame(oldItem: T, newItem: T) = false + override fun areContentsTheSame(oldItem: T, newItem: T) = false + } } \ No newline at end of file diff --git a/app/src/main/res/layout/about_feedback_dialog.xml b/app/src/main/res/layout/about_feedback_dialog.xml index 2670aa83..ddd26b3d 100644 --- a/app/src/main/res/layout/about_feedback_dialog.xml +++ b/app/src/main/res/layout/about_feedback_dialog.xml @@ -2,24 +2,24 @@ - + + + + + + @@ -63,7 +101,7 @@ android:layout_marginBottom="4dp" android:layout_marginEnd="8dp" android:layout_marginRight="8dp" - android:layout_marginTop="4dp" + android:layout_marginTop="8dp" android:background="@drawable/bg_dialog_warning_button" android:clickable="true" android:focusable="true" @@ -74,8 +112,7 @@ android:textColor="@color/backgroundColor" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@+id/dialog_message_textview" + app:layout_constraintTop_toBottomOf="@+id/recyclerview_constraintlayout" style="@style/DialogButtonAppearance" /> - \ No newline at end of file diff --git a/app/src/main/res/layout/permission_item.xml b/app/src/main/res/layout/permission_item.xml new file mode 100644 index 00000000..15e57bf7 --- /dev/null +++ b/app/src/main/res/layout/permission_item.xml @@ -0,0 +1,29 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 713d28d7..d7e3527d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -62,6 +62,9 @@ You have to manually add a new widget using your launcher. You may need to restart the app to fully take effect. Share device data + Potentially harmful app + This app contains code that attempts to bypass Android\'s security protections. + Permissions without runtime request: Keep me safe Install anyway diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 1dd7c8ba..abd2bf35 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -13,6 +13,8 @@ @style/ActionBarAccent @style/ActionBarBackground @null + + sans-serif @color/colorEdgeEffect @color/navigationBarColor From a368e2e77c167cb7c0cc353f9c4af988080ddd0e Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sun, 19 Jan 2020 20:36:35 +0100 Subject: [PATCH 004/135] Remove Android Q memory leak workaround --- .../com/g00fy2/developerwidget/base/BaseActivity.kt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt index d3543620..111b73b0 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt @@ -49,15 +49,6 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag lifecycle.removeObserver(providePresenter()) } - // TODO check if there will be a fix for https://issuetracker.google.com/issues/139738913 in AppCompatActivity or next Android release - override fun onBackPressed() { - if (VERSION.SDK_INT == VERSION_CODES.Q && isTaskRoot && supportFragmentManager.backStackEntryCount == 0) { - finishAfterTransition() - } else { - super.onBackPressed() - } - } - protected fun setActionbarElevationListener(viewGroup: ViewGroup) { supportActionBar?.elevation = 0f viewGroup.viewTreeObserver.addOnScrollChangedListener { From ebe425ca82c0c9c44062e6b94a5c2e2c32adf960 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sun, 19 Jan 2020 20:37:58 +0100 Subject: [PATCH 005/135] Update gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 301bc82b..31a0802f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-rc-3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 7a973a55ec095bba6ecbe9cbcfda3a399067b948 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Mon, 20 Jan 2020 01:21:17 +0100 Subject: [PATCH 006/135] Adjust dialog layouts --- app/src/main/res/layout/apk_delete_dialog.xml | 10 ++++++---- app/src/main/res/layout/permission_item.xml | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/layout/apk_delete_dialog.xml b/app/src/main/res/layout/apk_delete_dialog.xml index 1ff7ea9a..35522fd8 100644 --- a/app/src/main/res/layout/apk_delete_dialog.xml +++ b/app/src/main/res/layout/apk_delete_dialog.xml @@ -3,20 +3,22 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" - android:layout_width="wrap_content" + android:layout_width="match_parent" android:layout_height="wrap_content" > diff --git a/app/src/main/res/layout/permission_item.xml b/app/src/main/res/layout/permission_item.xml index 15e57bf7..8205cc80 100644 --- a/app/src/main/res/layout/permission_item.xml +++ b/app/src/main/res/layout/permission_item.xml @@ -14,7 +14,7 @@ android:textAllCaps="true" android:textColor="@color/textPrimary" android:textSize="14sp" - android:textStyle="bold" + android:textAppearance="@style/TextAppearance.AppCompat.Title" tools:text="ACCESS_FINE_LOCATION" /> Date: Mon, 20 Jan 2020 01:25:28 +0100 Subject: [PATCH 007/135] Update Readme --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 90e983f4..57784a8b 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,10 @@ [](https://raw.githubusercontent.com/G00fY2/DeveloperWidget/gh-pages/media/store_screenshot_4.png) [](https://raw.githubusercontent.com/G00fY2/DeveloperWidget/gh-pages/media/store_screenshot_5.png) -created with [App Mockup](https://app-mockup.com) +## Download +Get it on Google Play + +You also find the latest APK in the [GitHub releases](https://github.com/G00fY2/DeveloperWidget/releases). ## Description The app was built from a developer for developers. You may know the hassle of having multiple physical devices running different software. This app will help you keep track of important device information and allows you to organize your apps and local APK files. You will never again struggle to find APK files using a file browser or search for the app settings menu on a custom manufacturer UI. @@ -48,11 +51,6 @@ The main feature of the app is an 4x1 (horizontally resizable) homescreen widget * Show more information in the APK install view * currently installed version, filepath, certificates ... -## Download -Get it on Google Play - -You also find the latest APK in the [GitHub releases](https://github.com/G00fY2/DeveloperWidget/releases). - ## Release Notes Check out the [Release Notes](https://github.com/G00fY2/DeveloperWidget/releases) to find out what changed From 81fcf3a586158de39c13f19006e2d62f980d9f3a Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Mon, 20 Jan 2020 19:45:04 +0100 Subject: [PATCH 008/135] Fix delete icon tooltip --- .../g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt index 658729e6..10dec760 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt @@ -44,7 +44,7 @@ class ApkActivity : BaseActivity(true), ApkContract.ApkView { binding.recyclerview.adapter = adapter binding.cancelTextview.setOnClickListener { finish() } - TooltipCompat.setTooltipText(binding.clearImageview, binding.clearImageview.contentDescription) + TooltipCompat.setTooltipText(binding.deleteImageview, binding.deleteImageview.contentDescription) binding.deleteImageview.setOnClickListener { showConfirmationDialog() } TooltipCompat.setTooltipText(binding.clearImageview, binding.clearImageview.contentDescription) binding.clearImageview.setOnClickListener { From 178e03ee69b786a27cf8dd43ed38303e26503895 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 22 Jan 2020 00:45:28 +0100 Subject: [PATCH 009/135] Update android studio --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index a3a0e3cf..ee2c8114 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -12,7 +12,7 @@ pluginManagement { resolutionStrategy { eachPlugin { if (requested.id.namespace == "com.android") { - useModule("com.android.tools.build:gradle:4.0.0-alpha08") + useModule("com.android.tools.build:gradle:4.0.0-alpha09") } if (requested.id.id == "eu.appcom.gradle.android-versioning") { useModule("eu.appcom.gradle:android-versioning:1.0.2") From 1ba09690950e50bd8afa6144729dc3de5722d21a Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 22 Jan 2020 20:25:17 +0100 Subject: [PATCH 010/135] Updates dependencies --- app/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 880d1920..41947619 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -72,8 +72,8 @@ dependencies { // AndroidX implementation("androidx.appcompat:appcompat:1.2.0-alpha01") implementation("androidx.core:core-ktx:1.2.0-rc01") - implementation("androidx.activity:activity:1.1.0-rc03") - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.2.0-rc03") + implementation("androidx.activity:activity:1.1.0") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.2.0") implementation("androidx.recyclerview:recyclerview:1.2.0-alpha01") implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta4") implementation("androidx.vectordrawable:vectordrawable:1.1.0") From a32b613aa33803a346cc877d2acfdc2bc2bec364 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sat, 25 Jan 2020 13:31:28 +0100 Subject: [PATCH 011/135] Updates gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 31a0802f..4e1cc9db 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME 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 zipStorePath=wrapper/dists From 6eadaa3ad7ee60da1a3f97f29f1cbb6cf4e6d747 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sun, 26 Jan 2020 16:48:10 +0100 Subject: [PATCH 012/135] Tint drawables instead using additional resource files --- app/src/main/res/drawable-night/ic_about.xml | 12 ------------ app/src/main/res/drawable-night/ic_check.xml | 9 --------- app/src/main/res/drawable-night/ic_clear.xml | 9 --------- app/src/main/res/drawable-night/ic_delete.xml | 12 ------------ app/src/main/res/layout/activity_apk.xml | 2 ++ app/src/main/res/layout/apk_item.xml | 1 + app/src/main/res/menu/configuration_menu.xml | 1 + app/src/main/res/values-night/colors.xml | 1 + app/src/main/res/values/colors.xml | 1 + 9 files changed, 6 insertions(+), 42 deletions(-) delete mode 100644 app/src/main/res/drawable-night/ic_about.xml delete mode 100644 app/src/main/res/drawable-night/ic_check.xml delete mode 100644 app/src/main/res/drawable-night/ic_clear.xml delete mode 100644 app/src/main/res/drawable-night/ic_delete.xml diff --git a/app/src/main/res/drawable-night/ic_about.xml b/app/src/main/res/drawable-night/ic_about.xml deleted file mode 100644 index 9771b2e1..00000000 --- a/app/src/main/res/drawable-night/ic_about.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable-night/ic_check.xml b/app/src/main/res/drawable-night/ic_check.xml deleted file mode 100644 index b3b91ba2..00000000 --- a/app/src/main/res/drawable-night/ic_check.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - \ No newline at end of file diff --git a/app/src/main/res/drawable-night/ic_clear.xml b/app/src/main/res/drawable-night/ic_clear.xml deleted file mode 100644 index f775ee90..00000000 --- a/app/src/main/res/drawable-night/ic_clear.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - \ No newline at end of file diff --git a/app/src/main/res/drawable-night/ic_delete.xml b/app/src/main/res/drawable-night/ic_delete.xml deleted file mode 100644 index 86f608cc..00000000 --- a/app/src/main/res/drawable-night/ic_delete.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_apk.xml b/app/src/main/res/layout/activity_apk.xml index 140003d7..0d2b6d26 100644 --- a/app/src/main/res/layout/activity_apk.xml +++ b/app/src/main/res/layout/activity_apk.xml @@ -43,6 +43,7 @@ android:contentDescription="@string/clear" android:focusable="true" android:scaleType="center" + android:tint="@color/backgroundColor" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:srcCompat="@drawable/ic_clear" @@ -60,6 +61,7 @@ android:contentDescription="@string/delete" android:focusable="true" android:scaleType="center" + android:tint="@color/backgroundColor" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" app:srcCompat="@drawable/ic_delete" diff --git a/app/src/main/res/layout/apk_item.xml b/app/src/main/res/layout/apk_item.xml index 0a0bd490..0cb9b766 100644 --- a/app/src/main/res/layout/apk_item.xml +++ b/app/src/main/res/layout/apk_item.xml @@ -35,6 +35,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:srcCompat="@drawable/ic_check" + android:tint="@color/backgroundColor" /> \ No newline at end of file diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 953bd2f7..530c5c4d 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -20,4 +20,5 @@ @color/nightGrey #33000000 + @color/iconTintColor diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 423f71d9..ff579245 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -27,6 +27,7 @@ @color/lighterGrey #33808080 + @color/colorAccent #00000000 From 1a541a647aacfc7fb0444a3fd5cc417d3390d086 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 29 Jan 2020 01:10:42 +0100 Subject: [PATCH 013/135] Change night background color of inner dialogs and optimize styles usage --- .../about/dialogs/AboutFeedbackDialog.kt | 2 +- .../apkinstall/dialogs/ApkDeleteDialog.kt | 2 +- .../apkinstall/dialogs/ApkWarningDialog.kt | 2 +- .../bg_dialog_button_bright_ripple.xml | 14 +++++++++ ...utton.xml => bg_dialog_colored_button.xml} | 0 .../bg_dialog_button_bright_ripple.xml | 31 +++++++++++++++++++ ...utton.xml => bg_dialog_colored_button.xml} | 0 .../res/drawable/bg_dialog_shape_bright.xml | 4 +++ app/src/main/res/layout/activity_apk.xml | 1 - app/src/main/res/layout/activity_apps.xml | 1 - .../res/layout/activity_widget_config.xml | 2 -- app/src/main/res/layout/apk_delete_dialog.xml | 28 ++--------------- .../main/res/layout/apk_warning_dialog.xml | 29 ++--------------- app/src/main/res/values-night/colors.xml | 1 + app/src/main/res/values-night/styles.xml | 4 ++- app/src/main/res/values/colors.xml | 1 + app/src/main/res/values/styles.xml | 31 ++++++++++++++++--- 17 files changed, 87 insertions(+), 66 deletions(-) create mode 100644 app/src/main/res/drawable-v21/bg_dialog_button_bright_ripple.xml rename app/src/main/res/drawable-v21/{bg_dialog_warning_button.xml => bg_dialog_colored_button.xml} (100%) create mode 100644 app/src/main/res/drawable/bg_dialog_button_bright_ripple.xml rename app/src/main/res/drawable/{bg_dialog_warning_button.xml => bg_dialog_colored_button.xml} (100%) create mode 100644 app/src/main/res/drawable/bg_dialog_shape_bright.xml diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/dialogs/AboutFeedbackDialog.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/dialogs/AboutFeedbackDialog.kt index bdefcc81..017c3250 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/dialogs/AboutFeedbackDialog.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/dialogs/AboutFeedbackDialog.kt @@ -8,7 +8,7 @@ import com.g00fy2.developerwidget.databinding.AboutFeedbackDialogBinding class AboutFeedbackDialog(context: Context) { private val binding: AboutFeedbackDialogBinding - private val dialog = AppCompatDialog(context, R.style.DialogTheme).apply { + private val dialog = AppCompatDialog(context, R.style.DialogNestedTheme).apply { setCancelable(true) setCanceledOnTouchOutside(true) binding = AboutFeedbackDialogBinding.inflate(layoutInflater) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/ApkDeleteDialog.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/ApkDeleteDialog.kt index 44f2e427..eab7bc6f 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/ApkDeleteDialog.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/ApkDeleteDialog.kt @@ -8,7 +8,7 @@ import com.g00fy2.developerwidget.databinding.ApkDeleteDialogBinding class ApkDeleteDialog(context: Context) { private val binding: ApkDeleteDialogBinding - private val dialog = AppCompatDialog(context, R.style.DialogTheme).apply { + private val dialog = AppCompatDialog(context, R.style.DialogNestedTheme).apply { setCancelable(true) binding = ApkDeleteDialogBinding.inflate(layoutInflater) setContentView(binding.root) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/ApkWarningDialog.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/ApkWarningDialog.kt index cca5a2d0..c9d8b8d8 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/ApkWarningDialog.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/ApkWarningDialog.kt @@ -11,7 +11,7 @@ class ApkWarningDialog(context: Context) { private val binding: ApkWarningDialogBinding private val adapter: PermissionsAdapter private var installAction: () -> Unit = {} - private val dialog = AppCompatDialog(context, R.style.DialogTheme).apply { + private val dialog = AppCompatDialog(context, R.style.DialogNestedTheme).apply { setCancelable(true) binding = ApkWarningDialogBinding.inflate(layoutInflater) setContentView(binding.root) diff --git a/app/src/main/res/drawable-v21/bg_dialog_button_bright_ripple.xml b/app/src/main/res/drawable-v21/bg_dialog_button_bright_ripple.xml new file mode 100644 index 00000000..8bf21499 --- /dev/null +++ b/app/src/main/res/drawable-v21/bg_dialog_button_bright_ripple.xml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/bg_dialog_warning_button.xml b/app/src/main/res/drawable-v21/bg_dialog_colored_button.xml similarity index 100% rename from app/src/main/res/drawable-v21/bg_dialog_warning_button.xml rename to app/src/main/res/drawable-v21/bg_dialog_colored_button.xml diff --git a/app/src/main/res/drawable/bg_dialog_button_bright_ripple.xml b/app/src/main/res/drawable/bg_dialog_button_bright_ripple.xml new file mode 100644 index 00000000..f77aaece --- /dev/null +++ b/app/src/main/res/drawable/bg_dialog_button_bright_ripple.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_dialog_warning_button.xml b/app/src/main/res/drawable/bg_dialog_colored_button.xml similarity index 100% rename from app/src/main/res/drawable/bg_dialog_warning_button.xml rename to app/src/main/res/drawable/bg_dialog_colored_button.xml diff --git a/app/src/main/res/drawable/bg_dialog_shape_bright.xml b/app/src/main/res/drawable/bg_dialog_shape_bright.xml new file mode 100644 index 00000000..5812e181 --- /dev/null +++ b/app/src/main/res/drawable/bg_dialog_shape_bright.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_apk.xml b/app/src/main/res/layout/activity_apk.xml index 0d2b6d26..02f557f4 100644 --- a/app/src/main/res/layout/activity_apk.xml +++ b/app/src/main/res/layout/activity_apk.xml @@ -141,7 +141,6 @@ android:layout_marginEnd="@dimen/action_bar_inset" android:layout_marginRight="@dimen/action_bar_inset" android:layout_marginTop="4dp" - android:background="@drawable/bg_dialog_button_ripple" android:clickable="true" android:focusable="true" android:gravity="center_vertical" diff --git a/app/src/main/res/layout/activity_apps.xml b/app/src/main/res/layout/activity_apps.xml index 1973a67a..157e00b9 100644 --- a/app/src/main/res/layout/activity_apps.xml +++ b/app/src/main/res/layout/activity_apps.xml @@ -214,7 +214,6 @@ android:layout_marginEnd="16dp" android:layout_marginRight="16dp" android:layout_marginTop="4dp" - android:background="@drawable/bg_dialog_button_ripple" android:clickable="true" android:focusable="true" android:gravity="center_vertical" diff --git a/app/src/main/res/layout/activity_widget_config.xml b/app/src/main/res/layout/activity_widget_config.xml index fcfc1f88..d9bdae15 100644 --- a/app/src/main/res/layout/activity_widget_config.xml +++ b/app/src/main/res/layout/activity_widget_config.xml @@ -92,8 +92,6 @@ android:paddingLeft="8dp" android:paddingRight="8dp" android:text="@string/add_widget" - android:textAllCaps="false" - android:textSize="15sp" app:layout_constraintBottom_toBottomOf="@+id/top_view" app:layout_constraintStart_toStartOf="parent" style="@style/ConfigureButtonAppearance" diff --git a/app/src/main/res/layout/apk_delete_dialog.xml b/app/src/main/res/layout/apk_delete_dialog.xml index 35522fd8..ef386331 100644 --- a/app/src/main/res/layout/apk_delete_dialog.xml +++ b/app/src/main/res/layout/apk_delete_dialog.xml @@ -24,44 +24,20 @@ \ No newline at end of file diff --git a/app/src/main/res/layout/apk_warning_dialog.xml b/app/src/main/res/layout/apk_warning_dialog.xml index f8eeee05..65a7d6c5 100644 --- a/app/src/main/res/layout/apk_warning_dialog.xml +++ b/app/src/main/res/layout/apk_warning_dialog.xml @@ -75,44 +75,19 @@ \ No newline at end of file diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 530c5c4d..8a469e66 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -10,6 +10,7 @@ @color/nightBackground @color/transparentBackground50_night #5f6368 + #424242 #A6202124 #a0a0a0 diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml index f689c799..59c24f7c 100644 --- a/app/src/main/res/values-night/styles.xml +++ b/app/src/main/res/values-night/styles.xml @@ -15,8 +15,10 @@ diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index ff579245..be13a37a 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -14,6 +14,7 @@ #80ffffff #80202124 @color/lighterGrey + @color/backgroundColor @color/black @color/navigationBarColor diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index abd2bf35..44d89893 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -54,19 +54,40 @@ @color/colorEdgeEffect + + - - + + From bb2fb9d2c4e61a960971054b66c372cf7f47bd3e Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 30 Jan 2020 10:44:37 +0100 Subject: [PATCH 014/135] Update dagger and drop jetifier --- app/build.gradle.kts | 10 +++++----- gradle.properties | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 41947619..9722a4d2 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -86,10 +86,10 @@ dependencies { implementation("com.g00fy2:versioncompare:1.3.4") // Dagger - implementation("com.google.dagger:dagger:2.25.4") - kapt("com.google.dagger:dagger-compiler:2.25.4") - implementation("com.google.dagger:dagger-android:2.25.4") - implementation("com.google.dagger:dagger-android-support:2.25.4") - kapt("com.google.dagger:dagger-android-processor:2.25.4") + implementation("com.google.dagger:dagger:2.26") + kapt("com.google.dagger:dagger-compiler:2.26") + implementation("com.google.dagger:dagger-android:2.26") + implementation("com.google.dagger:dagger-android-support:2.26") + kapt("com.google.dagger:dagger-android-processor:2.26") compileOnly("javax.annotation:javax.annotation-api:1.3.2") } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index b52439ea..9b75ab47 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,6 @@ android.useAndroidX=true -# Enable jetifier, currently only because dagger still uses android.support.annotation -android.enableJetifier=true +android.enableJetifier=false # Use R8 in full mode instead of ProGuard compatibility mode. android.enableR8.fullMode=true From 358ba696795d7e549b098203d1d9a2f83a3dd097 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 30 Jan 2020 19:31:04 +0100 Subject: [PATCH 015/135] Update dependencies --- app/build.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9722a4d2..0e813918 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -70,8 +70,8 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3") // AndroidX - implementation("androidx.appcompat:appcompat:1.2.0-alpha01") - implementation("androidx.core:core-ktx:1.2.0-rc01") + implementation("androidx.appcompat:appcompat:1.2.0-alpha02") + implementation("androidx.core:core-ktx:1.3.0-alpha01") implementation("androidx.activity:activity:1.1.0") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.2.0") implementation("androidx.recyclerview:recyclerview:1.2.0-alpha01") @@ -79,7 +79,7 @@ dependencies { implementation("androidx.vectordrawable:vectordrawable:1.1.0") // UI - implementation("com.google.android.material:material:1.2.0-alpha03") + implementation("com.google.android.material:material:1.2.0-alpha04") // Misc implementation("com.jakewharton.timber:timber:4.7.1") From c7232ee97d34e25ae7b0e8a06705899eb53f54fd Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 31 Jan 2020 00:36:02 +0100 Subject: [PATCH 016/135] Use appcompat tinting for imageviews --- app/src/main/res/layout/about_item.xml | 10 +++++----- app/src/main/res/layout/activity_apk.xml | 4 ++-- app/src/main/res/layout/activity_apps.xml | 4 ++-- app/src/main/res/layout/apk_item.xml | 2 +- app/src/main/res/layout/appwidget_layout.xml | 19 ++++++++++--------- .../main/res/layout/appwidget_layout_day.xml | 15 ++++++++------- .../res/layout/appwidget_layout_night.xml | 11 ++++++----- 7 files changed, 34 insertions(+), 31 deletions(-) diff --git a/app/src/main/res/layout/about_item.xml b/app/src/main/res/layout/about_item.xml index 28002a45..8ed5c495 100644 --- a/app/src/main/res/layout/about_item.xml +++ b/app/src/main/res/layout/about_item.xml @@ -12,11 +12,11 @@ android:layout_height="24dp" android:layout_marginLeft="@dimen/about_item_icon_margin" android:layout_marginStart="@dimen/about_item_icon_margin" - android:tint="@color/iconTintColor" android:visibility="invisible" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" + app:tint="@color/iconTintColor" tools:ignore="ContentDescription" tools:src="@drawable/ic_open_source_logo" tools:visibility="visible" @@ -28,11 +28,11 @@ android:layout_height="wrap_content" android:layout_marginLeft="@dimen/about_item_icon_margin" android:layout_marginStart="@dimen/about_item_icon_margin" + android:ellipsize="end" + android:maxLines="1" android:textAppearance="@style/Base.TextAppearance.AppCompat.Title" android:textSize="16sp" android:visibility="gone" - android:maxLines="1" - android:ellipsize="end" app:layout_constraintBottom_toTopOf="@+id/description_textview" app:layout_constraintEnd_toStartOf="@+id/setting_switch" app:layout_constraintHorizontal_bias="0.0" @@ -48,10 +48,10 @@ android:layout_height="wrap_content" android:layout_marginLeft="@dimen/about_item_icon_margin" android:layout_marginStart="@dimen/about_item_icon_margin" + android:ellipsize="end" + android:maxLines="1" android:textSize="14sp" android:visibility="gone" - android:maxLines="1" - android:ellipsize="end" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/setting_switch" app:layout_constraintHorizontal_bias="0.0" diff --git a/app/src/main/res/layout/activity_apk.xml b/app/src/main/res/layout/activity_apk.xml index 02f557f4..1a0fe979 100644 --- a/app/src/main/res/layout/activity_apk.xml +++ b/app/src/main/res/layout/activity_apk.xml @@ -43,9 +43,9 @@ android:contentDescription="@string/clear" android:focusable="true" android:scaleType="center" - android:tint="@color/backgroundColor" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" + app:tint="@color/backgroundColor" app:srcCompat="@drawable/ic_clear" /> @@ -61,9 +61,9 @@ android:contentDescription="@string/delete" android:focusable="true" android:scaleType="center" - android:tint="@color/backgroundColor" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" + app:tint="@color/backgroundColor" app:srcCompat="@drawable/ic_delete" /> diff --git a/app/src/main/res/layout/activity_apps.xml b/app/src/main/res/layout/activity_apps.xml index 157e00b9..4be3708f 100644 --- a/app/src/main/res/layout/activity_apps.xml +++ b/app/src/main/res/layout/activity_apps.xml @@ -43,7 +43,7 @@ android:contentDescription="@string/filter" android:focusable="true" android:scaleType="center" - android:tint="@color/iconTintColor" + app:tint="@color/iconTintColor" app:srcCompat="@drawable/ic_filter" /> @@ -119,7 +119,7 @@ android:layout_height="12dp" android:layout_gravity="center|start" android:contentDescription="@string/show_all" - android:tint="@color/colorAccent" + app:tint="@color/colorAccent" app:srcCompat="@drawable/ic_chevron_right" /> diff --git a/app/src/main/res/layout/apk_item.xml b/app/src/main/res/layout/apk_item.xml index 0cb9b766..9cc72e1a 100644 --- a/app/src/main/res/layout/apk_item.xml +++ b/app/src/main/res/layout/apk_item.xml @@ -35,7 +35,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:srcCompat="@drawable/ic_check" - android:tint="@color/backgroundColor" + app:tint="@color/backgroundColor" /> Date: Thu, 6 Feb 2020 01:21:52 +0100 Subject: [PATCH 017/135] Update gradle and update to latest koltin eap version --- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4e1cc9db..642af1b4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-rc-1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index ee2c8114..c5ed7206 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,6 +3,7 @@ pluginManagement { google() gradlePluginPortal() mavenCentral() + maven("https://dl.bintray.com/kotlin/kotlin-eap") jcenter { content { includeModule("eu.appcom.gradle", "android-versioning") @@ -18,7 +19,7 @@ pluginManagement { useModule("eu.appcom.gradle:android-versioning:1.0.2") } if (requested.id.namespace == "org.jetbrains.kotlin") { - useVersion("1.3.61") + useVersion("1.3.70-eap-184") } } } From a1bcd9ae5d0cc63609c2d9740335849f7c5c2397 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 6 Feb 2020 01:27:36 +0100 Subject: [PATCH 018/135] Remove license report plugin --- build.gradle.kts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index d72caf09..72a2825b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,16 +1,3 @@ -import com.github.jk1.license.filter.* -import com.github.jk1.license.render.* - -plugins { - id("com.github.jk1.dependency-license-report") version "1.12" -} - -licenseReport { - configurations = arrayOf("releaseRuntimeClasspath") - renderers = arrayOf(SimpleHtmlReportRenderer(), JsonReportRenderer()) - filters = arrayOf(LicenseBundleNormalizer()) -} - tasks.register("clean", Delete::class) { delete(rootProject.buildDir) } \ No newline at end of file From 38929dbaa04a924ace661c24456585991da1150f Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 6 Feb 2020 01:44:59 +0100 Subject: [PATCH 019/135] Add missing repo --- app/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 0e813918..c2092558 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -57,6 +57,7 @@ android { repositories { google() mavenCentral() + maven("https://dl.bintray.com/kotlin/kotlin-eap") jcenter { content { includeModule("com.g00fy2", "versioncompare") From 254b76b42fb6ca8707fa4a8f490fc97945d04765 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 6 Feb 2020 16:37:36 +0100 Subject: [PATCH 020/135] Update kotlin dependency --- app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c2092558..5a0fd968 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -67,7 +67,7 @@ repositories { } dependencies { // Kotlin - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61") + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.70-eap-184") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3") // AndroidX From e83f3f049cc674ef81dcdd1eda3cc42d7899dfc7 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 6 Feb 2020 16:41:42 +0100 Subject: [PATCH 021/135] Update sdk build tools --- app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5a0fd968..c63d00d0 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -7,7 +7,7 @@ plugins { android { compileSdkVersion(29) - buildToolsVersion = "29.0.2" + buildToolsVersion = "29.0.3" defaultConfig { applicationId = "com.g00fy2.developerwidget" minSdkVersion(14) From 7ea6734aa051bf636fce3caaecdac2acaaf85d77 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 6 Feb 2020 17:27:45 +0100 Subject: [PATCH 022/135] Remove appcompat usage in the widget layout to fix drawable tinting --- app/src/main/res/layout/appwidget_layout.xml | 7 +++---- app/src/main/res/layout/appwidget_layout_day.xml | 7 +++---- app/src/main/res/layout/appwidget_layout_night.xml | 7 +++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/app/src/main/res/layout/appwidget_layout.xml b/app/src/main/res/layout/appwidget_layout.xml index 3934ea3f..53183876 100644 --- a/app/src/main/res/layout/appwidget_layout.xml +++ b/app/src/main/res/layout/appwidget_layout.xml @@ -1,13 +1,12 @@ Date: Mon, 10 Feb 2020 23:08:23 +0100 Subject: [PATCH 023/135] Move storage directory controller to specific activity scope and make use of reusable dagger annotation --- .../kotlin/com/g00fy2/developerwidget/DevWidgetApp.kt | 4 ++-- .../activities/apkinstall/ApkActivityModule.kt | 6 ++++++ .../activities/apkinstall/ApkPresenterImpl.kt | 2 +- .../apkinstall}/controllers/StorageDirsController.kt | 2 +- .../controllers/StorageDirsControllerImpl.kt | 2 +- .../com/g00fy2/developerwidget/di/AppComponent.kt | 9 ++++++++- .../com/g00fy2/developerwidget/di/ControllerModule.kt | 11 +++-------- .../com/g00fy2/developerwidget/di/DeviceDataModule.kt | 6 +++--- 8 files changed, 25 insertions(+), 17 deletions(-) rename app/src/main/kotlin/com/g00fy2/developerwidget/{ => activities/apkinstall}/controllers/StorageDirsController.kt (60%) rename app/src/main/kotlin/com/g00fy2/developerwidget/{ => activities/apkinstall}/controllers/StorageDirsControllerImpl.kt (97%) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/DevWidgetApp.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/DevWidgetApp.kt index e9ce024e..e1bd05fe 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/DevWidgetApp.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/DevWidgetApp.kt @@ -10,11 +10,11 @@ import javax.inject.Inject class DevWidgetApp : DaggerApplication() { - override fun applicationInjector(): AndroidInjector = DaggerAppComponent.factory().create(this) - @Inject lateinit var dayNightController: DayNightController + override fun applicationInjector(): AndroidInjector = DaggerAppComponent.factory().create(this) + override fun onCreate() { super.onCreate() diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivityModule.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivityModule.kt index 72ee1cd9..93bfd1a0 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivityModule.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivityModule.kt @@ -1,5 +1,7 @@ package com.g00fy2.developerwidget.activities.apkinstall +import com.g00fy2.developerwidget.activities.apkinstall.controllers.StorageDirsController +import com.g00fy2.developerwidget.activities.apkinstall.controllers.StorageDirsControllerImpl import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.di.ActivityModule import com.g00fy2.developerwidget.di.annotations.ActivityScope @@ -24,4 +26,8 @@ abstract class ApkActivityModule { @Binds @ActivityScope abstract fun provideApkFileBuilder(apkFileBuilder: ApkFile.ApkFileBuilderImpl): ApkFile.ApkFileBuilder + + @Binds + @ActivityScope + abstract fun provideStorageDirsController(storageDirsController: StorageDirsControllerImpl): StorageDirsController } \ No newline at end of file diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt index cf2a5303..0825c6d4 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt @@ -6,10 +6,10 @@ import android.os.Build.VERSION_CODES import androidx.lifecycle.Lifecycle.Event import androidx.lifecycle.OnLifecycleEvent import androidx.lifecycle.lifecycleScope +import com.g00fy2.developerwidget.activities.apkinstall.controllers.StorageDirsController import com.g00fy2.developerwidget.base.BasePresenterImpl import com.g00fy2.developerwidget.controllers.IntentController import com.g00fy2.developerwidget.controllers.PermissionController -import com.g00fy2.developerwidget.controllers.StorageDirsController import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/StorageDirsController.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/controllers/StorageDirsController.kt similarity index 60% rename from app/src/main/kotlin/com/g00fy2/developerwidget/controllers/StorageDirsController.kt rename to app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/controllers/StorageDirsController.kt index c8082414..aa3b1929 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/StorageDirsController.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/controllers/StorageDirsController.kt @@ -1,4 +1,4 @@ -package com.g00fy2.developerwidget.controllers +package com.g00fy2.developerwidget.activities.apkinstall.controllers import java.io.File diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/StorageDirsControllerImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/controllers/StorageDirsControllerImpl.kt similarity index 97% rename from app/src/main/kotlin/com/g00fy2/developerwidget/controllers/StorageDirsControllerImpl.kt rename to app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/controllers/StorageDirsControllerImpl.kt index ad0571dd..05ea8de2 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/StorageDirsControllerImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/controllers/StorageDirsControllerImpl.kt @@ -1,4 +1,4 @@ -package com.g00fy2.developerwidget.controllers +package com.g00fy2.developerwidget.activities.apkinstall.controllers import android.content.Context import android.os.Build.VERSION diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/di/AppComponent.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/di/AppComponent.kt index 2e8781d5..b908c681 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/di/AppComponent.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/di/AppComponent.kt @@ -7,7 +7,14 @@ import dagger.android.AndroidInjector import javax.inject.Singleton @Singleton -@Component(modules = [AndroidInjectionModule::class, AppModule::class, ActivityBindingModule::class, BroadcastBindingModule::class, SingletonControllerModule::class, DeviceDataModule::class]) +@Component( + modules = [AndroidInjectionModule::class, + AppModule::class, + ActivityBindingModule::class, + BroadcastBindingModule::class, + GlobalControllerModule::class, + DeviceDataModule::class] +) interface AppComponent : AndroidInjector { @Component.Factory diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/di/ControllerModule.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/di/ControllerModule.kt index ec318ff2..6b1fd1c6 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/di/ControllerModule.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/di/ControllerModule.kt @@ -6,8 +6,6 @@ import com.g00fy2.developerwidget.controllers.IntentController import com.g00fy2.developerwidget.controllers.IntentControllerImpl import com.g00fy2.developerwidget.controllers.PermissionController import com.g00fy2.developerwidget.controllers.PermissionControllerImpl -import com.g00fy2.developerwidget.controllers.StorageDirsController -import com.g00fy2.developerwidget.controllers.StorageDirsControllerImpl import com.g00fy2.developerwidget.controllers.StringController import com.g00fy2.developerwidget.controllers.StringControllerImpl import com.g00fy2.developerwidget.controllers.ToastController @@ -17,13 +15,14 @@ import com.g00fy2.developerwidget.controllers.WidgetPreferenceControllerImpl import com.g00fy2.developerwidget.di.annotations.ActivityScope import dagger.Binds import dagger.Module +import dagger.Reusable import javax.inject.Singleton @Module -abstract class SingletonControllerModule { +abstract class GlobalControllerModule { @Binds - @Singleton + @Reusable abstract fun providesDayNightController(dayNightControllerImpl: DayNightControllerImpl): DayNightController @Binds @@ -49,8 +48,4 @@ abstract class ActivityControllerModule { @Binds @ActivityScope abstract fun provideStringController(stringControllerImpl: StringControllerImpl): StringController - - @Binds - @ActivityScope - abstract fun provideStorageDirsController(storageDirsControllerImpl: StorageDirsControllerImpl): StorageDirsController } \ No newline at end of file diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/di/DeviceDataModule.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/di/DeviceDataModule.kt index 9118ac95..1dd4cc2f 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/di/DeviceDataModule.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/di/DeviceDataModule.kt @@ -6,16 +6,16 @@ import com.g00fy2.developerwidget.data.WidgetsPreferencesDataSource import com.g00fy2.developerwidget.data.WidgetsPreferencesDataSourceImpl import dagger.Binds import dagger.Module -import javax.inject.Singleton +import dagger.Reusable @Module abstract class DeviceDataModule { @Binds - @Singleton + @Reusable abstract fun providesDeviceDataModule(deviceDataSourceImpl: DeviceDataSourceImpl): DeviceDataSource @Binds - @Singleton + @Reusable abstract fun providesWidgetsPreferencesDataSource(widgetsPreferencesDataSourceImpl: WidgetsPreferencesDataSourceImpl): WidgetsPreferencesDataSource } \ No newline at end of file From 9aeaf1d712315078d2a6a99983c2f5c28028839d Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Tue, 11 Feb 2020 01:02:07 +0100 Subject: [PATCH 024/135] Move unnecessary extension functions --- .../activities/about/AboutActivity.kt | 1 - .../activities/appmanager/AppInfo.kt | 22 ++++++++++++++++ .../activities/appmanager/AppsAdapter.kt | 1 - .../widgetconfig/WidgetConfigActivity.kt | 1 - .../developerwidget/base/BaseActivity.kt | 8 ++++++ .../developerwidget/ktx/ActivityExtension.kt | 13 ---------- .../developerwidget/ktx/AppInfoExtensions.kt | 25 ------------------- 7 files changed, 30 insertions(+), 41 deletions(-) delete mode 100644 app/src/main/kotlin/com/g00fy2/developerwidget/ktx/ActivityExtension.kt delete mode 100644 app/src/main/kotlin/com/g00fy2/developerwidget/ktx/AppInfoExtensions.kt diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt index 8de7d494..31709095 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt @@ -17,7 +17,6 @@ import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.base.BaseContract.BasePresenter import com.g00fy2.developerwidget.databinding.ActivityAboutBinding import com.g00fy2.developerwidget.ktx.doOnApplyWindowInsets -import com.g00fy2.developerwidget.ktx.gesturalNavigationMode import javax.inject.Inject class AboutActivity : BaseActivity(), AboutContract.AboutView { diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppInfo.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppInfo.kt index 9b5e6c76..9492bf25 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppInfo.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppInfo.kt @@ -34,6 +34,28 @@ class AppInfo private constructor() : Comparable { fun build(packageInfo: PackageInfo): AppInfo } + fun filterPackageName(filter: String): Boolean { + var result = false + val filterInputs = filter.split("*") + var tempValue = packageName + for (i in filterInputs) { + if (tempValue.contains(i, true)) { + tempValue = tempValue.substringAfter(i) + result = true + } else { + return false + } + } + return result + } + + fun filterPackageName(filterEntries: Collection): Boolean { + for (i in filterEntries) { + if (filterPackageName(i)) return true + } + return false + } + class AppInfoBuilderImpl @Inject constructor(@Named(ACTIVITY) context: Context) : AppInfoBuilder { private val packageManager = context.packageManager diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt index 12ca4a3f..d1a95e50 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt @@ -11,7 +11,6 @@ import com.g00fy2.developerwidget.activities.appmanager.AppsAdapter.AppViewHolde import com.g00fy2.developerwidget.base.BaseAdapter import com.g00fy2.developerwidget.base.BaseViewHolder import com.g00fy2.developerwidget.databinding.AppItemBinding -import com.g00fy2.developerwidget.ktx.filterPackageName class AppsAdapter : BaseAdapter(AppsDiffUtilsCallback()) { diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt index f957436e..ba9e70a7 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt @@ -36,7 +36,6 @@ import com.g00fy2.developerwidget.base.BaseContract.BasePresenter import com.g00fy2.developerwidget.data.DeviceDataItem import com.g00fy2.developerwidget.databinding.ActivityWidgetConfigBinding import com.g00fy2.developerwidget.ktx.doOnApplyWindowInsets -import com.g00fy2.developerwidget.ktx.gesturalNavigationMode import com.g00fy2.developerwidget.ktx.hideKeyboard import com.g00fy2.developerwidget.ktx.showKeyboard import com.g00fy2.developerwidget.ktx.updateMargin diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt index 111b73b0..041e16f6 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt @@ -64,6 +64,14 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag } } + protected fun gesturalNavigationMode(): Boolean { + return if (VERSION.SDK_INT >= VERSION_CODES.Q) { + window.decorView.rootWindowInsets.systemGestureInsets.left > 0 + } else { + false + } + } + private fun initGestureNavigation() { if (VERSION.SDK_INT >= VERSION_CODES.O_MR1) { window.decorView.let { diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/ActivityExtension.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/ActivityExtension.kt deleted file mode 100644 index de3ba401..00000000 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/ActivityExtension.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.g00fy2.developerwidget.ktx - -import android.app.Activity -import android.os.Build.VERSION -import android.os.Build.VERSION_CODES - -fun Activity.gesturalNavigationMode(): Boolean { - return if (VERSION.SDK_INT >= VERSION_CODES.Q) { - window.decorView.rootWindowInsets.systemGestureInsets.left > 0 - } else { - false - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/AppInfoExtensions.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/AppInfoExtensions.kt deleted file mode 100644 index 64861d5a..00000000 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/AppInfoExtensions.kt +++ /dev/null @@ -1,25 +0,0 @@ -package com.g00fy2.developerwidget.ktx - -import com.g00fy2.developerwidget.activities.appmanager.AppInfo - -fun AppInfo.filterPackageName(filter: String): Boolean { - var result = false - val filterInputs = filter.split("*") - var tempValue = packageName - for (i in filterInputs) { - if (tempValue.contains(i, true)) { - tempValue = tempValue.substringAfter(i) - result = true - } else { - return false - } - } - return result -} - -fun AppInfo.filterPackageName(filterEntries: Collection): Boolean { - for (i in filterEntries) { - if (filterPackageName(i)) return true - } - return false -} \ No newline at end of file From 38020dffc0870ee626232399c7afb36c88ddb608 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 12 Feb 2020 19:36:03 +0100 Subject: [PATCH 025/135] Update gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 642af1b4..a590308d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-rc-1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-rc-2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From a105aed8990e29af9158bff37f17a2316fb4be75 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 12 Feb 2020 19:36:29 +0100 Subject: [PATCH 026/135] Add parent tag to mergeable layouts --- app/src/main/res/layout/about_item.xml | 1 + app/src/main/res/layout/about_item_header.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/src/main/res/layout/about_item.xml b/app/src/main/res/layout/about_item.xml index 8ed5c495..9e7a6b96 100644 --- a/app/src/main/res/layout/about_item.xml +++ b/app/src/main/res/layout/about_item.xml @@ -4,6 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="72dp" + tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout" > Date: Thu, 13 Feb 2020 10:15:36 +0100 Subject: [PATCH 027/135] Update gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew.bat | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a590308d..4ad98b8c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-rc-2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-rc-3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew.bat b/gradlew.bat index 9618d8d9..62bd9b9c 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" From 26c3d1a897e4f52ec0ce1965b852ab3533bd227d Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Mon, 17 Feb 2020 21:02:30 +0100 Subject: [PATCH 028/135] Update gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4ad98b8c..84226702 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-rc-3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 9c1678d23dc155127a5f61c87833cd3023e6e141 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 19 Feb 2020 15:52:41 +0100 Subject: [PATCH 029/135] Remove javax.annotation-api dependency --- app/build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c63d00d0..c1b21f63 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -92,5 +92,4 @@ dependencies { implementation("com.google.dagger:dagger-android:2.26") implementation("com.google.dagger:dagger-android-support:2.26") kapt("com.google.dagger:dagger-android-processor:2.26") - compileOnly("javax.annotation:javax.annotation-api:1.3.2") } \ No newline at end of file From 650d2880c9d869664d7edc50b46a892461da3b67 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 19 Feb 2020 22:31:24 +0100 Subject: [PATCH 030/135] Fix overscroll in shortcut activity by adding window insets to root view --- .../activities/shortcut/CreateShortcutActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt index 7aa08ea5..e5a98a2e 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt @@ -64,7 +64,7 @@ class CreateShortcutActivity : BaseActivity(), CreateShortcutContract.CreateShor adapter.submitList(shortcutInfoList) adapter.setOnShortcutSelected { shortcutPosition -> onItemClick(shortcutPosition) } if (VERSION.SDK_INT >= VERSION_CODES.O_MR1) { - binding.recyclerview.doOnApplyWindowInsets { view, insets, padding, _ -> + binding.root.doOnApplyWindowInsets { view, insets, padding, _ -> view.updatePadding(bottom = padding.bottom + insets.systemWindowInsetBottom) } } From c5245827b9315b96ae3b3cac778c851c1e6d5856 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 20 Feb 2020 23:58:11 +0100 Subject: [PATCH 031/135] Optimize coroutines usage --- .../developerwidget/activities/apkinstall/ApkPresenterImpl.kt | 4 ++-- .../activities/widgetconfig/WidgetConfigPresenterImpl.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt index 0825c6d4..7e8e6d00 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt @@ -43,9 +43,9 @@ class ApkPresenterImpl @Inject constructor() : BasePresenterImpl(), ApkContract. for (dir in storageDirsController.getStorageDirectories()) { addAll(searchAPKs(dir)) } - } + }.sorted() }.let { - view.toggleResultView(it.sorted(), false) + view.toggleResultView(it, false) } } } else { diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigPresenterImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigPresenterImpl.kt index 4f5e4050..7cb05e46 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigPresenterImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigPresenterImpl.kt @@ -102,8 +102,8 @@ class WidgetConfigPresenterImpl @Inject constructor() : BasePresenterImpl(), override fun shareDeviceData() { view.lifecycleScope.launch { withContext(Dispatchers.IO) { - getDeviceData() - }.let { intentController.shareDeviceData(formatDeviceDataString(it)) } + formatDeviceDataString(getDeviceData()) + }.let { intentController.shareDeviceData(it) } } } From 81114fdae9da1f6ee18e4285b107a4391935a8d5 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 20 Feb 2020 23:58:21 +0100 Subject: [PATCH 032/135] Update kotlin eap --- app/build.gradle.kts | 2 +- settings.gradle.kts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c1b21f63..a06c2f8a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -67,7 +67,7 @@ repositories { } dependencies { // Kotlin - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.70-eap-184") + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.70-eap-274") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3") // AndroidX diff --git a/settings.gradle.kts b/settings.gradle.kts index c5ed7206..9b655157 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -19,7 +19,7 @@ pluginManagement { useModule("eu.appcom.gradle:android-versioning:1.0.2") } if (requested.id.namespace == "org.jetbrains.kotlin") { - useVersion("1.3.70-eap-184") + useVersion("1.3.70-eap-274") } } } From 1f76040e0a257bf4eb104a042307af16a3418693 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 21 Feb 2020 16:18:27 +0100 Subject: [PATCH 033/135] Update material design components --- app/build.gradle.kts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a06c2f8a..3d2b32d6 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -70,7 +70,7 @@ dependencies { implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.70-eap-274") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3") -// AndroidX + // AndroidX implementation("androidx.appcompat:appcompat:1.2.0-alpha02") implementation("androidx.core:core-ktx:1.3.0-alpha01") implementation("androidx.activity:activity:1.1.0") @@ -79,14 +79,14 @@ dependencies { implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta4") implementation("androidx.vectordrawable:vectordrawable:1.1.0") -// UI - implementation("com.google.android.material:material:1.2.0-alpha04") + // UI + implementation("com.google.android.material:material:1.2.0-alpha05") -// Misc + // Misc implementation("com.jakewharton.timber:timber:4.7.1") implementation("com.g00fy2:versioncompare:1.3.4") -// Dagger + // Dagger implementation("com.google.dagger:dagger:2.26") kapt("com.google.dagger:dagger-compiler:2.26") implementation("com.google.dagger:dagger-android:2.26") From 4dfab9925ef1e854ee2f04c8d8a4d751bb2fe8cd Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 21 Feb 2020 16:22:37 +0100 Subject: [PATCH 034/135] Fix night mode detection and force transparent navigation bar when gestural navigation is active --- .../widgetconfig/WidgetConfigActivity.kt | 2 +- .../developerwidget/base/BaseActivity.kt | 22 ++++++++++++++----- .../{ScopeNames.kt => DaggerConstants.kt} | 0 3 files changed, 18 insertions(+), 6 deletions(-) rename app/src/main/kotlin/com/g00fy2/developerwidget/di/annotations/{ScopeNames.kt => DaggerConstants.kt} (100%) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt index ba9e70a7..1e799597 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt @@ -94,7 +94,7 @@ class WidgetConfigActivity : BaseActivity(), WidgetConfigContract.WidgetConfigVi } else { binding.shareFab.show() } - if (VERSION.SDK_INT >= VERSION_CODES.O_MR1 && !gesturalNavigationMode()) { + if (VERSION.SDK_INT >= VERSION_CODES.O_MR1 && !isGesturalNavMode()) { clipToPadding = (scrollY >= scrollableRange) } } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt index 041e16f6..f9829c76 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt @@ -7,8 +7,10 @@ import android.os.Bundle import android.view.View import android.view.ViewGroup import android.view.Window +import androidx.annotation.RequiresApi import androidx.core.view.updatePadding import androidx.viewbinding.ViewBinding +import com.g00fy2.developerwidget.R import com.g00fy2.developerwidget.controllers.DayNightController import com.g00fy2.developerwidget.ktx.doOnApplyWindowInsets import dagger.android.support.DaggerAppCompatActivity @@ -49,6 +51,17 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag lifecycle.removeObserver(providePresenter()) } + @RequiresApi(VERSION_CODES.Q) + override fun onAttachedToWindow() { + super.onAttachedToWindow() + if (gesturalNavigationMode()) { + getColor(R.color.transparent).let { + window.navigationBarColor = it + window.navigationBarDividerColor = it + } + } + } + protected fun setActionbarElevationListener(viewGroup: ViewGroup) { supportActionBar?.elevation = 0f viewGroup.viewTreeObserver.addOnScrollChangedListener { @@ -66,7 +79,7 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag protected fun gesturalNavigationMode(): Boolean { return if (VERSION.SDK_INT >= VERSION_CODES.Q) { - window.decorView.rootWindowInsets.systemGestureInsets.left > 0 + window.decorView.rootWindowInsets?.systemGestureInsets?.let { it.left > 0 } ?: false } else { false } @@ -90,7 +103,7 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag private fun initCompatNavigationBar() { // api 27+ allow applying flag via xml (windowLightNavigationBar) - if (VERSION.SDK_INT == VERSION_CODES.O && isInNightMode()) { + if (VERSION.SDK_INT == VERSION_CODES.O && !isNightMode()) { window.decorView.let { it.systemUiVisibility.let { flags -> it.systemUiVisibility = flags or View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR @@ -99,9 +112,8 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag } } - // TODO move back to controller if https://issuetracker.google.com/issues/134379747 should get fixed - private fun isInNightMode() = - resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_NO + private fun isNightMode() = + resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES abstract fun providePresenter(): BaseContract.BasePresenter diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/di/annotations/ScopeNames.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/di/annotations/DaggerConstants.kt similarity index 100% rename from app/src/main/kotlin/com/g00fy2/developerwidget/di/annotations/ScopeNames.kt rename to app/src/main/kotlin/com/g00fy2/developerwidget/di/annotations/DaggerConstants.kt From 8d71a6d0686de9ac70e2eeb70ba2a857d9e950b9 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 21 Feb 2020 17:55:58 +0100 Subject: [PATCH 035/135] Fix gestural nav method naming --- .../g00fy2/developerwidget/activities/about/AboutActivity.kt | 2 +- .../kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt index 31709095..a3708713 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt @@ -114,7 +114,7 @@ class AboutActivity : BaseActivity(), AboutContract.AboutView { } viewTreeObserver.addOnScrollChangedListener { val scrollableRange = getChildAt(0).bottom - height + paddingBottom - if (!gesturalNavigationMode()) { + if (!isGesturalNavMode()) { clipToPadding = (scrollY >= scrollableRange) } } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt index f9829c76..eb755208 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt @@ -54,7 +54,7 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag @RequiresApi(VERSION_CODES.Q) override fun onAttachedToWindow() { super.onAttachedToWindow() - if (gesturalNavigationMode()) { + if (isGesturalNavMode()) { getColor(R.color.transparent).let { window.navigationBarColor = it window.navigationBarDividerColor = it @@ -77,7 +77,7 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag } } - protected fun gesturalNavigationMode(): Boolean { + protected fun isGesturalNavMode(): Boolean { return if (VERSION.SDK_INT >= VERSION_CODES.Q) { window.decorView.rootWindowInsets?.systemGestureInsets?.let { it.left > 0 } ?: false } else { From 78163f87a2d126400c69ec2c9c0a3b9867e0a800 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Mon, 24 Feb 2020 11:09:25 +0100 Subject: [PATCH 036/135] Use lazy delegate to set up view binding --- .../activities/about/AboutActivity.kt | 8 +------- .../activities/apkinstall/ApkActivity.kt | 8 +------- .../activities/appmanager/AppsActivity.kt | 8 +------- .../activities/shortcut/CreateShortcutActivity.kt | 9 ++------- .../activities/widgetconfig/WidgetConfigActivity.kt | 8 +------- .../com/g00fy2/developerwidget/base/BaseActivity.kt | 12 +++++++----- 6 files changed, 13 insertions(+), 40 deletions(-) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt index a3708713..e3f540f8 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt @@ -8,7 +8,6 @@ import android.os.Build.VERSION_CODES import android.view.MenuItem import androidx.appcompat.app.AppCompatDelegate import androidx.core.view.updatePadding -import androidx.viewbinding.ViewBinding import com.g00fy2.developerwidget.BuildConfig import com.g00fy2.developerwidget.R import com.g00fy2.developerwidget.activities.about.dialogs.AboutFeedbackDialog @@ -23,15 +22,10 @@ class AboutActivity : BaseActivity(), AboutContract.AboutView { @Inject lateinit var presenter: AboutContract.AboutPresenter - private lateinit var binding: ActivityAboutBinding + override val binding: ActivityAboutBinding by viewBinding(ActivityAboutBinding::inflate) override fun providePresenter(): BasePresenter = presenter - override fun setViewBinding(): ViewBinding { - binding = ActivityAboutBinding.inflate(layoutInflater) - return binding - } - override fun initView() { supportActionBar?.setDisplayHomeAsUpEnabled(true) setActionbarElevationListener(binding.aboutRootScrollview) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt index 10dec760..f5bd762f 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt @@ -4,7 +4,6 @@ import android.view.View import androidx.appcompat.widget.TooltipCompat import androidx.core.view.ViewCompat import androidx.recyclerview.widget.LinearLayoutManager -import androidx.viewbinding.ViewBinding import com.g00fy2.developerwidget.R import com.g00fy2.developerwidget.activities.apkinstall.dialogs.ApkDeleteDialog import com.g00fy2.developerwidget.activities.apkinstall.dialogs.ApkWarningDialog @@ -18,16 +17,11 @@ class ApkActivity : BaseActivity(true), ApkContract.ApkView { @Inject lateinit var presenter: ApkContract.ApkPresenter + override val binding: ActivityApkBinding by viewBinding(ActivityApkBinding::inflate) private lateinit var adapter: ApkAdapter - private lateinit var binding: ActivityApkBinding override fun providePresenter(): BasePresenter = presenter - override fun setViewBinding(): ViewBinding { - binding = ActivityApkBinding.inflate(layoutInflater) - return binding - } - override fun initView() { adapter = ApkAdapter() adapter.setOnApkClicked { apkFile -> presenter.installOrShowPermissionWarning(apkFile) } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsActivity.kt index 4bceadf7..9d97a6e5 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsActivity.kt @@ -21,7 +21,6 @@ import androidx.core.widget.doAfterTextChanged import androidx.interpolator.view.animation.FastOutLinearInInterpolator import androidx.interpolator.view.animation.LinearOutSlowInInterpolator import androidx.recyclerview.widget.LinearLayoutManager -import androidx.viewbinding.ViewBinding import com.g00fy2.developerwidget.R import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.base.BaseContract.BasePresenter @@ -36,19 +35,14 @@ class AppsActivity : BaseActivity(true), AppsContract.AppsView { @Inject lateinit var presenter: AppsContract.AppsPresenter - private lateinit var binding: ActivityAppsBinding + override val binding: ActivityAppsBinding by viewBinding(ActivityAppsBinding::inflate) private lateinit var adapter: AppsAdapter private var scrollToTopAfterCommit = false private val clearDrawable by lazy { initClearDrawable() } override fun providePresenter(): BasePresenter = presenter - override fun setViewBinding(): ViewBinding { - binding = ActivityAppsBinding.inflate(layoutInflater) - return binding - } - override fun initView() { adapter = AppsAdapter() adapter.setOnAppClicked { appInfo -> presenter.openAppSettingsActivity(appInfo) } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt index e5a98a2e..c7a37ba7 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt @@ -19,7 +19,6 @@ import androidx.core.graphics.drawable.toBitmap import androidx.core.view.updatePadding import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager -import androidx.viewbinding.ViewBinding import com.g00fy2.developerwidget.R import com.g00fy2.developerwidget.activities.apkinstall.ApkActivity import com.g00fy2.developerwidget.activities.appmanager.AppsActivity @@ -34,17 +33,13 @@ class CreateShortcutActivity : BaseActivity(), CreateShortcutContract.CreateShor @Inject lateinit var presenter: CreateShortcutContract.CreateShortcutPresenter - private lateinit var binding: ActivityCreateShortcutBinding + + override val binding: ActivityCreateShortcutBinding by viewBinding(ActivityCreateShortcutBinding::inflate) private lateinit var adapter: ShortcutAdapter private lateinit var shortcutInfoList: List override fun providePresenter(): BasePresenter = presenter - override fun setViewBinding(): ViewBinding { - binding = ActivityCreateShortcutBinding.inflate(layoutInflater) - return binding - } - override fun initView() { setResult(Activity.RESULT_CANCELED) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt index 1e799597..f5211a57 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt @@ -28,7 +28,6 @@ import androidx.core.content.getSystemService import androidx.core.content.res.ResourcesCompat import androidx.core.view.updatePadding import androidx.recyclerview.widget.LinearLayoutManager -import androidx.viewbinding.ViewBinding import com.g00fy2.developerwidget.R import com.g00fy2.developerwidget.activities.about.AboutActivity import com.g00fy2.developerwidget.base.BaseActivity @@ -47,7 +46,7 @@ class WidgetConfigActivity : BaseActivity(), WidgetConfigContract.WidgetConfigVi @Inject lateinit var presenter: WidgetConfigContract.WidgetConfigPresenter - private lateinit var binding: ActivityWidgetConfigBinding + override val binding: ActivityWidgetConfigBinding by viewBinding(ActivityWidgetConfigBinding::inflate) private lateinit var adapter: DeviceDataAdapter private var updateExistingWidget = false private var launchedFromAppLauncher = true @@ -65,11 +64,6 @@ class WidgetConfigActivity : BaseActivity(), WidgetConfigContract.WidgetConfigVi override fun providePresenter(): BasePresenter = presenter - override fun setViewBinding(): ViewBinding { - binding = ActivityWidgetConfigBinding.inflate(layoutInflater) - return binding - } - override fun initView() { setResult(Activity.RESULT_CANCELED) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt index eb755208..25c29765 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt @@ -4,6 +4,7 @@ import android.content.res.Configuration import android.os.Build.VERSION import android.os.Build.VERSION_CODES import android.os.Bundle +import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.view.Window @@ -21,21 +22,21 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag @Inject lateinit var dayNightController: DayNightController - + protected abstract val binding: ViewBinding override fun onCreate(savedInstanceState: Bundle?) { Timber.d("Lifecycle: %s1 onCreate %s2", localClassName, hashCode()) if (isDialogActivity) { requestWindowFeature(Window.FEATURE_NO_TITLE) super.onCreate(savedInstanceState) - setContentView(setViewBinding().root) + setContentView(binding.root) val width = (resources.displayMetrics.widthPixels * 0.95).toInt() val height = (resources.displayMetrics.heightPixels * 0.80).toInt() window.setLayout(width, height) } else { super.onCreate(savedInstanceState) - setContentView(setViewBinding().root) + setContentView(binding.root) } dayNightController.loadCustomDefaultMode() @@ -51,6 +52,9 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag lifecycle.removeObserver(providePresenter()) } + inline fun DaggerAppCompatActivity.viewBinding(crossinline bindingInflater: (LayoutInflater) -> T) = + lazy(LazyThreadSafetyMode.NONE) { bindingInflater.invoke(layoutInflater) } + @RequiresApi(VERSION_CODES.Q) override fun onAttachedToWindow() { super.onAttachedToWindow() @@ -117,7 +121,5 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag abstract fun providePresenter(): BaseContract.BasePresenter - abstract fun setViewBinding(): ViewBinding - abstract fun initView() } \ No newline at end of file From 52671f527dd167ac69e9ad1cac18444da2e5613f Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Mon, 24 Feb 2020 11:25:09 +0100 Subject: [PATCH 037/135] Reformat files --- .../developerwidget/activities/apkinstall/ApkAdapter.kt | 3 ++- .../developerwidget/activities/appmanager/AppsAdapter.kt | 3 ++- .../activities/appmanager/AppsPresenterImpl.kt | 5 ++++- .../kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt | 2 ++ .../kotlin/com/g00fy2/developerwidget/ktx/ViewExtension.kt | 6 +++--- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkAdapter.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkAdapter.kt index 8059ba29..b5f1b9f6 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkAdapter.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkAdapter.kt @@ -31,7 +31,8 @@ class ApkAdapter : BaseAdapter(ApksDiffUtilsCallback()) binding.fileDateTextview.text = item.lastModified binding.appIconImageview.setImageDrawable(item.appIcon) if (VERSION.SDK_INT >= VERSION_CODES.O) { - binding.appIconImageview.setBackgroundResource(if (item.appIcon is InsetDrawable) R.drawable.bg_adaptive_launcher_icon else 0) + binding.appIconImageview + .setBackgroundResource(if (item.appIcon is InsetDrawable) R.drawable.bg_adaptive_launcher_icon else 0) } } setSelected(adapterPosition) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt index d1a95e50..c7627bec 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt @@ -26,7 +26,8 @@ class AppsAdapter : BaseAdapter(AppsDiffUtilsCallback()) String.format(itemView.context.getString(R.string.apk_version), versionName, versionCode) binding.appIconImageview.setImageDrawable(appIcon) if (VERSION.SDK_INT >= VERSION_CODES.O) { - binding.appIconImageview.setBackgroundResource(if (appIcon is InsetDrawable) R.drawable.bg_adaptive_launcher_icon else 0) + binding.appIconImageview + .setBackgroundResource(if (appIcon is InsetDrawable) R.drawable.bg_adaptive_launcher_icon else 0) } } } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsPresenterImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsPresenterImpl.kt index ceff7583..43c8f5b1 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsPresenterImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsPresenterImpl.kt @@ -83,7 +83,10 @@ class AppsPresenterImpl @Inject constructor() : BasePresenterImpl(), AppsContrac private fun getInstalledUserApps(): List { return appInfoBuilder.getInstalledPackages() - .filter { it.applicationInfo.flags.let { flags -> flags and ApplicationInfo.FLAG_SYSTEM == 0 || flags and ApplicationInfo.FLAG_UPDATED_SYSTEM_APP != 0 } } + .filter { + it.applicationInfo.flags + .let { flags -> flags and ApplicationInfo.FLAG_SYSTEM == 0 || flags and ApplicationInfo.FLAG_UPDATED_SYSTEM_APP != 0 } + } .map { appInfoBuilder.build(it) } .sorted() .toList() diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt index 25c29765..13663f20 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt @@ -22,7 +22,9 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag @Inject lateinit var dayNightController: DayNightController + protected abstract val binding: ViewBinding + override fun onCreate(savedInstanceState: Bundle?) { Timber.d("Lifecycle: %s1 onCreate %s2", localClassName, hashCode()) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/ViewExtension.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/ViewExtension.kt index b49dcb11..2af9f3da 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/ViewExtension.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/ViewExtension.kt @@ -16,9 +16,9 @@ import androidx.core.view.marginTop fun View.addRipple(asForeground: Boolean = false) { TypedValue().apply { context.theme.resolveAttribute(android.R.attr.selectableItemBackground, this, true) } .resourceId.let { - if (VERSION.SDK_INT < VERSION_CODES.M || !asForeground) setBackgroundResource(it) else foreground = - context.getDrawable(it) - } + if (VERSION.SDK_INT < VERSION_CODES.M || !asForeground) setBackgroundResource(it) else foreground = + context.getDrawable(it) + } } fun View.updateMargin( From 30aee1d16743316fc2f40c1dc56f2ae2b07ff25c Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Mon, 24 Feb 2020 19:37:05 +0100 Subject: [PATCH 038/135] Use objects for data provider classes --- .../data/device/cpu/CPUDataProvider.kt | 89 ++++++++--------- .../device/devicebuild/BuildDataProvider.kt | 37 ++++--- .../device/display/DisplayDataProvider.kt | 97 +++++++++---------- .../HardwareFeatureProvider.kt | 29 +++--- .../data/device/ram/RamDataProvider.kt | 57 ++++++----- .../data/device/system/SystemDataProvider.kt | 61 ++++++------ .../systemapps/SystemAppsDataProvider.kt | 65 ++++++------- 7 files changed, 207 insertions(+), 228 deletions(-) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/cpu/CPUDataProvider.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/cpu/CPUDataProvider.kt index 01319fbd..95b4e37a 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/cpu/CPUDataProvider.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/cpu/CPUDataProvider.kt @@ -9,60 +9,57 @@ import java.io.RandomAccessFile import java.util.regex.Pattern import kotlin.math.max -class CPUDataProvider { +object CPUDataProvider { - companion object { + private const val CPU_SYS_FOLDER = "/sys/devices/system/cpu/" + private val CPU_PATTERN = Pattern.compile("cpu[0-9]+") - private const val CPU_SYS_FOLDER = "/sys/devices/system/cpu/" - private val CPU_PATTERN = Pattern.compile("cpu[0-9]+") - - fun getPrimaryABI(): String { - return if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { - Build.SUPPORTED_ABIS.firstOrNull() ?: "" - } else { - @Suppress("DEPRECATION") - Build.CPU_ABI - } - } - - fun getCPUCoreNum(): Int { - return max( - File(CPU_SYS_FOLDER) - .walk() - .maxDepth(1) - .count { CPU_PATTERN.matcher(it.name).matches() }, - Runtime.getRuntime().availableProcessors() - ) + fun getPrimaryABI(): String { + return if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { + Build.SUPPORTED_ABIS.firstOrNull() ?: "" + } else { + @Suppress("DEPRECATION") + Build.CPU_ABI } + } - fun getGroupedCPUCoreFrequencies(): String { - val frequencies = mutableListOf>() - val cores = getCPUCoreNum() - for (i in 0 until cores) { - getCPUFrequenciesPerCore(i)?.let { frequencies.add(it) } - } + fun getCPUCoreNum(): Int { + return max( + File(CPU_SYS_FOLDER) + .walk() + .maxDepth(1) + .count { CPU_PATTERN.matcher(it.name).matches() }, + Runtime.getRuntime().availableProcessors() + ) + } - return frequencies.sortedByDescending { it.second } - .groupingBy { it.second.toString() + "MHz - " + it.first + "MHz" } - .eachCount() - .map { it.value.toString() + " x " + it.key } - .plus(if (frequencies.size < cores) (cores - frequencies.size).toString() + " x offline" else "") - .filter { it.isNotEmpty() } - .joinToString(separator = "\n") + fun getGroupedCPUCoreFrequencies(): String { + val frequencies = mutableListOf>() + val cores = getCPUCoreNum() + for (i in 0 until cores) { + getCPUFrequenciesPerCore(i)?.let { frequencies.add(it) } } - private fun getCPUFrequenciesPerCore(core: Int): Pair? { - return try { - val max = RandomAccessFile(CPU_SYS_FOLDER + "cpu$core/cpufreq/cpuinfo_max_freq", "r").use { reader -> - (reader.readLine().toLong() / 1000).toInt() - } - val min = RandomAccessFile(CPU_SYS_FOLDER + "cpu$core/cpufreq/cpuinfo_min_freq", "r").use { reader -> - (reader.readLine().toLong() / 1000).toInt() - } - Pair(min, max) - } catch (e: FileNotFoundException) { - null + return frequencies.sortedByDescending { it.second } + .groupingBy { it.second.toString() + "MHz - " + it.first + "MHz" } + .eachCount() + .map { it.value.toString() + " x " + it.key } + .plus(if (frequencies.size < cores) (cores - frequencies.size).toString() + " x offline" else "") + .filter { it.isNotEmpty() } + .joinToString(separator = "\n") + } + + private fun getCPUFrequenciesPerCore(core: Int): Pair? { + return try { + val max = RandomAccessFile(CPU_SYS_FOLDER + "cpu$core/cpufreq/cpuinfo_max_freq", "r").use { reader -> + (reader.readLine().toLong() / 1000).toInt() + } + val min = RandomAccessFile(CPU_SYS_FOLDER + "cpu$core/cpufreq/cpuinfo_min_freq", "r").use { reader -> + (reader.readLine().toLong() / 1000).toInt() } + Pair(min, max) + } catch (e: FileNotFoundException) { + null } } } \ No newline at end of file diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/devicebuild/BuildDataProvider.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/devicebuild/BuildDataProvider.kt index 379bc0d6..447927b2 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/devicebuild/BuildDataProvider.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/devicebuild/BuildDataProvider.kt @@ -3,33 +3,30 @@ package com.g00fy2.developerwidget.data.device.devicebuild import android.annotation.SuppressLint import android.os.Build -class BuildDataProvider { - - companion object { - - @SuppressLint("DefaultLocale") - fun getCombinedDeviceName(): String { - return if (Build.MODEL.contains(Build.MANUFACTURER, true)) { - Build.MODEL.capitalize() - } else { - Build.MANUFACTURER.capitalize() + " " + Build.MODEL.capitalize() - } +object BuildDataProvider { + + @SuppressLint("DefaultLocale") + fun getCombinedDeviceName(): String { + return if (Build.MODEL.contains(Build.MANUFACTURER, true)) { + Build.MODEL.capitalize() + } else { + Build.MANUFACTURER.capitalize() + " " + Build.MODEL.capitalize() } + } - fun getBoard(): String = Build.BOARD + fun getBoard(): String = Build.BOARD - fun getDevice(): String = Build.DEVICE + fun getDevice(): String = Build.DEVICE - fun getHardware(): String = Build.HARDWARE + fun getHardware(): String = Build.HARDWARE - fun getProduct(): String = Build.PRODUCT + fun getProduct(): String = Build.PRODUCT - fun getModel(): String = Build.MODEL + fun getModel(): String = Build.MODEL - fun getManufacture(): String = Build.MANUFACTURER + fun getManufacture(): String = Build.MANUFACTURER - fun getBootloader(): String = Build.BOOTLOADER + fun getBootloader(): String = Build.BOOTLOADER - fun getID(): String = Build.ID - } + fun getID(): String = Build.ID } \ No newline at end of file diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/display/DisplayDataProvider.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/display/DisplayDataProvider.kt index 5223e3f0..c2469d0a 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/display/DisplayDataProvider.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/display/DisplayDataProvider.kt @@ -9,69 +9,66 @@ import androidx.core.content.getSystemService import java.text.NumberFormat import kotlin.math.roundToInt -class DisplayDataProvider { +object DisplayDataProvider { - companion object { - - @SuppressLint("NewApi") - fun getResolution(context: Context): Point? { - context.getSystemService()?.defaultDisplay?.let { windowManager -> - Point().let { point -> - try { - windowManager.getRealSize(point) - } catch (e: NoSuchMethodError) { - windowManager.getSize(point) - } - return point + @SuppressLint("NewApi") + fun getResolution(context: Context): Point? { + context.getSystemService()?.defaultDisplay?.let { windowManager -> + Point().let { point -> + try { + windowManager.getRealSize(point) + } catch (e: NoSuchMethodError) { + windowManager.getSize(point) } + return point } - return null } + return null + } - @SuppressLint("NewApi") - fun geDisplayDpi(context: Context): String { - context.getSystemService()?.defaultDisplay?.let { windowManager -> - DisplayMetrics().let { displayMetrics -> - try { - windowManager.getRealMetrics(displayMetrics) - } catch (e: NoSuchMethodError) { - windowManager.getMetrics(displayMetrics) - } - return displayMetrics.xdpi.roundToInt().toString() + " / " + displayMetrics.ydpi.roundToInt() + " dpi" + @SuppressLint("NewApi") + fun geDisplayDpi(context: Context): String { + context.getSystemService()?.defaultDisplay?.let { windowManager -> + DisplayMetrics().let { displayMetrics -> + try { + windowManager.getRealMetrics(displayMetrics) + } catch (e: NoSuchMethodError) { + windowManager.getMetrics(displayMetrics) } + return displayMetrics.xdpi.roundToInt().toString() + " / " + displayMetrics.ydpi.roundToInt() + " dpi" } - return "" } + return "" + } - fun getDisplayRatio(resolution: Point): String { - if (resolution.x > resolution.y) { - val temp = resolution.x - resolution.x = resolution.y - resolution.y = temp - } - val gcd = gcd(resolution.x, resolution.y) + fun getDisplayRatio(resolution: Point): String { + if (resolution.x > resolution.y) { + val temp = resolution.x + resolution.x = resolution.y + resolution.y = temp + } + val gcd = gcd(resolution.x, resolution.y) - val result = if (resolution.y / gcd == 8) { - (resolution.y / gcd * 2).toString() + ":" + (resolution.x / gcd * 2) - } else { - (resolution.y / gcd).toString() + ":" + (resolution.x / gcd) - } + val result = if (resolution.y / gcd == 8) { + (resolution.y / gcd * 2).toString() + ":" + (resolution.x / gcd * 2) + } else { + (resolution.y / gcd).toString() + ":" + (resolution.x / gcd) + } - val altResult = - if ((resolution.x / gcd) > 9 && ((resolution.y / gcd / 2.0f) % 1.0f) == 0.5f && ((resolution.x / gcd / 2.0f) % 1.0f) == 0.0f) { - NumberFormat.getInstance().let { - it.format((resolution.y / gcd / 2.0f)).toString() + ":" + it.format((resolution.x / gcd / 2.0f)) - } - } else { - "" + val altResult = + if ((resolution.x / gcd) > 9 && ((resolution.y / gcd / 2.0f) % 1.0f) == 0.5f && ((resolution.x / gcd / 2.0f) % 1.0f) == 0.0f) { + NumberFormat.getInstance().let { + it.format((resolution.y / gcd / 2.0f)).toString() + ":" + it.format((resolution.x / gcd / 2.0f)) } + } else { + "" + } - return result + if (altResult.isBlank()) "" else " ($altResult)" - } + return result + if (altResult.isBlank()) "" else " ($altResult)" + } - private fun gcd(p: Int, q: Int): Int { - return if (q == 0) p - else gcd(q, p % q) - } + private fun gcd(p: Int, q: Int): Int { + return if (q == 0) p + else gcd(q, p % q) } } \ No newline at end of file diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/hardwarefeature/HardwareFeatureProvider.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/hardwarefeature/HardwareFeatureProvider.kt index 55f9dd0d..e0be2229 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/hardwarefeature/HardwareFeatureProvider.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/hardwarefeature/HardwareFeatureProvider.kt @@ -9,25 +9,22 @@ import android.os.Build.VERSION import android.os.Build.VERSION_CODES import androidx.core.content.getSystemService -class HardwareFeatureProvider { +object HardwareFeatureProvider { - companion object { + fun hasNFC(context: Context): Boolean = + context.getSystemService()?.defaultAdapter?.let { true } ?: false - fun hasNFC(context: Context): Boolean = - context.getSystemService()?.defaultAdapter?.let { true } ?: false - - fun hasGPS(context: Context): Boolean { - return context.getSystemService()?.allProviders?.contains( - LocationManager.GPS_PROVIDER - ) ?: false - } + fun hasGPS(context: Context): Boolean { + return context.getSystemService()?.allProviders?.contains( + LocationManager.GPS_PROVIDER + ) ?: false + } - fun hasBluetooth(context: Context): Boolean { - return if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR2) { - context.getSystemService()?.adapter?.let { true } ?: false - } else { - BluetoothAdapter.getDefaultAdapter()?.let { true } ?: false - } + fun hasBluetooth(context: Context): Boolean { + return if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR2) { + context.getSystemService()?.adapter?.let { true } ?: false + } else { + BluetoothAdapter.getDefaultAdapter()?.let { true } ?: false } } } \ No newline at end of file diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/ram/RamDataProvider.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/ram/RamDataProvider.kt index c3879bae..ae32a091 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/ram/RamDataProvider.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/ram/RamDataProvider.kt @@ -10,43 +10,40 @@ import java.io.RandomAccessFile import java.util.regex.Pattern import kotlin.math.roundToLong -class RamDataProvider { +object RamDataProvider { - companion object { - - fun getTotalRam(context: Context): String { - var ramSize = 0L - if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) { - context.getSystemService()?.let { - ActivityManager.MemoryInfo().let { info -> - it.getMemoryInfo(info) - ramSize = info.totalMem - } + fun getTotalRam(context: Context): String { + var ramSize = 0L + if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) { + context.getSystemService()?.let { + ActivityManager.MemoryInfo().let { info -> + it.getMemoryInfo(info) + ramSize = info.totalMem } - } else { - try { - RandomAccessFile("/proc/meminfo", "r").use { - val matcher = Pattern.compile("(\\d+)").matcher(it.readLine()) - var memTotal: String? = null - while (matcher.find()) memTotal = matcher.group(1) - memTotal?.let { stringValue -> - ramSize = stringValue.toLong() - return@use - } + } + } else { + try { + RandomAccessFile("/proc/meminfo", "r").use { + val matcher = Pattern.compile("(\\d+)").matcher(it.readLine()) + var memTotal: String? = null + while (matcher.find()) memTotal = matcher.group(1) + memTotal?.let { stringValue -> + ramSize = stringValue.toLong() + return@use } - } catch (e: IOException) { - // ignore and keep ramSize 0 } + } catch (e: IOException) { + // ignore and keep ramSize 0 } - return if (ramSize > 0) (2 * ((ramSize / (1024.0 * 1024.0) / 2).roundToLong())).toString() + " MB" else "" } + return if (ramSize > 0) (2 * ((ramSize / (1024.0 * 1024.0) / 2).roundToLong())).toString() + " MB" else "" + } - fun hasLowRamFlag(context: Context): String { - return if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) { - context.getSystemService()?.isLowRamDevice?.toString() ?: "" - } else { - "" - } + fun hasLowRamFlag(context: Context): String { + return if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) { + context.getSystemService()?.isLowRamDevice?.toString() ?: "" + } else { + "" } } } \ No newline at end of file diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/system/SystemDataProvider.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/system/SystemDataProvider.kt index 7ee9e9c2..e4b3861c 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/system/SystemDataProvider.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/system/SystemDataProvider.kt @@ -5,49 +5,46 @@ import android.os.Build.VERSION import android.os.Build.VERSION_CODES import com.g00fy2.versioncompare.Version -class SystemDataProvider { +object SystemDataProvider { - companion object { + fun getVersionAndSDK(): Pair = Pair(getAndroidVersion(), getSDKLevel()) - fun getVersionAndSDK(): Pair = Pair(getAndroidVersion(), getSDKLevel()) + fun getAndroidVersion(): String = VERSION.RELEASE - fun getAndroidVersion(): String = VERSION.RELEASE + fun getCodename(): String = VERSION.CODENAME - fun getCodename(): String = VERSION.CODENAME - - @SuppressLint("DefaultLocale") - fun getSDKLevel(): String { - getCodename().let { - return if (it.isBlank() || it.equals("REL", true)) { - VERSION.SDK_INT.toString() - } else { - it.toUpperCase() - } - } - } - - fun getPreviewSDK(): String { - return if (VERSION.SDK_INT >= VERSION_CODES.M) { - VERSION.PREVIEW_SDK_INT.toString() + @SuppressLint("DefaultLocale") + fun getSDKLevel(): String { + getCodename().let { + return if (it.isBlank() || it.equals("REL", true)) { + VERSION.SDK_INT.toString() } else { - "" + it.toUpperCase() } } + } - fun getPatchLevel(): String { - return if (VERSION.SDK_INT >= VERSION_CODES.M) { - VERSION.SECURITY_PATCH - } else { - "" - } + fun getPreviewSDK(): String { + return if (VERSION.SDK_INT >= VERSION_CODES.M) { + VERSION.PREVIEW_SDK_INT.toString() + } else { + "" } + } - fun getVMVersion(): String { - val vmVersion = System.getProperty("java.vm.version") - val vmName = if (Version(vmVersion).isAtLeast("2", true)) "ART" else "Dalvik" - return "$vmName $vmVersion" + fun getPatchLevel(): String { + return if (VERSION.SDK_INT >= VERSION_CODES.M) { + VERSION.SECURITY_PATCH + } else { + "" } + } - fun getKernelVersion(): String = System.getProperty("os.version") ?: "" + fun getVMVersion(): String { + val vmVersion = System.getProperty("java.vm.version") + val vmName = if (Version(vmVersion).isAtLeast("2", true)) "ART" else "Dalvik" + return "$vmName $vmVersion" } + + fun getKernelVersion(): String = System.getProperty("os.version") ?: "" } \ No newline at end of file diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/systemapps/SystemAppsDataProvider.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/systemapps/SystemAppsDataProvider.kt index 0a3c398e..ff0400b7 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/systemapps/SystemAppsDataProvider.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/systemapps/SystemAppsDataProvider.kt @@ -9,47 +9,44 @@ import android.os.Build.VERSION_CODES import android.webkit.WebView import com.g00fy2.versioncompare.Version -class SystemAppsDataProvider { +object SystemAppsDataProvider { - companion object { - - fun getGooglePlayServicesVersion(context: Context): String { - return try { - context.packageManager.getPackageInfo("com.google.android.gms", 0).versionName - } catch (e: NameNotFoundException) { - "" - } + fun getGooglePlayServicesVersion(context: Context): String { + return try { + context.packageManager.getPackageInfo("com.google.android.gms", 0).versionName + } catch (e: NameNotFoundException) { + "" } + } - @SuppressLint("PrivateApi", "WebViewApiAvailability") - fun getWebViewImplementation(context: Context): String { - return when { - VERSION.SDK_INT >= VERSION_CODES.O -> { - WebView.getCurrentWebViewPackage()?.let { + @SuppressLint("PrivateApi", "WebViewApiAvailability") + fun getWebViewImplementation(context: Context): String { + return when { + VERSION.SDK_INT >= VERSION_CODES.O -> { + WebView.getCurrentWebViewPackage()?.let { + context.packageManager.getApplicationLabel(it.applicationInfo).toString() + " " + it.versionName + } ?: "" + } + VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP -> { + try { + (Class.forName("android.webkit.WebViewFactory") + .getMethod("getLoadedPackageInfo") + .invoke(null) as PackageInfo?)?.let { context.packageManager.getApplicationLabel(it.applicationInfo).toString() + " " + it.versionName - } ?: "" - } - VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP -> { - try { - (Class.forName("android.webkit.WebViewFactory") - .getMethod("getLoadedPackageInfo") - .invoke(null) as PackageInfo?)?.let { - context.packageManager.getApplicationLabel(it.applicationInfo).toString() + " " + it.versionName - } - ?: "" - } catch (t: Throwable) { - "" } + ?: "" + } catch (t: Throwable) { + "" } - Version(VERSION.RELEASE).isAtLeast("4.4.3") -> "WebView v33.0.0.0" - VERSION.SDK_INT >= VERSION_CODES.KITKAT -> "WebView v30.0.0.0" - else -> try { - context.packageManager.getPackageInfo("com.google.android.webview", 0) - } catch (e: NameNotFoundException) { - null - }?.let { context.packageManager.getApplicationLabel(it.applicationInfo).toString() + " " + it.versionName } - ?: "" } + Version(VERSION.RELEASE).isAtLeast("4.4.3") -> "WebView v33.0.0.0" + VERSION.SDK_INT >= VERSION_CODES.KITKAT -> "WebView v30.0.0.0" + else -> try { + context.packageManager.getPackageInfo("com.google.android.webview", 0) + } catch (e: NameNotFoundException) { + null + }?.let { context.packageManager.getApplicationLabel(it.applicationInfo).toString() + " " + it.versionName } + ?: "" } } } \ No newline at end of file From c080b69bbf0aec72dc4a63c61bd01e61bf31683e Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 26 Feb 2020 00:55:33 +0100 Subject: [PATCH 039/135] Update android studio and gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 84226702..6254d2d4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 9b655157..420a0205 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -13,7 +13,7 @@ pluginManagement { resolutionStrategy { eachPlugin { if (requested.id.namespace == "com.android") { - useModule("com.android.tools.build:gradle:4.0.0-alpha09") + useModule("com.android.tools.build:gradle:4.0.0-beta01") } if (requested.id.id == "eu.appcom.gradle.android-versioning") { useModule("eu.appcom.gradle:android-versioning:1.0.2") From 962c13a08a61e0d5daed9f2f7a0f660530980916 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 26 Feb 2020 23:53:20 +0100 Subject: [PATCH 040/135] Update android sdk command line tools --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 794108a4..bb99fe6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ git: env: global: # for updates check (dl.google.com/android/repository/repository2-1.xml) - - ANDROID_SDK_CMD_TOOLS=commandlinetools-linux-5842447_latest.zip + - ANDROID_SDK_CMD_TOOLS=commandlinetools-linux-6200805_latest.zip # storepass, keypass, keyalias - secure: K4PVOrcYr6ZV16GgZWcw5RGDqxRTrilMK6pjz1r+RkQX6EPywmTsUH0y8EGP44bZc+TFMM0UfGPulHfrKzC3LDVSe+CpvNdQqq8c2Ysc9lQLubvFmVlWZ2rjHhA3jtg33FDIAWipb41WZEdmCJE1EI+OMbh8p8/7cGZ4K4tpd3B8ViXrf16ht50C56glL1lS3Jog/g9OEIPdhzYF23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xQW08b1FMaKJwpfsNiHkwW6u1jq1oeEBIzUrAMmo92uAjDAHKfn7FOsx5RVg20EKP9Rk9l2YKRA5dGJFI= From 4abb11362aa570d60a932977da4dcc2418657979 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 27 Feb 2020 20:48:12 +0100 Subject: [PATCH 041/135] Update android studio --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 420a0205..5edc1839 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -13,7 +13,7 @@ pluginManagement { resolutionStrategy { eachPlugin { if (requested.id.namespace == "com.android") { - useModule("com.android.tools.build:gradle:4.0.0-beta01") + useModule("com.android.tools.build:gradle:4.1.0-alpha01") } if (requested.id.id == "eu.appcom.gradle.android-versioning") { useModule("eu.appcom.gradle:android-versioning:1.0.2") From 2c536cfd2ab9aa3516714ff37b3cc0c72534a3ed Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 28 Feb 2020 00:28:14 +0100 Subject: [PATCH 042/135] Add contentdescription to fab --- app/src/main/res/layout/activity_widget_config.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/layout/activity_widget_config.xml b/app/src/main/res/layout/activity_widget_config.xml index d9bdae15..1c80d6a0 100644 --- a/app/src/main/res/layout/activity_widget_config.xml +++ b/app/src/main/res/layout/activity_widget_config.xml @@ -118,6 +118,7 @@ android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="12dp" + android:contentDescription="@string/share_device_data" android:visibility="invisible" app:tint="@color/backgroundColor" app:rippleColor="@color/rippleBackground" From 7809ab8b9f3c88f113f6ec230c96aa2497f54231 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Tue, 3 Mar 2020 20:44:12 +0100 Subject: [PATCH 043/135] Update kotlin to stable --- app/build.gradle.kts | 3 +-- settings.gradle.kts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 3d2b32d6..357c14f3 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -57,7 +57,6 @@ android { repositories { google() mavenCentral() - maven("https://dl.bintray.com/kotlin/kotlin-eap") jcenter { content { includeModule("com.g00fy2", "versioncompare") @@ -67,7 +66,7 @@ repositories { } dependencies { // Kotlin - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.70-eap-274") + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.70") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3") // AndroidX diff --git a/settings.gradle.kts b/settings.gradle.kts index 5edc1839..0e4f6951 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,7 +3,6 @@ pluginManagement { google() gradlePluginPortal() mavenCentral() - maven("https://dl.bintray.com/kotlin/kotlin-eap") jcenter { content { includeModule("eu.appcom.gradle", "android-versioning") @@ -19,7 +18,7 @@ pluginManagement { useModule("eu.appcom.gradle:android-versioning:1.0.2") } if (requested.id.namespace == "org.jetbrains.kotlin") { - useVersion("1.3.70-eap-274") + useVersion("1.3.70") } } } From b577ddc2b9d2de6d8ae4c62982493418bc0a21ac Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 4 Mar 2020 22:18:01 +0100 Subject: [PATCH 044/135] Update gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6254d2d4..84a90661 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 2c6376d95881d5c43e2a5ef77098d6356d421e28 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 5 Mar 2020 08:53:12 +0100 Subject: [PATCH 045/135] Update dependencies --- app/build.gradle.kts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 357c14f3..c97b1dce 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -70,10 +70,10 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3") // AndroidX - implementation("androidx.appcompat:appcompat:1.2.0-alpha02") - implementation("androidx.core:core-ktx:1.3.0-alpha01") - implementation("androidx.activity:activity:1.1.0") - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.2.0") + implementation("androidx.appcompat:appcompat:1.2.0-alpha03") + implementation("androidx.core:core-ktx:1.3.0-alpha02") + implementation("androidx.activity:activity:1.2.0-alpha01") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha01") implementation("androidx.recyclerview:recyclerview:1.2.0-alpha01") implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta4") implementation("androidx.vectordrawable:vectordrawable:1.1.0") From 866a14b4c7c450b17e327e5f5f48357920b08c18 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Tue, 10 Mar 2020 12:05:09 +0100 Subject: [PATCH 046/135] Update android studio --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 0e4f6951..7b30848c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -12,7 +12,7 @@ pluginManagement { resolutionStrategy { eachPlugin { if (requested.id.namespace == "com.android") { - useModule("com.android.tools.build:gradle:4.1.0-alpha01") + useModule("com.android.tools.build:gradle:4.1.0-alpha02") } if (requested.id.id == "eu.appcom.gradle.android-versioning") { useModule("eu.appcom.gradle:android-versioning:1.0.2") From afc6669c7a8693ae9ef4a3041344a3c2bff7c1c3 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 13 Mar 2020 00:49:15 +0100 Subject: [PATCH 047/135] Update gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 84a90661..8e85f64f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-rc-1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 22b2b469af59de2935ced1d9c5c27a41719dcff8 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Mon, 16 Mar 2020 00:57:58 +0100 Subject: [PATCH 048/135] Update dagger --- app/build.gradle.kts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c97b1dce..caad1c15 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -86,9 +86,9 @@ dependencies { implementation("com.g00fy2:versioncompare:1.3.4") // Dagger - implementation("com.google.dagger:dagger:2.26") - kapt("com.google.dagger:dagger-compiler:2.26") - implementation("com.google.dagger:dagger-android:2.26") - implementation("com.google.dagger:dagger-android-support:2.26") - kapt("com.google.dagger:dagger-android-processor:2.26") + implementation("com.google.dagger:dagger:2.27") + kapt("com.google.dagger:dagger-compiler:2.27") + implementation("com.google.dagger:dagger-android:2.27") + implementation("com.google.dagger:dagger-android-support:2.27") + kapt("com.google.dagger:dagger-android-processor:2.27") } \ No newline at end of file From 509d5c3e256a39ff613b1e596c32a7cdf6476bd1 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 18 Mar 2020 22:16:43 +0100 Subject: [PATCH 049/135] Update android studio and gradle, enable more shrinking flags --- gradle.properties | 13 +++++++++++-- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 9b75ab47..55725d21 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,11 +8,20 @@ android.enableR8.fullMode=true # Enable rudimentary R class namespacing where each library only contains # references to the resources it declares instead of declarations plus all # transitive dependency references. -android.namespacedRClass=true +android.nonTransitiveRClass=true # Only keep the single relevant constructor for types mentioned in XML files # instead of using a parameter wildcard which keeps them all. android.useMinimalKeepRules=true +# Enable AAPT2 support for conditional keep rules. This allows to potentially +# shrink more code if resources are not used. +android.useConditionalKeepRules=true + +# Add a task to support AAPT2 optimize suboperations as an effort to +# reduce APK size. The task invokes the AAPT2 executable binary which +# performs the resource optimization on the APK. +android.enableResourceOptimizations=true + # Set the build VMs heap size. -org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8e85f64f..fa71ecdb 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-rc-1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-rc-3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 7b30848c..a7d06342 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -12,7 +12,7 @@ pluginManagement { resolutionStrategy { eachPlugin { if (requested.id.namespace == "com.android") { - useModule("com.android.tools.build:gradle:4.1.0-alpha02") + useModule("com.android.tools.build:gradle:4.1.0-alpha03") } if (requested.id.id == "eu.appcom.gradle.android-versioning") { useModule("eu.appcom.gradle:android-versioning:1.0.2") From 482a402fa9decd26d580e3a40b79201bef1d58c7 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 18 Mar 2020 22:36:32 +0100 Subject: [PATCH 050/135] Remove conditional keep rules flag --- gradle.properties | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 55725d21..d884c78a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,10 +14,6 @@ android.nonTransitiveRClass=true # instead of using a parameter wildcard which keeps them all. android.useMinimalKeepRules=true -# Enable AAPT2 support for conditional keep rules. This allows to potentially -# shrink more code if resources are not used. -android.useConditionalKeepRules=true - # Add a task to support AAPT2 optimize suboperations as an effort to # reduce APK size. The task invokes the AAPT2 executable binary which # performs the resource optimization on the APK. From 3ea055202ef1eaabcf0fb44779bb31e735232976 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 18 Mar 2020 23:25:53 +0100 Subject: [PATCH 051/135] Update dependencies --- app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index caad1c15..e65b2d66 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -72,7 +72,7 @@ dependencies { // AndroidX implementation("androidx.appcompat:appcompat:1.2.0-alpha03") implementation("androidx.core:core-ktx:1.3.0-alpha02") - implementation("androidx.activity:activity:1.2.0-alpha01") + implementation("androidx.activity:activity:1.2.0-alpha02") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha01") implementation("androidx.recyclerview:recyclerview:1.2.0-alpha01") implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta4") From 6f201864b922defdc24dfa39a2227dc1b9412605 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 19 Mar 2020 12:15:35 +0100 Subject: [PATCH 052/135] Update coroutines --- app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e65b2d66..255991f4 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -67,7 +67,7 @@ repositories { dependencies { // Kotlin implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.70") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5") // AndroidX implementation("androidx.appcompat:appcompat:1.2.0-alpha03") From 16609292bf10d92ca8ef1e74370c9b955671290b Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 19 Mar 2020 12:16:58 +0100 Subject: [PATCH 053/135] Cleanup properties and add better documentation --- gradle.properties | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index d884c78a..5ae8c11c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,6 @@ +# Allow usage of AndroidX instead of the old support libraries. android.useAndroidX=true -android.enableJetifier=false - # Use R8 in full mode instead of ProGuard compatibility mode. android.enableR8.fullMode=true @@ -14,9 +13,8 @@ android.nonTransitiveRClass=true # instead of using a parameter wildcard which keeps them all. android.useMinimalKeepRules=true -# Add a task to support AAPT2 optimize suboperations as an effort to -# reduce APK size. The task invokes the AAPT2 executable binary which -# performs the resource optimization on the APK. +# Enable supported AAPT2 optimize suboperations (ResourceObfuscation, +# SparseResourceEncoding, ResourcePathShortening) as an effort to reduce APK size. android.enableResourceOptimizations=true # Set the build VMs heap size. From baf9c7208f4b5fa0618f563862ab6b53bc32882c Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Tue, 24 Mar 2020 17:36:39 +0100 Subject: [PATCH 054/135] Update gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fa71ecdb..3724ca3c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-rc-3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-rc-4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 9a99b67909a93217fada950f42013b237c8bd941 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Tue, 24 Mar 2020 17:37:32 +0100 Subject: [PATCH 055/135] Remove deprecated enableBuildCache parameter --- .travis.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index bb99fe6a..d38f7a11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,13 +44,7 @@ before_script: # log all gradle warnings - echo "org.gradle.warning.mode=all" >> $HOME/.gradle/gradle.properties # control gradle build cache - - if [[ $CACHING == "true" ]]; then - echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties; - echo "android.enableBuildCache=true" >> $HOME/.gradle/gradle.properties; - else - echo "org.gradle.caching=false" >> $HOME/.gradle/gradle.properties; - echo "android.enableBuildCache=false" >> $HOME/.gradle/gradle.properties; - fi + - echo "org.gradle.caching=$CACHING" >> $HOME/.gradle/gradle.properties; before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - rm -rf $HOME/.gradle/caches/*/plugin-resolution/ From 5e68618b9175ee5ad66eb28497b2f45bc41215b2 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Tue, 24 Mar 2020 17:39:41 +0100 Subject: [PATCH 056/135] Update Kotlin EPA --- app/build.gradle.kts | 6 ++++-- settings.gradle.kts | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 255991f4..ac525879 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -57,6 +57,8 @@ android { repositories { google() mavenCentral() + maven("https://dl.bintray.com/kotlin/kotlin-eap") + maven("https://kotlin.bintray.com/kotlinx") jcenter { content { includeModule("com.g00fy2", "versioncompare") @@ -66,8 +68,8 @@ repositories { } dependencies { // Kotlin - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.70") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5") + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4-M1") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5-1.4-M1") // AndroidX implementation("androidx.appcompat:appcompat:1.2.0-alpha03") diff --git a/settings.gradle.kts b/settings.gradle.kts index a7d06342..f867742f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,6 +3,7 @@ pluginManagement { google() gradlePluginPortal() mavenCentral() + maven("https://dl.bintray.com/kotlin/kotlin-eap") jcenter { content { includeModule("eu.appcom.gradle", "android-versioning") @@ -18,7 +19,7 @@ pluginManagement { useModule("eu.appcom.gradle:android-versioning:1.0.2") } if (requested.id.namespace == "org.jetbrains.kotlin") { - useVersion("1.3.70") + useVersion("1.4-M1") } } } From a25e1ddcbff31bafeebed9c4a7c825423b96a759 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 25 Mar 2020 01:44:49 +0100 Subject: [PATCH 057/135] Update gradle and android studio --- gradle/wrapper/gradle-wrapper.jar | Bin 58695 -> 58694 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index f3d88b1c2faf2fc91d853cd5d4242b5547257070..490fda8577df6c95960ba7077c43220e5bb2c0d9 100644 GIT binary patch delta 6577 zcmYkAbyQT*w}4>)kxq%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radle enterprise plugin and enable scan for all CI builds --- .travis.yml | 4 ++-- settings.gradle.kts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d38f7a11..a75d06a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,12 +66,12 @@ jobs: - # Build debug if: branch IN (develop, master) env: CACHING=true - script: "./gradlew assembleDebug --scan" + script: "./gradlew assembleDebug" - # Build and deploy release on tags if: tag IS present env: CACHING=false script: - - "./gradlew assembleRelease -Pmy_storepass=$storepass -Pmy_keyalias=$keyalias -Pmy_keypass=$keypass --scan" + - "./gradlew assembleRelease -Pmy_storepass=$storepass -Pmy_keyalias=$keyalias -Pmy_keypass=$keypass" - "./gradlew :app:bundleRelease -Pmy_storepass=$storepass -Pmy_keyalias=$keyalias -Pmy_keypass=$keypass" deploy: provider: releases diff --git a/settings.gradle.kts b/settings.gradle.kts index e5bbbbf9..75c07898 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -26,13 +26,14 @@ pluginManagement { } plugins { - id("com.gradle.enterprise") version "3.1.1" + id("com.gradle.enterprise") version "3.2" } gradleEnterprise { buildScan { termsOfServiceUrl = "https://gradle.com/terms-of-service" termsOfServiceAgree = "yes" + publishAlwaysIf(!System.getenv("CI").isNullOrEmpty()) } } From a38b4a3e37bc715e27828597f8732621c7d2262d Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Tue, 31 Mar 2020 12:01:44 +0200 Subject: [PATCH 059/135] Refactor gradle build scripts --- app/build.gradle.kts | 10 +++++----- build.gradle.kts | 4 ++-- settings.gradle.kts | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ac525879..5a6e5bd0 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -21,9 +21,9 @@ android { signingConfigs { create("release") { storeFile = file("../keystore.jks") - storePassword = findProperty("my_storepass") as String? ?: "" - keyAlias = findProperty("my_keyalias") as String? ?: "" - keyPassword = findProperty("my_keypass") as String? ?: "" + storePassword = findProperty("my_storepass") as String? + keyAlias = findProperty("my_keyalias") as String? + keyPassword = findProperty("my_keypass") as String? isV1SigningEnabled = true isV2SigningEnabled = true } @@ -50,7 +50,7 @@ android { targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = "1.8" + jvmTarget = JavaVersion.VERSION_1_8.toString() } } @@ -68,7 +68,7 @@ repositories { } dependencies { // Kotlin - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4-M1") + implementation(kotlin("stdlib-jdk7")) implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5-1.4-M1") // AndroidX diff --git a/build.gradle.kts b/build.gradle.kts index 72a2825b..ecf136ee 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,3 @@ -tasks.register("clean", Delete::class) { - delete(rootProject.buildDir) +tasks.register("clean") { + delete(buildDir) } \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 75c07898..b19a95e1 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,5 @@ +include("app") + pluginManagement { repositories { google() @@ -35,6 +37,4 @@ gradleEnterprise { termsOfServiceAgree = "yes" publishAlwaysIf(!System.getenv("CI").isNullOrEmpty()) } -} - -include(":app") \ No newline at end of file +} \ No newline at end of file From bd8d381bce5880a4db1f4b0fc2c753d044e4ccdc Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 9 Apr 2020 23:08:31 +0200 Subject: [PATCH 060/135] Update android studio and androidx dependencies --- app/build.gradle.kts | 8 ++++---- settings.gradle.kts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5a6e5bd0..f3727b88 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -72,11 +72,11 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5-1.4-M1") // AndroidX - implementation("androidx.appcompat:appcompat:1.2.0-alpha03") - implementation("androidx.core:core-ktx:1.3.0-alpha02") - implementation("androidx.activity:activity:1.2.0-alpha02") + implementation("androidx.appcompat:appcompat:1.2.0-beta01") + implementation("androidx.core:core-ktx:1.3.0-beta01") + implementation("androidx.activity:activity:1.2.0-alpha03") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha01") - implementation("androidx.recyclerview:recyclerview:1.2.0-alpha01") + implementation("androidx.recyclerview:recyclerview:1.2.0-alpha02") implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta4") implementation("androidx.vectordrawable:vectordrawable:1.1.0") diff --git a/settings.gradle.kts b/settings.gradle.kts index b19a95e1..f246efbb 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -15,7 +15,7 @@ pluginManagement { resolutionStrategy { eachPlugin { if (requested.id.namespace == "com.android") { - useModule("com.android.tools.build:gradle:4.1.0-alpha04") + useModule("com.android.tools.build:gradle:4.1.0-alpha05") } if (requested.id.id == "eu.appcom.gradle.android-versioning") { useModule("eu.appcom.gradle:android-versioning:1.0.2") From d30e0b766b63b9ce9e41cfaa658f6f4f9b61af6a Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 15 Apr 2020 14:23:05 +0200 Subject: [PATCH 061/135] Update dependencies --- app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f3727b88..26415c56 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -81,7 +81,7 @@ dependencies { implementation("androidx.vectordrawable:vectordrawable:1.1.0") // UI - implementation("com.google.android.material:material:1.2.0-alpha05") + implementation("com.google.android.material:material:1.2.0-alpha06") // Misc implementation("com.jakewharton.timber:timber:4.7.1") From 06c4ab72604e861caf505cc1b05f71407ff6b846 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Mon, 20 Apr 2020 11:40:42 +0200 Subject: [PATCH 062/135] Update dependencies and gradle --- app/build.gradle.kts | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 26415c56..2bfa5d64 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -73,12 +73,12 @@ dependencies { // AndroidX implementation("androidx.appcompat:appcompat:1.2.0-beta01") - implementation("androidx.core:core-ktx:1.3.0-beta01") + implementation("androidx.core:core-ktx:1.3.0-rc01") implementation("androidx.activity:activity:1.2.0-alpha03") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha01") implementation("androidx.recyclerview:recyclerview:1.2.0-alpha02") implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta4") - implementation("androidx.vectordrawable:vectordrawable:1.1.0") + implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha01") // UI implementation("com.google.android.material:material:1.2.0-alpha06") diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6623300b..ca99a815 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-rc-1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 2b498d7d2feca594298634329a71dae5230362a4 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 22 Apr 2020 15:22:19 +0200 Subject: [PATCH 063/135] Update android studio --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index f246efbb..cdbbe277 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -15,7 +15,7 @@ pluginManagement { resolutionStrategy { eachPlugin { if (requested.id.namespace == "com.android") { - useModule("com.android.tools.build:gradle:4.1.0-alpha05") + useModule("com.android.tools.build:gradle:4.1.0-alpha06") } if (requested.id.id == "eu.appcom.gradle.android-versioning") { useModule("eu.appcom.gradle:android-versioning:1.0.2") From 7a008787f31f1894caefa39bb42503ccd05b5d22 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 23 Apr 2020 20:44:18 +0200 Subject: [PATCH 064/135] Update gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ca99a815..c4352f1d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-rc-1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-rc-2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From ab375b66132e21cbd33c53bcb882f19b1118e618 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 23 Apr 2020 21:01:13 +0200 Subject: [PATCH 065/135] Fix deprecated recyclerview method calls --- .../developerwidget/activities/apkinstall/ApkAdapter.kt | 6 +++--- .../developerwidget/activities/appmanager/AppsAdapter.kt | 2 +- .../developerwidget/activities/shortcut/ShortcutAdapter.kt | 2 +- .../activities/widgetconfig/DeviceDataAdapter.kt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkAdapter.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkAdapter.kt index b5f1b9f6..4eb2efbb 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkAdapter.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkAdapter.kt @@ -35,7 +35,7 @@ class ApkAdapter : BaseAdapter(ApksDiffUtilsCallback()) .setBackgroundResource(if (item.appIcon is InsetDrawable) R.drawable.bg_adaptive_launcher_icon else 0) } } - setSelected(adapterPosition) + setSelected(bindingAdapterPosition) } fun setSelected(position: Int) { @@ -50,7 +50,7 @@ class ApkAdapter : BaseAdapter(ApksDiffUtilsCallback()) return ApkViewHolder(ApkItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)).apply { addRipple() itemView.setOnClickListener { - adapterPosition.let { + bindingAdapterPosition.let { if (selectedPositions.isNotEmpty()) { if (selectedPositions.contains(it)) { selectedPositions.remove(it) @@ -65,7 +65,7 @@ class ApkAdapter : BaseAdapter(ApksDiffUtilsCallback()) } } itemView.setOnLongClickListener { - adapterPosition.let { + bindingAdapterPosition.let { if (selectedPositions.contains(it)) { selectedPositions.remove(it) } else { diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt index c7627bec..8a6bf96b 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt @@ -37,7 +37,7 @@ class AppsAdapter : BaseAdapter(AppsDiffUtilsCallback()) return AppViewHolder(AppItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)).apply { addRipple() itemView.setOnClickListener { - onAppClicked(getSelectedPackageName(adapterPosition)) + onAppClicked(getSelectedPackageName(bindingAdapterPosition)) } } } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/ShortcutAdapter.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/ShortcutAdapter.kt index c020832e..3c79aa9b 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/ShortcutAdapter.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/ShortcutAdapter.kt @@ -26,7 +26,7 @@ class ShortcutAdapter : BaseAdapter(ShortcutDi override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ShortcutViewHolder { return ShortcutViewHolder(ShortcutItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)).apply { addRipple() - itemView.setOnClickListener { onShortcutSelected(adapterPosition) } + itemView.setOnClickListener { onShortcutSelected(bindingAdapterPosition) } } } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/DeviceDataAdapter.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/DeviceDataAdapter.kt index e58e73e4..6188deb8 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/DeviceDataAdapter.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/DeviceDataAdapter.kt @@ -16,7 +16,7 @@ class DeviceDataAdapter : BaseViewHolder>(binding) { override fun onBind(item: Pair) { item.run { - binding.headerDividerView.visibility = if (adapterPosition == 0) View.INVISIBLE else View.VISIBLE + binding.headerDividerView.visibility = if (bindingAdapterPosition == 0) View.INVISIBLE else View.VISIBLE binding.headerTitleTextview.text = itemView.context.getString(second.title) } } From 37da15f4e1c284cf1e1613a3fbe56347455dda8a Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 24 Apr 2020 10:22:16 +0200 Subject: [PATCH 066/135] Update android studio --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index cdbbe277..24b39246 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -15,7 +15,7 @@ pluginManagement { resolutionStrategy { eachPlugin { if (requested.id.namespace == "com.android") { - useModule("com.android.tools.build:gradle:4.1.0-alpha06") + useModule("com.android.tools.build:gradle:4.1.0-alpha07") } if (requested.id.id == "eu.appcom.gradle.android-versioning") { useModule("eu.appcom.gradle:android-versioning:1.0.2") From 4643762fa46bbdd499271d67301f4402e1b665ae Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Mon, 27 Apr 2020 12:55:56 +0200 Subject: [PATCH 067/135] Update gradle scan plugin --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 24b39246..283191b2 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -28,7 +28,7 @@ pluginManagement { } plugins { - id("com.gradle.enterprise") version "3.2" + id("com.gradle.enterprise") version "3.2.1" } gradleEnterprise { From 00ed088c885e3ed27a1be01be772705a3628ae2b Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 1 May 2020 00:54:58 +0200 Subject: [PATCH 068/135] Provide baseActivity type instead context * refactor permissionController to make use of ActivityResultContract * update dependencies --- app/build.gradle.kts | 7 ++-- .../activities/apkinstall/ApkActivity.kt | 10 ----- .../activities/apkinstall/ApkFile.kt | 12 +++--- .../activities/apkinstall/ApkPresenterImpl.kt | 35 ++++++++-------- .../controllers/StorageDirsControllerImpl.kt | 6 +-- .../activities/appmanager/AppInfo.kt | 6 +-- .../controllers/IntentControllerImpl.kt | 10 ++--- .../controllers/PermissionController.kt | 8 +--- .../controllers/PermissionControllerImpl.kt | 40 +++++-------------- .../controllers/StringControllerImpl.kt | 6 +-- .../WidgetPreferenceControllerImpl.kt | 5 ++- .../developerwidget/di/ActivityModule.kt | 3 +- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 2 +- 14 files changed, 57 insertions(+), 95 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 2bfa5d64..3e18245a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -74,9 +74,10 @@ dependencies { // AndroidX implementation("androidx.appcompat:appcompat:1.2.0-beta01") implementation("androidx.core:core-ktx:1.3.0-rc01") - implementation("androidx.activity:activity:1.2.0-alpha03") - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha01") - implementation("androidx.recyclerview:recyclerview:1.2.0-alpha02") + implementation("androidx.activity:activity:1.2.0-alpha04") + implementation("androidx.fragment:fragment:1.3.0-alpha04") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha02") + implementation("androidx.recyclerview:recyclerview:1.2.0-alpha03") implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta4") implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha01") diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt index f5bd762f..ddfcca21 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt @@ -47,16 +47,6 @@ class ApkActivity : BaseActivity(true), ApkContract.ApkView { } } - override fun onResume() { - super.onResume() - if (adapter.itemCount == 0) { - binding.progressbar.visibility = View.VISIBLE - binding.noItemsImageview.visibility = View.INVISIBLE - binding.noItemsTextview.text = getString(R.string.scanning_apks) - binding.noItemsTextview.visibility = View.VISIBLE - } - } - override fun toggleResultView(apkFiles: List, missingPermissions: Boolean) { if (missingPermissions) { binding.progressbar.visibility = View.GONE diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt index 86f9597a..ab7ddf04 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt @@ -1,6 +1,5 @@ package com.g00fy2.developerwidget.activities.apkinstall -import android.content.Context import android.content.pm.ApplicationInfo import android.content.pm.PackageManager import android.content.pm.PermissionInfo @@ -13,6 +12,7 @@ import android.os.Build.VERSION_CODES import android.text.format.DateFormat import androidx.core.content.FileProvider import androidx.core.content.pm.PackageInfoCompat +import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.di.annotations.ACTIVITY import timber.log.Timber import java.io.File @@ -59,11 +59,11 @@ class ApkFile private constructor() : Comparable { fun build(file: File): ApkFile } - class ApkFileBuilderImpl @Inject constructor(@Named(ACTIVITY) private val context: Context) : ApkFileBuilder { + class ApkFileBuilderImpl @Inject constructor(@Named(ACTIVITY) private val activity: BaseActivity) : ApkFileBuilder { - private val dateFormat = DateFormat.getDateFormat(context) - private val timeFormat = DateFormat.getTimeFormat(context) - private val packageManager = context.packageManager + private val dateFormat = DateFormat.getDateFormat(activity) + private val timeFormat = DateFormat.getTimeFormat(activity) + private val packageManager = activity.packageManager override fun build(file: File): ApkFile { return ApkFile().apply { @@ -98,7 +98,7 @@ class ApkFile private constructor() : Comparable { filePath = file.path try { fileUri = if (VERSION.SDK_INT >= VERSION_CODES.N) { - FileProvider.getUriForFile(context, context.applicationContext.packageName + ".fileprovider", file) + FileProvider.getUriForFile(activity, activity.applicationContext.packageName + ".fileprovider", file) } else { Uri.fromFile(file) } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt index 7e8e6d00..d2316fd3 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt @@ -30,26 +30,24 @@ class ApkPresenterImpl @Inject constructor() : BasePresenterImpl(), ApkContract. lateinit var apkFileBuilder: ApkFile.ApkFileBuilder @OnLifecycleEvent(Event.ON_CREATE) - fun requestPermission() { - permissionController.requestPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) + fun scanStoreageIfPermissionGranted() { + permissionController.requestPermissions( + Manifest.permission.WRITE_EXTERNAL_STORAGE, + onGranted = { scanStorageForApks() }, + onDenied = { view.toggleResultView(emptyList(), true) }) } - @OnLifecycleEvent(Event.ON_RESUME) - fun scanStorageForApks() { - if (permissionController.hasPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)) { - view.lifecycleScope.launch { - withContext(Dispatchers.IO) { - mutableSetOf().apply { - for (dir in storageDirsController.getStorageDirectories()) { - addAll(searchAPKs(dir)) - } - }.sorted() - }.let { - view.toggleResultView(it, false) - } + private fun scanStorageForApks() { + view.lifecycleScope.launch { + withContext(Dispatchers.IO) { + mutableSetOf().apply { + for (dir in storageDirsController.getStorageDirectories()) { + addAll(searchAPKs(dir)) + } + }.sorted() + }.let { + view.toggleResultView(it, false) } - } else { - view.toggleResultView(emptyList(), true) } } @@ -79,8 +77,7 @@ class ApkPresenterImpl @Inject constructor() : BasePresenterImpl(), ApkContract. } override fun deleteApkFiles(apkFiles: List?) { - if (permissionController.hasPermissions(arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE)) - ) { + if (permissionController.hasPermissions(Manifest.permission.WRITE_EXTERNAL_STORAGE)) { view.lifecycleScope.launch { withContext(Dispatchers.IO) { apkFiles?.let { files -> diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/controllers/StorageDirsControllerImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/controllers/StorageDirsControllerImpl.kt index 05ea8de2..1c61d029 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/controllers/StorageDirsControllerImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/controllers/StorageDirsControllerImpl.kt @@ -1,10 +1,10 @@ package com.g00fy2.developerwidget.activities.apkinstall.controllers -import android.content.Context import android.os.Build.VERSION import android.os.Build.VERSION_CODES import android.os.Environment import androidx.annotation.RequiresApi +import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.di.annotations.ACTIVITY import timber.log.Timber import java.io.File @@ -19,7 +19,7 @@ class StorageDirsControllerImpl @Inject constructor() : StorageDirsController { @Inject @Named(ACTIVITY) - lateinit var context: Context + lateinit var activity: BaseActivity /** * Return all storage directories. @@ -79,7 +79,7 @@ class StorageDirsControllerImpl @Inject constructor() : StorageDirsController { @RequiresApi(VERSION_CODES.KITKAT) private fun getExtSdCardPaths(): Collection { val dirs = mutableListOf() - for (file in context.getExternalFilesDirs("external")) { + for (file in activity.getExternalFilesDirs("external")) { file?.let { val index = it.absolutePath.lastIndexOf("/Android/data") if (index < 0) { diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppInfo.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppInfo.kt index 9492bf25..320448c4 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppInfo.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppInfo.kt @@ -1,6 +1,5 @@ package com.g00fy2.developerwidget.activities.appmanager -import android.content.Context import android.content.pm.PackageInfo import android.graphics.drawable.AdaptiveIconDrawable import android.graphics.drawable.Drawable @@ -8,6 +7,7 @@ import android.graphics.drawable.InsetDrawable import android.os.Build.VERSION import android.os.Build.VERSION_CODES import androidx.core.content.pm.PackageInfoCompat +import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.di.annotations.ACTIVITY import javax.inject.Inject import javax.inject.Named @@ -56,8 +56,8 @@ class AppInfo private constructor() : Comparable { return false } - class AppInfoBuilderImpl @Inject constructor(@Named(ACTIVITY) context: Context) : AppInfoBuilder { - private val packageManager = context.packageManager + class AppInfoBuilderImpl @Inject constructor(@Named(ACTIVITY) activity: BaseActivity) : AppInfoBuilder { + private val packageManager = activity.packageManager override fun getInstalledPackages(): List { return packageManager.getInstalledPackages(0) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/IntentControllerImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/IntentControllerImpl.kt index 6d00d830..c451290f 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/IntentControllerImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/IntentControllerImpl.kt @@ -1,6 +1,5 @@ package com.g00fy2.developerwidget.controllers -import android.content.Context import android.content.Intent import android.net.Uri import android.os.Build.VERSION @@ -12,6 +11,7 @@ import com.g00fy2.developerwidget.BuildConfig import com.g00fy2.developerwidget.R import com.g00fy2.developerwidget.activities.about.DEVELOPER_EMAIL import com.g00fy2.developerwidget.activities.apkinstall.ApkFile +import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.di.annotations.ACTIVITY import timber.log.Timber import javax.inject.Inject @@ -21,7 +21,7 @@ class IntentControllerImpl @Inject constructor() : IntentController { @Inject @Named(ACTIVITY) - lateinit var context: Context + lateinit var activity: BaseActivity @Inject lateinit var toastController: ToastController @@ -72,12 +72,12 @@ class IntentControllerImpl @Inject constructor() : IntentController { action = Intent.ACTION_SEND putExtra(Intent.EXTRA_TEXT, data) type = "text/plain" - }, context.getString(R.string.share_device_data))) + }, activity.getString(R.string.share_device_data))) } private fun startActivity(intent: Intent) { - if (intent.resolveActivity(context.packageManager) != null) { - context.startActivity(intent) + if (intent.resolveActivity(activity.packageManager) != null) { + activity.startActivity(intent) } else { Timber.w("Intent could not get resolved.") } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PermissionController.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PermissionController.kt index 5c31dbc9..76517d19 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PermissionController.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PermissionController.kt @@ -2,11 +2,7 @@ package com.g00fy2.developerwidget.controllers interface PermissionController { - fun hasPermission(permission: String): Boolean + fun hasPermissions(vararg permissions: String): Boolean - fun hasPermissions(permissions: Array): Boolean - - fun requestPermission(permission: String) - - fun requestPermissions(permissions: Array) + fun requestPermissions(vararg permissions: String, onGranted: (() -> Unit) = {}, onDenied: () -> Unit = {}) } \ No newline at end of file diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PermissionControllerImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PermissionControllerImpl.kt index a9340d52..8bbc08f5 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PermissionControllerImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PermissionControllerImpl.kt @@ -1,12 +1,9 @@ package com.g00fy2.developerwidget.controllers -import android.app.Activity -import android.content.Context import android.content.pm.PackageManager -import android.os.Build.VERSION -import android.os.Build.VERSION_CODES -import androidx.annotation.RequiresApi +import androidx.activity.result.contract.ActivityResultContracts.RequestMultiplePermissions import androidx.core.content.ContextCompat +import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.di.annotations.ACTIVITY import javax.inject.Inject import javax.inject.Named @@ -15,34 +12,15 @@ class PermissionControllerImpl @Inject constructor() : PermissionController { @Inject @Named(ACTIVITY) - lateinit var context: Context + lateinit var activity: BaseActivity - override fun hasPermission(permission: String): Boolean { - return if (VERSION.SDK_INT >= VERSION_CODES.M) { - ContextCompat.checkSelfPermission( - context, - permission - ) == PackageManager.PERMISSION_GRANTED - } else { - true - } + override fun hasPermissions(vararg permissions: String): Boolean { + return permissions.all { ContextCompat.checkSelfPermission(activity, it) == PackageManager.PERMISSION_GRANTED } } - override fun hasPermissions(permissions: Array): Boolean { - var granted = true - for (permission in permissions) { - granted = granted && hasPermission(permission) - } - return granted - } - - @RequiresApi(VERSION_CODES.M) - override fun requestPermission(permission: String) { - requestPermissions(arrayOf(permission)) - } - - @RequiresApi(VERSION_CODES.M) - override fun requestPermissions(permissions: Array) { - if (!hasPermissions(permissions)) (context as Activity).requestPermissions(permissions, 1) + override fun requestPermissions(vararg permissions: String, onGranted: (() -> Unit), onDenied: () -> Unit) { + activity.registerForActivityResult(RequestMultiplePermissions()) { result -> + if (result.all { it.value }) onGranted() else onDenied() + }.launch(permissions) } } \ No newline at end of file diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/StringControllerImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/StringControllerImpl.kt index 52ca07ad..88df5a3a 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/StringControllerImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/StringControllerImpl.kt @@ -1,6 +1,6 @@ package com.g00fy2.developerwidget.controllers -import android.content.Context +import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.di.annotations.ACTIVITY import javax.inject.Inject import javax.inject.Named @@ -9,7 +9,7 @@ class StringControllerImpl @Inject constructor() : StringController { @Inject @Named(ACTIVITY) - lateinit var context: Context + lateinit var activity: BaseActivity - override fun getString(resId: Int): String = context.getString(resId) + override fun getString(resId: Int): String = activity.getString(resId) } \ No newline at end of file diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/WidgetPreferenceControllerImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/WidgetPreferenceControllerImpl.kt index b7b247a5..f4820da0 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/WidgetPreferenceControllerImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/WidgetPreferenceControllerImpl.kt @@ -2,6 +2,7 @@ package com.g00fy2.developerwidget.controllers import android.content.Context import androidx.core.content.edit +import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.di.annotations.ACTIVITY import com.g00fy2.developerwidget.di.annotations.WIDGET_ID import javax.inject.Inject @@ -11,13 +12,13 @@ class WidgetPreferenceControllerImpl @Inject constructor() : WidgetPreferenceCon @Inject @Named(ACTIVITY) - lateinit var context: Context + lateinit var activity: BaseActivity @Inject @Named(WIDGET_ID) lateinit var widgetId: String private val sharedPreference by lazy { - context.getSharedPreferences(context.packageName + ".preferences_" + widgetId, Context.MODE_PRIVATE) + activity.getSharedPreferences(activity.packageName + ".preferences_" + widgetId, Context.MODE_PRIVATE) } override fun getAppFilters(): MutableList { diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/di/ActivityModule.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/di/ActivityModule.kt index 3231410b..b375948a 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/di/ActivityModule.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/di/ActivityModule.kt @@ -1,6 +1,5 @@ package com.g00fy2.developerwidget.di -import android.content.Context import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.di.annotations.ACTIVITY import com.g00fy2.developerwidget.di.annotations.ActivityScope @@ -14,5 +13,5 @@ abstract class ActivityModule { @Binds @ActivityScope @Named(ACTIVITY) - abstract fun provideActivityContext(activity: BaseActivity): Context + abstract fun provideBaseActivity(activity: BaseActivity): BaseActivity } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c4352f1d..eea8e94b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-rc-2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-rc-3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 283191b2..c59ecdd5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -15,7 +15,7 @@ pluginManagement { resolutionStrategy { eachPlugin { if (requested.id.namespace == "com.android") { - useModule("com.android.tools.build:gradle:4.1.0-alpha07") + useModule("com.android.tools.build:gradle:4.1.0-alpha08") } if (requested.id.id == "eu.appcom.gradle.android-versioning") { useModule("eu.appcom.gradle:android-versioning:1.0.2") From 0976baadf0b90f26fcc79ee9d33d72a6c230226a Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 7 May 2020 19:21:07 +0200 Subject: [PATCH 069/135] Set app dialog width in dp --- app/src/main/res/values-sw600dp/dimens.xml | 1 + app/src/main/res/values/dimens.xml | 1 + app/src/main/res/values/styles.xml | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-sw600dp/dimens.xml b/app/src/main/res/values-sw600dp/dimens.xml index 243c227f..f909aca8 100644 --- a/app/src/main/res/values-sw600dp/dimens.xml +++ b/app/src/main/res/values-sw600dp/dimens.xml @@ -4,4 +4,5 @@ 80dp 22dp 28dp + 608dp \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 2a46f5da..4ee1fbfb 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -5,4 +5,5 @@ 14dp 24dp 14sp + 336dp \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 44d89893..d4be6427 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -44,8 +44,8 @@ @color/textPrimary @color/textTertiary - 100% - 100% + @dimen/dialog_width + @dimen/dialog_width true @drawable/bg_dialog_shape From c1d61c8a162d483b3c3ed84756bd89d2995f3aed Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 7 May 2020 19:21:41 +0200 Subject: [PATCH 070/135] Update gradle and build scan plugin --- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index eea8e94b..fd0c5a38 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-rc-3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index c59ecdd5..1a1e9dd8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -28,7 +28,7 @@ pluginManagement { } plugins { - id("com.gradle.enterprise") version "3.2.1" + id("com.gradle.enterprise") version "3.3" } gradleEnterprise { @@ -36,5 +36,6 @@ gradleEnterprise { termsOfServiceUrl = "https://gradle.com/terms-of-service" termsOfServiceAgree = "yes" publishAlwaysIf(!System.getenv("CI").isNullOrEmpty()) + isUploadInBackground = false } } \ No newline at end of file From 1be3f823d7d4265b8188f68894f7a734c190f033 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 8 May 2020 09:54:16 +0200 Subject: [PATCH 071/135] Update android studio and deps --- app/build.gradle.kts | 2 +- settings.gradle.kts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 3e18245a..fc92805e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -78,7 +78,7 @@ dependencies { implementation("androidx.fragment:fragment:1.3.0-alpha04") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha02") implementation("androidx.recyclerview:recyclerview:1.2.0-alpha03") - implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta4") + implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta5") implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha01") // UI diff --git a/settings.gradle.kts b/settings.gradle.kts index 1a1e9dd8..44e60de8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -15,7 +15,7 @@ pluginManagement { resolutionStrategy { eachPlugin { if (requested.id.namespace == "com.android") { - useModule("com.android.tools.build:gradle:4.1.0-alpha08") + useModule("com.android.tools.build:gradle:4.1.0-alpha09") } if (requested.id.id == "eu.appcom.gradle.android-versioning") { useModule("eu.appcom.gradle:android-versioning:1.0.2") From 39e89562e13226dd1801fa81c7819efc75ef2139 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 13 May 2020 08:44:34 +0200 Subject: [PATCH 072/135] Let the signer decide which signing to use --- app/build.gradle.kts | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index fc92805e..3c5b5614 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -24,8 +24,6 @@ android { storePassword = findProperty("my_storepass") as String? keyAlias = findProperty("my_keyalias") as String? keyPassword = findProperty("my_keypass") as String? - isV1SigningEnabled = true - isV2SigningEnabled = true } } buildTypes { From 23f613abae2272e4c08c0c109b688088edc0961b Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 15 May 2020 11:39:11 +0200 Subject: [PATCH 073/135] Update deps and gradle --- app/build.gradle.kts | 4 ++-- gradle/wrapper/gradle-wrapper.jar | Bin 58694 -> 58910 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 2 ++ gradlew.bat | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 3c5b5614..7b8d2d36 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -70,13 +70,13 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5-1.4-M1") // AndroidX - implementation("androidx.appcompat:appcompat:1.2.0-beta01") + implementation("androidx.appcompat:appcompat:1.2.0-rc01") implementation("androidx.core:core-ktx:1.3.0-rc01") implementation("androidx.activity:activity:1.2.0-alpha04") implementation("androidx.fragment:fragment:1.3.0-alpha04") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha02") implementation("androidx.recyclerview:recyclerview:1.2.0-alpha03") - implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta5") + implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta6") implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha01") // UI diff --git a/gradle/wrapper/gradle-wrapper.jar b/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n=~d~TS{n&I+svxt4dWO zT?K0)JEx>9E7saW8h!5+MmAkC`g~v*@ z6VKn0>eZdon>BH(O$mACnxk3D?vSlCFFnvZ#+&hUs)Wr!aP{<@|oc^G>bJk59^xhmz!RA%|K_$o)V`D@gVs>@bSmXVID_PQXp znfja8U01+t3V!o{8ZKi~G@#q$KrAH-Ks3$G{Qo}H|N1ijJMsgZDgOmM1O$Fi0>0CX zpbAzXhYbP@PV;~=*nn7eQGjoT2b9nGFNg-PpHT$a@?7JL7I&pmkmclS7#Y#zRYg_`D0h47O z&|%88tXNh8{Yk$@@*HA-B9r#tDkY$>!U#Ie`j1TupjRn@;(ykyyld-zJ{@qm!UG~I zxR#ZxV8CEi5JXV?ANc~bS9*;MYtkTvifc5iynmg!XpIr%SN*R#E?|3&2QVs~N02d=N!1;GdfNGr)gc$|K#-y*M=Ra9B4#cmk-naoQuS*cWnE3C4 F{|nTN-B$nr diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fd0c5a38..742fd254 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-milestone-1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 2fe81a7d..fbd7c515 100755 --- a/gradlew +++ b/gradlew @@ -82,6 +82,7 @@ esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -129,6 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath diff --git a/gradlew.bat b/gradlew.bat index 62bd9b9c..5093609d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -84,6 +84,7 @@ set CMD_LINE_ARGS=%* set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% From 7ce80a83d12e872898cc398a8751848551e0f43f Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 22 May 2020 09:51:13 +0200 Subject: [PATCH 074/135] Update dependencies, gradle and cmdline tools --- .travis.yml | 2 +- app/build.gradle.kts | 10 +++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index a75d06a6..b1e0f1e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ git: env: global: # for updates check (dl.google.com/android/repository/repository2-1.xml) - - ANDROID_SDK_CMD_TOOLS=commandlinetools-linux-6200805_latest.zip + - ANDROID_SDK_CMD_TOOLS=commandlinetools-linux-6502184_latest.zip # storepass, keypass, keyalias - secure: K4PVOrcYr6ZV16GgZWcw5RGDqxRTrilMK6pjz1r+RkQX6EPywmTsUH0y8EGP44bZc+TFMM0UfGPulHfrKzC3LDVSe+CpvNdQqq8c2Ysc9lQLubvFmVlWZ2rjHhA3jtg33FDIAWipb41WZEdmCJE1EI+OMbh8p8/7cGZ4K4tpd3B8ViXrf16ht50C56glL1lS3Jog/g9OEIPdhzYF23nYPOAeV3xJg3WBGxUUMOwp3vrpMJ/bYvnh/XLHUpPWnCcSWhKZolE3C6Itlv3CUdCyd2u8dnbTFX7KK0g4nrJdX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/build.gradle.kts b/app/build.gradle.kts index 7b8d2d36..73ce1d34 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -70,11 +70,11 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5-1.4-M1") // AndroidX - implementation("androidx.appcompat:appcompat:1.2.0-rc01") - implementation("androidx.core:core-ktx:1.3.0-rc01") - implementation("androidx.activity:activity:1.2.0-alpha04") - implementation("androidx.fragment:fragment:1.3.0-alpha04") - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha02") + implementation("androidx.appcompat:appcompat:1.3.0-alpha01") + implementation("androidx.core:core-ktx:1.4.0-alpha01") + implementation("androidx.activity:activity:1.2.0-alpha05") + implementation("androidx.fragment:fragment:1.3.0-alpha05") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha03") implementation("androidx.recyclerview:recyclerview:1.2.0-alpha03") implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta6") implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha01") diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 742fd254..503c88bb 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-milestone-1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-milestone-2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 44e60de8..61cfaa3e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -28,7 +28,7 @@ pluginManagement { } plugins { - id("com.gradle.enterprise") version "3.3" + id("com.gradle.enterprise") version "3.3.1" } gradleEnterprise { From 66608f82587533c95483709d4989857ea95a43f2 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 29 May 2020 11:52:12 +0200 Subject: [PATCH 075/135] Update android studio and deps, move plugin version numbers to gradle.properties --- .travis.yml | 4 ++-- app/build.gradle.kts | 16 +++++++--------- gradle.properties | 18 +++++++++++------- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 19 +++++++++---------- 5 files changed, 30 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index b1e0f1e2..6570d046 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,8 @@ git: depth: false env: global: - # for updates check (dl.google.com/android/repository/repository2-1.xml) - - ANDROID_SDK_CMD_TOOLS=commandlinetools-linux-6502184_latest.zip + # for updates check https://developer.android.com/studio#downloads + - ANDROID_SDK_CMD_TOOLS=commandlinetools-linux-6514223_latest.zip # storepass, keypass, keyalias - secure: K4PVOrcYr6ZV16GgZWcw5RGDqxRTrilMK6pjz1r+RkQX6EPywmTsUH0y8EGP44bZc+TFMM0UfGPulHfrKzC3LDVSe+CpvNdQqq8c2Ysc9lQLubvFmVlWZ2rjHhA3jtg33FDIAWipb41WZEdmCJE1EI+OMbh8p8/7cGZ4K4tpd3B8ViXrf16ht50C56glL1lS3Jog/g9OEIPdhzYF23nYPOAeV3xJg3WBGxUUMOwp3vrpMJ/bYvnh/XLHUpPWnCcSWhKZolE3C6Itlv3CUdCyd2u8dnbTFX7KK0g4nrJdXJAyith0aE2RB6APdDDIdZkF3p2qU3aWBWVvNzjGc6tYpP9OB8sjobcx9oG8lIaO09qZnM+fLTs5b3ulvl8d3UZI0KxgSocvjxpltrqeuNODGarzwIWAmjxKr3Qnfo5LFUna1UMxKJ1ARyT7zS9yUbfE6ek42aEe7rEaqryjNFE5X6b9D2WexN+68YynvdRfDXlFx2JIW3hWTi7AG4zBI0LKhhtruwLY1hKty3JR5/Dz/dIMW6JZUmLdE7drPmLNBcKRh1H778EOcaD+1q1bzVnwbA+HLfHkO9Rzmk7UOY1ttWzFBH23W/pI6D6mn4WTFng0/iOEsw7fwHaXPGv6ZXxserC/nzmeYb0AfK3wq2p2ztEDtbSblw9lkMBYlvNi5I8= - secure: SEcF7dl6ImTdeUYtw6dGeHRXbS4h8Ec9+Dnt2rFeobupo4e64818Fo10Uqqf+eM/5VVF2FAJLnEiq1SgfWZKjvUz9batJZNknc2JSKEGQPFaUD55USFCt2rxoLPFJKIee07kPTiXGPM2WWA+42cD+HpXAErMTd3BESsGwjni+xj2PhJuETDGrw+0D5T4TOXgd0uXNPl4p1PE+l3SejPqGQ961Wo+hbxd/y9JyZy/jZ9WW8XA6eEXXtecRY33NspwT58mBXDgZLIM/C3W0qfrGCiOPxwk0RpMo7YMbmYVPLG75AzihDtQ2F7P5edHz7v0yCAejrN23hi1LHb4Uku8tC2jzrH5eUpKfZuqap8DRcbdXq5je3oeuLSUu39FrzsDEmennS0eaD4jTsB5Sy2wld/UCmzV0QenUtPdBaFLU2Rxos3xJW4a2KyENRm5TGVNR/NAWpoacLed3zqDmb3K13WwskTGE1/mXRl+o0T0BVOBXuHXQ+nqATnGuAbw97LhhOeBZ/jA2yWBsaTxdjhB3E3uKWYZYdGIIgOwrZdM0RrVSgepg7NP+vh9iO70ckEzP+w4yws2ElKE3ZiOexEmrkFmqlxQW08b1FMaKJwpfsNiHkwW6u1jq1oeEBIzUrAMmo92uAjDAHKfn7FOsx5RVg20EKP9Rk9l2YKRA5dGJFI= diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 73ce1d34..56160f0f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -55,8 +55,6 @@ android { repositories { google() mavenCentral() - maven("https://dl.bintray.com/kotlin/kotlin-eap") - maven("https://kotlin.bintray.com/kotlinx") jcenter { content { includeModule("com.g00fy2", "versioncompare") @@ -67,7 +65,7 @@ repositories { dependencies { // Kotlin implementation(kotlin("stdlib-jdk7")) - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5-1.4-M1") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7") // AndroidX implementation("androidx.appcompat:appcompat:1.3.0-alpha01") @@ -80,16 +78,16 @@ dependencies { implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha01") // UI - implementation("com.google.android.material:material:1.2.0-alpha06") + implementation("com.google.android.material:material:1.2.0-beta01") // Misc implementation("com.jakewharton.timber:timber:4.7.1") implementation("com.g00fy2:versioncompare:1.3.4") // Dagger - implementation("com.google.dagger:dagger:2.27") - kapt("com.google.dagger:dagger-compiler:2.27") - implementation("com.google.dagger:dagger-android:2.27") - implementation("com.google.dagger:dagger-android-support:2.27") - kapt("com.google.dagger:dagger-android-processor:2.27") + implementation("com.google.dagger:dagger:2.28") + kapt("com.google.dagger:dagger-compiler:2.28") + implementation("com.google.dagger:dagger-android:2.28") + implementation("com.google.dagger:dagger-android-support:2.28") + kapt("com.google.dagger:dagger-android-processor:2.28") } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 5ae8c11c..db10eb5b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,20 +1,24 @@ +# Versions used for dependency resolution in settings.gradle.kts +kotlinVersion=1.3.71 +androidGradlePluginVersion=4.1.0-alpha10 +gradleEnterpriseVersion=3.3.3 + # Allow usage of AndroidX instead of the old support libraries. android.useAndroidX=true # Use R8 in full mode instead of ProGuard compatibility mode. android.enableR8.fullMode=true -# Enable rudimentary R class namespacing where each library only contains -# references to the resources it declares instead of declarations plus all -# transitive dependency references. +# Enable rudimentary R class namespacing where each library only contains references to the resources it declares +# instead of declarations plus all transitive dependency references. android.nonTransitiveRClass=true -# Only keep the single relevant constructor for types mentioned in XML files -# instead of using a parameter wildcard which keeps them all. +# Only keep the single relevant constructor for types mentioned in XML files instead of using a parameter wildcard which +# keeps them all. android.useMinimalKeepRules=true -# Enable supported AAPT2 optimize suboperations (ResourceObfuscation, -# SparseResourceEncoding, ResourcePathShortening) as an effort to reduce APK size. +# Enable supported AAPT2 optimize suboperations (ResourceObfuscation, SparseResourceEncoding, ResourcePathShortening) as +# an effort to reduce APK size. android.enableResourceOptimizations=true # Set the build VMs heap size. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 503c88bb..742fd254 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-milestone-2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-milestone-1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 61cfaa3e..fae233d7 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,11 +1,13 @@ include("app") pluginManagement { + val kotlinVersion: String by settings + val androidGradlePluginVersion: String by settings + val gradleEnterpriseVersion: String by settings repositories { google() gradlePluginPortal() mavenCentral() - maven("https://dl.bintray.com/kotlin/kotlin-eap") jcenter { content { includeModule("eu.appcom.gradle", "android-versioning") @@ -14,21 +16,18 @@ pluginManagement { } resolutionStrategy { eachPlugin { - if (requested.id.namespace == "com.android") { - useModule("com.android.tools.build:gradle:4.1.0-alpha09") - } - if (requested.id.id == "eu.appcom.gradle.android-versioning") { - useModule("eu.appcom.gradle:android-versioning:1.0.2") - } - if (requested.id.namespace == "org.jetbrains.kotlin") { - useVersion("1.4-M1") + when (requested.id.id) { + "com.android.application" -> useModule("com.android.tools.build:gradle:$androidGradlePluginVersion") + "eu.appcom.gradle.android-versioning" -> useModule("eu.appcom.gradle:android-versioning:1.0.2") + "com.gradle.enterprise" -> useVersion(gradleEnterpriseVersion) } + if (requested.id.namespace == "org.jetbrains.kotlin") useVersion(kotlinVersion) } } } plugins { - id("com.gradle.enterprise") version "3.3.1" + id("com.gradle.enterprise") } gradleEnterprise { From eb314e4e675750b932a2f09f079595d426208d2d Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sun, 31 May 2020 21:53:14 +0200 Subject: [PATCH 076/135] Update kotlin and make use of contextcompat --- .../activities/shortcut/CreateShortcutActivity.kt | 3 ++- .../kotlin/com/g00fy2/developerwidget/ktx/ViewExtension.kt | 3 ++- gradle.properties | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt index c7a37ba7..8f211fb8 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt @@ -14,6 +14,7 @@ import androidx.annotation.DrawableRes import androidx.annotation.RequiresApi import androidx.annotation.StringRes import androidx.appcompat.content.res.AppCompatResources +import androidx.core.content.ContextCompat import androidx.core.content.getSystemService import androidx.core.graphics.drawable.toBitmap import androidx.core.view.updatePadding @@ -47,7 +48,7 @@ class CreateShortcutActivity : BaseActivity(), CreateShortcutContract.CreateShor binding.recyclerview.setHasFixedSize(true) binding.recyclerview.layoutManager = LinearLayoutManager(this) binding.recyclerview.adapter = adapter - getDrawable(R.drawable.divider_line)?.let { + ContextCompat.getDrawable(this,R.drawable.divider_line)?.let { binding.recyclerview.addItemDecoration( DividerItemDecoration( this, diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/ViewExtension.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/ViewExtension.kt index 2af9f3da..aa86ea9d 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/ViewExtension.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/ViewExtension.kt @@ -8,6 +8,7 @@ import android.view.ViewGroup import android.view.WindowInsets import androidx.annotation.Px import androidx.annotation.RequiresApi +import androidx.core.content.ContextCompat import androidx.core.view.marginBottom import androidx.core.view.marginLeft import androidx.core.view.marginRight @@ -17,7 +18,7 @@ fun View.addRipple(asForeground: Boolean = false) { TypedValue().apply { context.theme.resolveAttribute(android.R.attr.selectableItemBackground, this, true) } .resourceId.let { if (VERSION.SDK_INT < VERSION_CODES.M || !asForeground) setBackgroundResource(it) else foreground = - context.getDrawable(it) + ContextCompat.getDrawable(context, it) } } diff --git a/gradle.properties b/gradle.properties index db10eb5b..a4a1da6f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Versions used for dependency resolution in settings.gradle.kts -kotlinVersion=1.3.71 +kotlinVersion=1.3.72 androidGradlePluginVersion=4.1.0-alpha10 gradleEnterpriseVersion=3.3.3 From 1a3c59dabad030f750bf6ee840d17798499a7419 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 3 Jun 2020 21:31:08 +0200 Subject: [PATCH 077/135] Update MDC and disable dependenciesInfo for APKs --- app/build.gradle.kts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 56160f0f..42941807 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -40,6 +40,10 @@ android { buildFeatures { viewBinding = true } + dependenciesInfo { + includeInApk = false + includeInBundle = true + } sourceSets { getByName("main").java.srcDirs("src/main/kotlin") } @@ -78,7 +82,7 @@ dependencies { implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha01") // UI - implementation("com.google.android.material:material:1.2.0-beta01") + implementation("com.google.android.material:material:1.3.0-alpha01") // Misc implementation("com.jakewharton.timber:timber:4.7.1") From 17890e197cb3b13c9f5e07bff54174401280131c Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 5 Jun 2020 21:03:14 +0200 Subject: [PATCH 078/135] Switch to new versioning plugin --- app/build.gradle.kts | 4 ++-- settings.gradle.kts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 42941807..d3d38405 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -2,7 +2,7 @@ plugins { id("com.android.application") kotlin("android") kotlin("kapt") - id("eu.appcom.gradle.android-versioning") + id("eu.nanogiants.android-versioning") } android { @@ -16,7 +16,7 @@ android { versionName = versioning.getVersionName() vectorDrawables.useSupportLibrary = true - setProperty("archivesBaseName", "developerwidget-$versionName-$versionCode") + setProperty("archivesBaseName", "developerwidget") } signingConfigs { create("release") { diff --git a/settings.gradle.kts b/settings.gradle.kts index fae233d7..d95d0dd7 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -10,7 +10,7 @@ pluginManagement { mavenCentral() jcenter { content { - includeModule("eu.appcom.gradle", "android-versioning") + includeModule("eu.nanogiants", "android-versioning") } } } @@ -18,7 +18,7 @@ pluginManagement { eachPlugin { when (requested.id.id) { "com.android.application" -> useModule("com.android.tools.build:gradle:$androidGradlePluginVersion") - "eu.appcom.gradle.android-versioning" -> useModule("eu.appcom.gradle:android-versioning:1.0.2") + "eu.nanogiants.android-versioning" -> useModule("eu.nanogiants:android-versioning:2.0.1") "com.gradle.enterprise" -> useVersion(gradleEnterpriseVersion) } if (requested.id.namespace == "org.jetbrains.kotlin") useVersion(kotlinVersion) From 7e8c6840de5cf9306b6a2ad9bdb6e250bb1eb9eb Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Mon, 8 Jun 2020 12:28:19 +0200 Subject: [PATCH 079/135] Update versioning plugin --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index d95d0dd7..4a61da1b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -18,7 +18,7 @@ pluginManagement { eachPlugin { when (requested.id.id) { "com.android.application" -> useModule("com.android.tools.build:gradle:$androidGradlePluginVersion") - "eu.nanogiants.android-versioning" -> useModule("eu.nanogiants:android-versioning:2.0.1") + "eu.nanogiants.android-versioning" -> useModule("eu.nanogiants:android-versioning:2.1.1") "com.gradle.enterprise" -> useVersion(gradleEnterpriseVersion) } if (requested.id.namespace == "org.jetbrains.kotlin") useVersion(kotlinVersion) From d9b6fba97946e3c6a5cde0a3aa7c3d488510f7ee Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Mon, 8 Jun 2020 12:40:33 +0200 Subject: [PATCH 080/135] Fix mapping upload --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6570d046..db549f93 100644 --- a/.travis.yml +++ b/.travis.yml @@ -81,7 +81,7 @@ jobs: file: - $TRAVIS_BUILD_DIR/app/build/outputs/bundle/release/*.aab - $TRAVIS_BUILD_DIR/app/build/outputs/apk/release/*.apk - - $TRAVIS_BUILD_DIR/app/build/outputs/mapping/release/mapping.txt + - $TRAVIS_BUILD_DIR/app/build/outputs/mapping/release/*mapping.txt draft: false on: tags: true From 43d86b2b848d5777811929156d41216354d08275 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 11 Jun 2020 01:32:13 +0200 Subject: [PATCH 081/135] Update android studio, target sdk 30, gradle, dependencies and plugins --- app/build.gradle.kts | 14 +++++++------- gradle.properties | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d3d38405..b380689f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -6,12 +6,12 @@ plugins { } android { - compileSdkVersion(29) - buildToolsVersion = "29.0.3" + compileSdkVersion(30) + buildToolsVersion = "30.0.0" defaultConfig { applicationId = "com.g00fy2.developerwidget" minSdkVersion(14) - targetSdkVersion(29) + targetSdkVersion(30) versionCode = versioning.getVersionCode() versionName = versioning.getVersionName() @@ -73,10 +73,10 @@ dependencies { // AndroidX implementation("androidx.appcompat:appcompat:1.3.0-alpha01") - implementation("androidx.core:core-ktx:1.4.0-alpha01") - implementation("androidx.activity:activity:1.2.0-alpha05") - implementation("androidx.fragment:fragment:1.3.0-alpha05") - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha03") + implementation("androidx.core:core-ktx:1.5.0-alpha01") + implementation("androidx.activity:activity:1.2.0-alpha06") + implementation("androidx.fragment:fragment:1.3.0-alpha06") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha04") implementation("androidx.recyclerview:recyclerview:1.2.0-alpha03") implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta6") implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha01") diff --git a/gradle.properties b/gradle.properties index a4a1da6f..6e69b8e5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ # Versions used for dependency resolution in settings.gradle.kts kotlinVersion=1.3.72 -androidGradlePluginVersion=4.1.0-alpha10 -gradleEnterpriseVersion=3.3.3 +androidGradlePluginVersion=4.2.0-alpha01 +gradleEnterpriseVersion=3.3.4 # Allow usage of AndroidX instead of the old support libraries. android.useAndroidX=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 742fd254..186b7155 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-milestone-1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 4a61da1b..4029df4b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -18,7 +18,7 @@ pluginManagement { eachPlugin { when (requested.id.id) { "com.android.application" -> useModule("com.android.tools.build:gradle:$androidGradlePluginVersion") - "eu.nanogiants.android-versioning" -> useModule("eu.nanogiants:android-versioning:2.1.1") + "eu.nanogiants.android-versioning" -> useModule("eu.nanogiants:android-versioning:2.2.0") "com.gradle.enterprise" -> useVersion(gradleEnterpriseVersion) } if (requested.id.namespace == "org.jetbrains.kotlin") useVersion(kotlinVersion) From 808a8d7842d58e871cf74cfc8fe675d0bfe6f258 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sun, 14 Jun 2020 20:31:16 +0200 Subject: [PATCH 082/135] Update versioning plugin --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 4029df4b..413bdb87 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -18,7 +18,7 @@ pluginManagement { eachPlugin { when (requested.id.id) { "com.android.application" -> useModule("com.android.tools.build:gradle:$androidGradlePluginVersion") - "eu.nanogiants.android-versioning" -> useModule("eu.nanogiants:android-versioning:2.2.0") + "eu.nanogiants.android-versioning" -> useModule("eu.nanogiants:android-versioning:2.2.1") "com.gradle.enterprise" -> useVersion(gradleEnterpriseVersion) } if (requested.id.namespace == "org.jetbrains.kotlin") useVersion(kotlinVersion) From b4201a1d8ea6683c2bf56fbf0926e5253c207bbd Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Mon, 15 Jun 2020 11:58:22 +0200 Subject: [PATCH 083/135] Update plugins and deps --- app/build.gradle.kts | 4 ++-- settings.gradle.kts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b380689f..9c36efcc 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -2,7 +2,7 @@ plugins { id("com.android.application") kotlin("android") kotlin("kapt") - id("eu.nanogiants.android-versioning") + id("de.nanogiants.android-versioning") } android { @@ -78,7 +78,7 @@ dependencies { implementation("androidx.fragment:fragment:1.3.0-alpha06") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha04") implementation("androidx.recyclerview:recyclerview:1.2.0-alpha03") - implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta6") + implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta7") implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha01") // UI diff --git a/settings.gradle.kts b/settings.gradle.kts index 413bdb87..f2feac5e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -18,7 +18,7 @@ pluginManagement { eachPlugin { when (requested.id.id) { "com.android.application" -> useModule("com.android.tools.build:gradle:$androidGradlePluginVersion") - "eu.nanogiants.android-versioning" -> useModule("eu.nanogiants:android-versioning:2.2.1") + "de.nanogiants.android-versioning" -> useModule("de.nanogiants:android-versioning:2.3.0") "com.gradle.enterprise" -> useVersion(gradleEnterpriseVersion) } if (requested.id.namespace == "org.jetbrains.kotlin") useVersion(kotlinVersion) From 05fc0b0b49e979e441f71ac515a10fae3fa3b1a7 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Tue, 16 Jun 2020 20:55:30 +0200 Subject: [PATCH 084/135] Update to kotlin 1.4 eap and fix lint warnings --- app/build.gradle.kts | 4 +++- .../developerwidget/activities/apkinstall/ApkActivity.kt | 4 ++-- .../activities/apkinstall/dialogs/PermissionsAdapter.kt | 3 +-- .../developerwidget/activities/appmanager/AppsActivity.kt | 4 ++-- .../developerwidget/activities/appmanager/AppsAdapter.kt | 2 +- .../developerwidget/activities/shortcut/ShortcutAdapter.kt | 2 +- .../activities/widgetconfig/DeviceDataAdapter.kt | 4 ++-- gradle.properties | 2 +- settings.gradle.kts | 3 ++- 9 files changed, 15 insertions(+), 13 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9c36efcc..be1fdd3c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -65,11 +65,13 @@ repositories { includeModule("org.jetbrains.trove4j", "trove4j") // required by com.android.tools.lint:lint-gradle } } + maven ("https://dl.bintray.com/kotlin/kotlin-eap") + maven("https://kotlin.bintray.com/kotlinx") } dependencies { // Kotlin implementation(kotlin("stdlib-jdk7")) - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7-1.4-M2") // AndroidX implementation("androidx.appcompat:appcompat:1.3.0-alpha01") diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt index ddfcca21..80bf8e20 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt @@ -26,13 +26,13 @@ class ApkActivity : BaseActivity(true), ApkContract.ApkView { adapter = ApkAdapter() adapter.setOnApkClicked { apkFile -> presenter.installOrShowPermissionWarning(apkFile) } adapter.setOnApkSelect { selectedCount -> showOptions(selectedCount > 0) } - adapter.setCommitCallback(Runnable { + adapter.setCommitCallback { adapter.itemCount.let { binding.recyclerview.overScrollMode = if (it == 0) View.OVER_SCROLL_NEVER else View.OVER_SCROLL_ALWAYS binding.noItemsTextview.visibility = if (it == 0) View.VISIBLE else View.INVISIBLE binding.noItemsImageview.visibility = if (it == 0) View.VISIBLE else View.INVISIBLE } - }) + } binding.recyclerview.setHasFixedSize(true) binding.recyclerview.layoutManager = LinearLayoutManager(this) binding.recyclerview.adapter = adapter diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/PermissionsAdapter.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/PermissionsAdapter.kt index ddb72575..84b7d1f2 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/PermissionsAdapter.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/dialogs/PermissionsAdapter.kt @@ -9,8 +9,7 @@ import com.g00fy2.developerwidget.databinding.PermissionItemBinding class PermissionsAdapter : BaseAdapter, PermissionViewHolder>(null) { - inner class PermissionViewHolder(val binding: PermissionItemBinding) : - BaseViewHolder>(binding) { + class PermissionViewHolder(val binding: PermissionItemBinding) : BaseViewHolder>(binding) { override fun onBind(item: Pair) { item.run { binding.permissionTitle.text = item.first diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsActivity.kt index 9d97a6e5..198ea881 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsActivity.kt @@ -46,7 +46,7 @@ class AppsActivity : BaseActivity(true), AppsContract.AppsView { override fun initView() { adapter = AppsAdapter() adapter.setOnAppClicked { appInfo -> presenter.openAppSettingsActivity(appInfo) } - adapter.setCommitCallback(Runnable { + adapter.setCommitCallback { adapter.itemCount.let { binding.noItemsTextview.visibility = if (it == 0) View.VISIBLE else View.INVISIBLE binding.noItemsImageview.visibility = if (it == 0) View.VISIBLE else View.INVISIBLE @@ -56,7 +56,7 @@ class AppsActivity : BaseActivity(true), AppsContract.AppsView { scrollToTopAfterCommit = false binding.recyclerview.scrollToPosition(0) } - }) + } binding.recyclerview.setHasFixedSize(true) binding.recyclerview.itemAnimator = null binding.recyclerview.layoutManager = LinearLayoutManager(this) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt index 8a6bf96b..e8dc8bf1 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/appmanager/AppsAdapter.kt @@ -17,7 +17,7 @@ class AppsAdapter : BaseAdapter(AppsDiffUtilsCallback()) private var onAppClicked: ((AppInfo?) -> Unit) = {} private var itemsCopy = ArrayList() - inner class AppViewHolder(val binding: AppItemBinding) : BaseViewHolder(binding) { + class AppViewHolder(val binding: AppItemBinding) : BaseViewHolder(binding) { override fun onBind(item: AppInfo) { item.run { binding.appenameTextview.text = appName diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/ShortcutAdapter.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/ShortcutAdapter.kt index 3c79aa9b..16d5c2dc 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/ShortcutAdapter.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/ShortcutAdapter.kt @@ -15,7 +15,7 @@ class ShortcutAdapter : BaseAdapter(ShortcutDi private var onShortcutSelected: ((Int) -> Unit) = {} - inner class ShortcutViewHolder(val binding: ShortcutItemBinding) : BaseViewHolder(binding) { + class ShortcutViewHolder(val binding: ShortcutItemBinding) : BaseViewHolder(binding) { override fun onBind(item: ShortcutInfo) { item.run { binding.shortcutTitleTextview.text = item.longLabel ?: item.shortLabel ?: "" diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/DeviceDataAdapter.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/DeviceDataAdapter.kt index 6188deb8..ff8cebe4 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/DeviceDataAdapter.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/DeviceDataAdapter.kt @@ -12,7 +12,7 @@ import com.g00fy2.developerwidget.databinding.DeviceDataValueItemBinding class DeviceDataAdapter : BaseAdapter, BaseViewHolder>>(DeviceDataDiffUtilsCallback()) { - inner class DeviceDataHeaderViewHolder(val binding: DeviceDataHeaderItemBinding) : + class DeviceDataHeaderViewHolder(val binding: DeviceDataHeaderItemBinding) : BaseViewHolder>(binding) { override fun onBind(item: Pair) { item.run { @@ -22,7 +22,7 @@ class DeviceDataAdapter : } } - inner class DeviceDataValueViewHolder(val binding: DeviceDataValueItemBinding) : + class DeviceDataValueViewHolder(val binding: DeviceDataValueItemBinding) : BaseViewHolder>(binding) { override fun onBind(item: Pair) { item.run { diff --git a/gradle.properties b/gradle.properties index 6e69b8e5..0a8056dd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Versions used for dependency resolution in settings.gradle.kts -kotlinVersion=1.3.72 +kotlinVersion=1.4-M2 androidGradlePluginVersion=4.2.0-alpha01 gradleEnterpriseVersion=3.3.4 diff --git a/settings.gradle.kts b/settings.gradle.kts index f2feac5e..df4c8674 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -13,12 +13,13 @@ pluginManagement { includeModule("eu.nanogiants", "android-versioning") } } + maven ("https://dl.bintray.com/kotlin/kotlin-eap") } resolutionStrategy { eachPlugin { when (requested.id.id) { "com.android.application" -> useModule("com.android.tools.build:gradle:$androidGradlePluginVersion") - "de.nanogiants.android-versioning" -> useModule("de.nanogiants:android-versioning:2.3.0") + "de.nanogiants.android-versioning" -> useModule("de.nanogiants:android-versioning:2.3.1") "com.gradle.enterprise" -> useVersion(gradleEnterpriseVersion) } if (requested.id.namespace == "org.jetbrains.kotlin") useVersion(kotlinVersion) From f8135d23d38ee3d35384790752f10cc7ada5fdf1 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Tue, 16 Jun 2020 20:57:07 +0200 Subject: [PATCH 085/135] Improve sdk 30 compatibility and handle deprecations --- app/src/main/AndroidManifest.xml | 14 +++++++- .../activities/about/AboutActivity.kt | 3 +- .../shortcut/CreateShortcutActivity.kt | 3 +- .../widgetconfig/WidgetConfigActivity.kt | 5 +-- .../developerwidget/base/BaseActivity.kt | 20 +++++++---- .../device/display/DisplayDataProvider.kt | 18 ++++++++-- .../ktx/WindowInsetsExtensions.kt | 34 +++++++++++++++++++ 7 files changed, 84 insertions(+), 13 deletions(-) create mode 100644 app/src/main/kotlin/com/g00fy2/developerwidget/ktx/WindowInsetsExtensions.kt diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1ef531ce..a87cfe18 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,17 +6,29 @@ + + + + + + tools:targetApi="r"> = VERSION_CODES.O_MR1) { binding.aboutRootScrollview.apply { doOnApplyWindowInsets { _, insets, padding, _ -> - updatePadding(bottom = padding.bottom + insets.systemWindowInsetBottom) + updatePadding(bottom = padding.bottom + insets.systemWindowInsetBottomCompat) } viewTreeObserver.addOnScrollChangedListener { val scrollableRange = getChildAt(0).bottom - height + paddingBottom diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt index 8f211fb8..4c4354bb 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt @@ -27,6 +27,7 @@ import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.base.BaseContract.BasePresenter import com.g00fy2.developerwidget.databinding.ActivityCreateShortcutBinding import com.g00fy2.developerwidget.ktx.doOnApplyWindowInsets +import com.g00fy2.developerwidget.ktx.systemWindowInsetBottomCompat import javax.inject.Inject @RequiresApi(VERSION_CODES.N_MR1) @@ -61,7 +62,7 @@ class CreateShortcutActivity : BaseActivity(), CreateShortcutContract.CreateShor adapter.setOnShortcutSelected { shortcutPosition -> onItemClick(shortcutPosition) } if (VERSION.SDK_INT >= VERSION_CODES.O_MR1) { binding.root.doOnApplyWindowInsets { view, insets, padding, _ -> - view.updatePadding(bottom = padding.bottom + insets.systemWindowInsetBottom) + view.updatePadding(bottom = padding.bottom + insets.systemWindowInsetBottomCompat) } } } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt index f5211a57..13498103 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt @@ -37,6 +37,7 @@ import com.g00fy2.developerwidget.databinding.ActivityWidgetConfigBinding import com.g00fy2.developerwidget.ktx.doOnApplyWindowInsets import com.g00fy2.developerwidget.ktx.hideKeyboard import com.g00fy2.developerwidget.ktx.showKeyboard +import com.g00fy2.developerwidget.ktx.systemWindowInsetBottomCompat import com.g00fy2.developerwidget.ktx.updateMargin import com.g00fy2.developerwidget.receiver.widget.WidgetProviderImpl import javax.inject.Inject @@ -130,10 +131,10 @@ class WidgetConfigActivity : BaseActivity(), WidgetConfigContract.WidgetConfigVi binding.shareFab.setOnClickListener { presenter.shareDeviceData() } if (VERSION.SDK_INT >= VERSION_CODES.O_MR1) { binding.widgetConfigRootScrollview.doOnApplyWindowInsets { view, insets, padding, _ -> - view.updatePadding(bottom = padding.bottom + insets.systemWindowInsetBottom) + view.updatePadding(bottom = padding.bottom + insets.systemWindowInsetBottomCompat) } binding.shareFab.doOnApplyWindowInsets { view, insets, _, margin -> - view.updateMargin(bottom = margin.bottom + insets.systemWindowInsetBottom) + view.updateMargin(bottom = margin.bottom + insets.systemWindowInsetBottomCompat) } } } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt index 13663f20..ddaecb0f 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt @@ -14,6 +14,8 @@ import androidx.viewbinding.ViewBinding import com.g00fy2.developerwidget.R import com.g00fy2.developerwidget.controllers.DayNightController import com.g00fy2.developerwidget.ktx.doOnApplyWindowInsets +import com.g00fy2.developerwidget.ktx.systemGestureInsetsCompat +import com.g00fy2.developerwidget.ktx.systemWindowInsetTopCompat import dagger.android.support.DaggerAppCompatActivity import timber.log.Timber import javax.inject.Inject @@ -85,7 +87,7 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag protected fun isGesturalNavMode(): Boolean { return if (VERSION.SDK_INT >= VERSION_CODES.Q) { - window.decorView.rootWindowInsets?.systemGestureInsets?.let { it.left > 0 } ?: false + window.decorView.rootWindowInsets?.systemGestureInsetsCompat?.let { it.left > 0 } ?: false } else { false } @@ -93,20 +95,26 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag private fun initGestureNavigation() { if (VERSION.SDK_INT >= VERSION_CODES.O_MR1) { - window.decorView.let { - it.systemUiVisibility.let { flags -> - it.systemUiVisibility = - flags or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_STABLE + if (VERSION.SDK_INT >= VERSION_CODES.R) { + window.setDecorFitsSystemWindows(true) + } else { + @Suppress("DEPRECATION") + window.decorView.let { + it.systemUiVisibility.let { flags -> + it.systemUiVisibility = + flags or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_STABLE + } } } findViewById(Window.ID_ANDROID_CONTENT)?.let { it.doOnApplyWindowInsets { view, insets, padding, _ -> - view.updatePadding(top = padding.top + insets.systemWindowInsetTop) + view.updatePadding(top = padding.top + insets.systemWindowInsetTopCompat) } } } } + @Suppress("DEPRECATION") private fun initCompatNavigationBar() { // api 27+ allow applying flag via xml (windowLightNavigationBar) if (VERSION.SDK_INT == VERSION_CODES.O && !isNightMode()) { diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/display/DisplayDataProvider.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/display/DisplayDataProvider.kt index c2469d0a..f15a2bec 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/display/DisplayDataProvider.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/display/DisplayDataProvider.kt @@ -3,7 +3,10 @@ package com.g00fy2.developerwidget.data.device.display import android.annotation.SuppressLint import android.content.Context import android.graphics.Point +import android.os.Build.VERSION +import android.os.Build.VERSION_CODES import android.util.DisplayMetrics +import android.view.Display import android.view.WindowManager import androidx.core.content.getSystemService import java.text.NumberFormat @@ -13,11 +16,12 @@ object DisplayDataProvider { @SuppressLint("NewApi") fun getResolution(context: Context): Point? { - context.getSystemService()?.defaultDisplay?.let { windowManager -> + getDisplay(context)?.let { windowManager -> Point().let { point -> try { windowManager.getRealSize(point) } catch (e: NoSuchMethodError) { + @Suppress("DEPRECATION") windowManager.getSize(point) } return point @@ -28,11 +32,12 @@ object DisplayDataProvider { @SuppressLint("NewApi") fun geDisplayDpi(context: Context): String { - context.getSystemService()?.defaultDisplay?.let { windowManager -> + getDisplay(context)?.let { windowManager -> DisplayMetrics().let { displayMetrics -> try { windowManager.getRealMetrics(displayMetrics) } catch (e: NoSuchMethodError) { + @Suppress("DEPRECATION") windowManager.getMetrics(displayMetrics) } return displayMetrics.xdpi.roundToInt().toString() + " / " + displayMetrics.ydpi.roundToInt() + " dpi" @@ -67,6 +72,15 @@ object DisplayDataProvider { return result + if (altResult.isBlank()) "" else " ($altResult)" } + private fun getDisplay(context: Context): Display? { + return if (VERSION.SDK_INT >= VERSION_CODES.R) { + context.display + } else { + @Suppress("DEPRECATION") + context.getSystemService()?.defaultDisplay + } + } + private fun gcd(p: Int, q: Int): Int { return if (q == 0) p else gcd(q, p % q) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/WindowInsetsExtensions.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/WindowInsetsExtensions.kt new file mode 100644 index 00000000..0dc56602 --- /dev/null +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/WindowInsetsExtensions.kt @@ -0,0 +1,34 @@ +package com.g00fy2.developerwidget.ktx + +import android.graphics.Insets +import android.os.Build.VERSION +import android.os.Build.VERSION_CODES +import android.view.WindowInsets +import androidx.annotation.RequiresApi + +@Suppress("DEPRECATION") +val WindowInsets.systemGestureInsetsCompat: Insets + @RequiresApi(VERSION_CODES.Q) + get() = if (VERSION.SDK_INT >= VERSION_CODES.R) { + getInsets(WindowInsets.Type.systemGestures()) + } else { + systemGestureInsets + } + +@Suppress("DEPRECATION") +val WindowInsets.systemWindowInsetTopCompat: Int + @RequiresApi(VERSION_CODES.Q) + get() = if (VERSION.SDK_INT >= VERSION_CODES.R) { + getInsets(WindowInsets.Type.systemBars()).top + } else { + systemWindowInsetTop + } + +@Suppress("DEPRECATION") +val WindowInsets.systemWindowInsetBottomCompat: Int + @RequiresApi(VERSION_CODES.Q) + get() = if (VERSION.SDK_INT >= VERSION_CODES.R) { + getInsets(WindowInsets.Type.systemBars()).bottom + } else { + systemWindowInsetBottom + } \ No newline at end of file From 7535ed93c6bcad57466ed4734c947cfb75049b1a Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sun, 21 Jun 2020 10:45:28 +0200 Subject: [PATCH 086/135] Update android studio and versioning plugin --- gradle.properties | 3 ++- settings.gradle.kts | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0a8056dd..7c89e8cd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,7 @@ # Versions used for dependency resolution in settings.gradle.kts kotlinVersion=1.4-M2 -androidGradlePluginVersion=4.2.0-alpha01 +androidGradlePluginVersion=4.2.0-alpha02 +nanogiantsVersioning=2.3.1 gradleEnterpriseVersion=3.3.4 # Allow usage of AndroidX instead of the old support libraries. diff --git a/settings.gradle.kts b/settings.gradle.kts index df4c8674..57a3f637 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,23 +3,19 @@ include("app") pluginManagement { val kotlinVersion: String by settings val androidGradlePluginVersion: String by settings + val nanogiantsVersioning: String by settings val gradleEnterpriseVersion: String by settings repositories { google() gradlePluginPortal() mavenCentral() - jcenter { - content { - includeModule("eu.nanogiants", "android-versioning") - } - } maven ("https://dl.bintray.com/kotlin/kotlin-eap") } resolutionStrategy { eachPlugin { when (requested.id.id) { "com.android.application" -> useModule("com.android.tools.build:gradle:$androidGradlePluginVersion") - "de.nanogiants.android-versioning" -> useModule("de.nanogiants:android-versioning:2.3.1") + "de.nanogiants.android-versioning" -> useVersion(nanogiantsVersioning) "com.gradle.enterprise" -> useVersion(gradleEnterpriseVersion) } if (requested.id.namespace == "org.jetbrains.kotlin") useVersion(kotlinVersion) From af352fef5f373c03ee6c2970dfdf1633330b0026 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Tue, 23 Jun 2020 11:34:40 +0200 Subject: [PATCH 087/135] Update dagger --- app/build.gradle.kts | 10 +++++----- app/src/main/AndroidManifest.xml | 8 -------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index be1fdd3c..b46b2e31 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -91,9 +91,9 @@ dependencies { implementation("com.g00fy2:versioncompare:1.3.4") // Dagger - implementation("com.google.dagger:dagger:2.28") - kapt("com.google.dagger:dagger-compiler:2.28") - implementation("com.google.dagger:dagger-android:2.28") - implementation("com.google.dagger:dagger-android-support:2.28") - kapt("com.google.dagger:dagger-android-processor:2.28") + implementation("com.google.dagger:dagger:2.28.1") + kapt("com.google.dagger:dagger-compiler:2.28.1") + implementation("com.google.dagger:dagger-android:2.28.1") + implementation("com.google.dagger:dagger-android-support:2.28.1") + kapt("com.google.dagger:dagger-android-processor:2.28.1") } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a87cfe18..3d3e0d35 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -10,14 +10,6 @@ android:name="android.permission.QUERY_ALL_PACKAGES" tools:ignore="QueryAllPackagesPermission"/> - - - - Date: Tue, 23 Jun 2020 11:34:56 +0200 Subject: [PATCH 088/135] Update cmd line tools --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index db549f93..954723db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ git: env: global: # for updates check https://developer.android.com/studio#downloads - - ANDROID_SDK_CMD_TOOLS=commandlinetools-linux-6514223_latest.zip + - ANDROID_SDK_CMD_TOOLS=commandlinetools-linux-6609375_latest.zip # storepass, keypass, keyalias - secure: K4PVOrcYr6ZV16GgZWcw5RGDqxRTrilMK6pjz1r+RkQX6EPywmTsUH0y8EGP44bZc+TFMM0UfGPulHfrKzC3LDVSe+CpvNdQqq8c2Ysc9lQLubvFmVlWZ2rjHhA3jtg33FDIAWipb41WZEdmCJE1EI+OMbh8p8/7cGZ4K4tpd3B8ViXrf16ht50C56glL1lS3Jog/g9OEIPdhzYF23nYPOAeV3xJg3WBGxUUMOwp3vrpMJ/bYvnh/XLHUpPWnCcSWhKZolE3C6Itlv3CUdCyd2u8dnbTFX7KK0g4nrJdXJAyith0aE2RB6APdDDIdZkF3p2qU3aWBWVvNzjGc6tYpP9OB8sjobcx9oG8lIaO09qZnM+fLTs5b3ulvl8d3UZI0KxgSocvjxpltrqeuNODGarzwIWAmjxKr3Qnfo5LFUna1UMxKJ1ARyT7zS9yUbfE6ek42aEe7rEaqryjNFE5X6b9D2WexN+68YynvdRfDXlFx2JIW3hWTi7AG4zBI0LKhhtruwLY1hKty3JR5/Dz/dIMW6JZUmLdE7drPmLNBcKRh1H778EOcaD+1q1bzVnwbA+HLfHkO9Rzmk7UOY1ttWzFBH23W/pI6D6mn4WTFng0/iOEsw7fwHaXPGv6ZXxserC/nzmeYb0AfK3wq2p2ztEDtbSblw9lkMBYlvNi5I8= - secure: SEcF7dl6ImTdeUYtw6dGeHRXbS4h8Ec9+Dnt2rFeobupo4e64818Fo10Uqqf+eM/5VVF2FAJLnEiq1SgfWZKjvUz9batJZNknc2JSKEGQPFaUD55USFCt2rxoLPFJKIee07kPTiXGPM2WWA+42cD+HpXAErMTd3BESsGwjni+xj2PhJuETDGrw+0D5T4TOXgd0uXNPl4p1PE+l3SejPqGQ961Wo+hbxd/y9JyZy/jZ9WW8XA6eEXXtecRY33NspwT58mBXDgZLIM/C3W0qfrGCiOPxwk0RpMo7YMbmYVPLG75AzihDtQ2F7P5edHz7v0yCAejrN23hi1LHb4Uku8tC2jzrH5eUpKfZuqap8DRcbdXq5je3oeuLSUu39FrzsDEmennS0eaD4jTsB5Sy2wld/UCmzV0QenUtPdBaFLU2Rxos3xJW4a2KyENRm5TGVNR/NAWpoacLed3zqDmb3K13WwskTGE1/mXRl+o0T0BVOBXuHXQ+nqATnGuAbw97LhhOeBZ/jA2yWBsaTxdjhB3E3uKWYZYdGIIgOwrZdM0RrVSgepg7NP+vh9iO70ckEzP+w4yws2ElKE3ZiOexEmrkFmqlxQW08b1FMaKJwpfsNiHkwW6u1jq1oeEBIzUrAMmo92uAjDAHKfn7FOsx5RVg20EKP9Rk9l2YKRA5dGJFI= From 2d5ebb1bab66bdab356cda28655c60f12b4961dd Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 25 Jun 2020 17:12:13 +0200 Subject: [PATCH 089/135] Fix crash on api 30 --- .../data/device/display/DisplayDataProvider.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/display/DisplayDataProvider.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/display/DisplayDataProvider.kt index f15a2bec..ed6dd182 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/display/DisplayDataProvider.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/data/device/display/DisplayDataProvider.kt @@ -16,7 +16,7 @@ object DisplayDataProvider { @SuppressLint("NewApi") fun getResolution(context: Context): Point? { - getDisplay(context)?.let { windowManager -> + getDisplay(context)?.let { windowManager -> Point().let { point -> try { windowManager.getRealSize(point) @@ -73,12 +73,15 @@ object DisplayDataProvider { } private fun getDisplay(context: Context): Display? { - return if (VERSION.SDK_INT >= VERSION_CODES.R) { - context.display - } else { - @Suppress("DEPRECATION") - context.getSystemService()?.defaultDisplay + if (VERSION.SDK_INT >= VERSION_CODES.R) { + try { + return context.display + } catch (e: UnsupportedOperationException) { + // expected if context is not am Activity or created with Context#createWindowContext + } } + @Suppress("DEPRECATION") + return context.getSystemService()?.defaultDisplay } private fun gcd(p: Int, q: Int): Int { From e4f66d6cb906a16680cd982df1a18dc15a1a0cb2 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 25 Jun 2020 17:47:10 +0200 Subject: [PATCH 090/135] Update deps and gradle --- app/build.gradle.kts | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b46b2e31..3bf54c40 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -78,8 +78,8 @@ dependencies { implementation("androidx.core:core-ktx:1.5.0-alpha01") implementation("androidx.activity:activity:1.2.0-alpha06") implementation("androidx.fragment:fragment:1.3.0-alpha06") - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha04") - implementation("androidx.recyclerview:recyclerview:1.2.0-alpha03") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha05") + implementation("androidx.recyclerview:recyclerview:1.2.0-alpha04") implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta7") implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha01") diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 186b7155..666abc9c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-milestone-2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 06bdc3868c4956149eaa9e7f563be181046de2d7 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 25 Jun 2020 17:47:43 +0200 Subject: [PATCH 091/135] Fix insets behaviour on api 30 --- .../developerwidget/base/BaseActivity.kt | 19 ++++++++----------- .../ktx/WindowInsetsExtensions.kt | 6 +++--- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt index ddaecb0f..2217e5b4 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt @@ -15,7 +15,7 @@ import com.g00fy2.developerwidget.R import com.g00fy2.developerwidget.controllers.DayNightController import com.g00fy2.developerwidget.ktx.doOnApplyWindowInsets import com.g00fy2.developerwidget.ktx.systemGestureInsetsCompat -import com.g00fy2.developerwidget.ktx.systemWindowInsetTopCompat +import com.g00fy2.developerwidget.ktx.systemWindowInsetTopVisibleCompat import dagger.android.support.DaggerAppCompatActivity import timber.log.Timber import javax.inject.Inject @@ -95,20 +95,17 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag private fun initGestureNavigation() { if (VERSION.SDK_INT >= VERSION_CODES.O_MR1) { - if (VERSION.SDK_INT >= VERSION_CODES.R) { - window.setDecorFitsSystemWindows(true) - } else { - @Suppress("DEPRECATION") - window.decorView.let { - it.systemUiVisibility.let { flags -> - it.systemUiVisibility = - flags or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_STABLE - } + @Suppress("DEPRECATION") + window.decorView.let { + it.systemUiVisibility.let { flags -> + it.systemUiVisibility = + flags or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_STABLE } } + findViewById(Window.ID_ANDROID_CONTENT)?.let { it.doOnApplyWindowInsets { view, insets, padding, _ -> - view.updatePadding(top = padding.top + insets.systemWindowInsetTopCompat) + view.updatePadding(top = padding.top + insets.systemWindowInsetTopVisibleCompat) } } } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/WindowInsetsExtensions.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/WindowInsetsExtensions.kt index 0dc56602..8b1e1f2e 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/WindowInsetsExtensions.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/WindowInsetsExtensions.kt @@ -10,13 +10,13 @@ import androidx.annotation.RequiresApi val WindowInsets.systemGestureInsetsCompat: Insets @RequiresApi(VERSION_CODES.Q) get() = if (VERSION.SDK_INT >= VERSION_CODES.R) { - getInsets(WindowInsets.Type.systemGestures()) + getInsetsIgnoringVisibility(WindowInsets.Type.systemGestures()) } else { systemGestureInsets } @Suppress("DEPRECATION") -val WindowInsets.systemWindowInsetTopCompat: Int +val WindowInsets.systemWindowInsetTopVisibleCompat: Int @RequiresApi(VERSION_CODES.Q) get() = if (VERSION.SDK_INT >= VERSION_CODES.R) { getInsets(WindowInsets.Type.systemBars()).top @@ -28,7 +28,7 @@ val WindowInsets.systemWindowInsetTopCompat: Int val WindowInsets.systemWindowInsetBottomCompat: Int @RequiresApi(VERSION_CODES.Q) get() = if (VERSION.SDK_INT >= VERSION_CODES.R) { - getInsets(WindowInsets.Type.systemBars()).bottom + getInsetsIgnoringVisibility(WindowInsets.Type.systemBars()).bottom } else { systemWindowInsetBottom } \ No newline at end of file From 440984b8348ee0a9409291a2f40c112a9e46cf4b Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Tue, 30 Jun 2020 18:18:39 +0200 Subject: [PATCH 092/135] Add API 30 all files access support --- app/src/main/AndroidManifest.xml | 1 + .../controllers/PermissionControllerImpl.kt | 21 ++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3d3e0d35..35f1a3a2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,6 +6,7 @@ + diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PermissionControllerImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PermissionControllerImpl.kt index 8bbc08f5..c3229f78 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PermissionControllerImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PermissionControllerImpl.kt @@ -1,6 +1,13 @@ package com.g00fy2.developerwidget.controllers +import android.Manifest +import android.content.Intent import android.content.pm.PackageManager +import android.net.Uri +import android.os.Build.VERSION +import android.os.Build.VERSION_CODES +import android.os.Environment +import android.provider.Settings import androidx.activity.result.contract.ActivityResultContracts.RequestMultiplePermissions import androidx.core.content.ContextCompat import com.g00fy2.developerwidget.base.BaseActivity @@ -19,8 +26,16 @@ class PermissionControllerImpl @Inject constructor() : PermissionController { } override fun requestPermissions(vararg permissions: String, onGranted: (() -> Unit), onDenied: () -> Unit) { - activity.registerForActivityResult(RequestMultiplePermissions()) { result -> - if (result.all { it.value }) onGranted() else onDenied() - }.launch(permissions) + if (VERSION.SDK_INT >= VERSION_CODES.R && permissions.any { + it == Manifest.permission.READ_EXTERNAL_STORAGE || it == Manifest.permission.WRITE_EXTERNAL_STORAGE + } && !Environment.isExternalStorageManager()) { + activity.startActivity(Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION).apply { + data = Uri.parse("package:${activity.packageName}") + }) + } else { + activity.registerForActivityResult(RequestMultiplePermissions()) { result -> + if (result.all { it.value }) onGranted() else onDenied() + }.launch(permissions) + } } } \ No newline at end of file From 56df1ed52a48ba32dfd8dee5363d4a659f5497a6 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 8 Jul 2020 18:26:11 +0200 Subject: [PATCH 093/135] Update gradle, deps and build tools --- .travis.yml | 2 +- app/build.gradle.kts | 6 +++--- gradle.properties | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 954723db..8eded38b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ git: env: global: # for updates check https://developer.android.com/studio#downloads - - ANDROID_SDK_CMD_TOOLS=commandlinetools-linux-6609375_latest.zip + - ANDROID_SDK_CMD_TOOLS=commandlinetools-linux-6604631_latest.zip # storepass, keypass, keyalias - secure: K4PVOrcYr6ZV16GgZWcw5RGDqxRTrilMK6pjz1r+RkQX6EPywmTsUH0y8EGP44bZc+TFMM0UfGPulHfrKzC3LDVSe+CpvNdQqq8c2Ysc9lQLubvFmVlWZ2rjHhA3jtg33FDIAWipb41WZEdmCJE1EI+OMbh8p8/7cGZ4K4tpd3B8ViXrf16ht50C56glL1lS3Jog/g9OEIPdhzYF23nYPOAeV3xJg3WBGxUUMOwp3vrpMJ/bYvnh/XLHUpPWnCcSWhKZolE3C6Itlv3CUdCyd2u8dnbTFX7KK0g4nrJdXJAyith0aE2RB6APdDDIdZkF3p2qU3aWBWVvNzjGc6tYpP9OB8sjobcx9oG8lIaO09qZnM+fLTs5b3ulvl8d3UZI0KxgSocvjxpltrqeuNODGarzwIWAmjxKr3Qnfo5LFUna1UMxKJ1ARyT7zS9yUbfE6ek42aEe7rEaqryjNFE5X6b9D2WexN+68YynvdRfDXlFx2JIW3hWTi7AG4zBI0LKhhtruwLY1hKty3JR5/Dz/dIMW6JZUmLdE7drPmLNBcKRh1H778EOcaD+1q1bzVnwbA+HLfHkO9Rzmk7UOY1ttWzFBH23W/pI6D6mn4WTFng0/iOEsw7fwHaXPGv6ZXxserC/nzmeYb0AfK3wq2p2ztEDtbSblw9lkMBYlvNi5I8= - secure: SEcF7dl6ImTdeUYtw6dGeHRXbS4h8Ec9+Dnt2rFeobupo4e64818Fo10Uqqf+eM/5VVF2FAJLnEiq1SgfWZKjvUz9batJZNknc2JSKEGQPFaUD55USFCt2rxoLPFJKIee07kPTiXGPM2WWA+42cD+HpXAErMTd3BESsGwjni+xj2PhJuETDGrw+0D5T4TOXgd0uXNPl4p1PE+l3SejPqGQ961Wo+hbxd/y9JyZy/jZ9WW8XA6eEXXtecRY33NspwT58mBXDgZLIM/C3W0qfrGCiOPxwk0RpMo7YMbmYVPLG75AzihDtQ2F7P5edHz7v0yCAejrN23hi1LHb4Uku8tC2jzrH5eUpKfZuqap8DRcbdXq5je3oeuLSUu39FrzsDEmennS0eaD4jTsB5Sy2wld/UCmzV0QenUtPdBaFLU2Rxos3xJW4a2KyENRm5TGVNR/NAWpoacLed3zqDmb3K13WwskTGE1/mXRl+o0T0BVOBXuHXQ+nqATnGuAbw97LhhOeBZ/jA2yWBsaTxdjhB3E3uKWYZYdGIIgOwrZdM0RrVSgepg7NP+vh9iO70ckEzP+w4yws2ElKE3ZiOexEmrkFmqlxQW08b1FMaKJwpfsNiHkwW6u1jq1oeEBIzUrAMmo92uAjDAHKfn7FOsx5RVg20EKP9Rk9l2YKRA5dGJFI= diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 3bf54c40..9e1ba145 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -7,7 +7,7 @@ plugins { android { compileSdkVersion(30) - buildToolsVersion = "30.0.0" + buildToolsVersion = "30.0.1" defaultConfig { applicationId = "com.g00fy2.developerwidget" minSdkVersion(14) @@ -71,7 +71,7 @@ repositories { dependencies { // Kotlin implementation(kotlin("stdlib-jdk7")) - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7-1.4-M2") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7-1.4-M3") // AndroidX implementation("androidx.appcompat:appcompat:1.3.0-alpha01") @@ -80,7 +80,7 @@ dependencies { implementation("androidx.fragment:fragment:1.3.0-alpha06") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha05") implementation("androidx.recyclerview:recyclerview:1.2.0-alpha04") - implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta7") + implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta8") implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha01") // UI diff --git a/gradle.properties b/gradle.properties index 7c89e8cd..a239005f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ # Versions used for dependency resolution in settings.gradle.kts -kotlinVersion=1.4-M2 -androidGradlePluginVersion=4.2.0-alpha02 +kotlinVersion=1.4-M3 +androidGradlePluginVersion=4.2.0-alpha03 nanogiantsVersioning=2.3.1 gradleEnterpriseVersion=3.3.4 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 666abc9c..fbab48f3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-milestone-2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-milestone-3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 069885a431f16bf15f539b5c73e3d6958c6ac9c9 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 8 Jul 2020 18:27:28 +0200 Subject: [PATCH 094/135] Change gesture mode detection and refactor deprecation suppressions --- .../activities/about/AboutActivity.kt | 4 ++-- .../activities/apkinstall/ApkFile.kt | 14 ++++++++++---- .../shortcut/CreateShortcutActivity.kt | 4 ++-- .../widgetconfig/WidgetConfigActivity.kt | 6 +++--- .../developerwidget/base/BaseActivity.kt | 13 +++++-------- .../ktx/WindowInsetsExtensions.kt | 18 ++++-------------- 6 files changed, 26 insertions(+), 33 deletions(-) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt index fcbb5164..ada76586 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt @@ -16,7 +16,7 @@ import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.base.BaseContract.BasePresenter import com.g00fy2.developerwidget.databinding.ActivityAboutBinding import com.g00fy2.developerwidget.ktx.doOnApplyWindowInsets -import com.g00fy2.developerwidget.ktx.systemWindowInsetBottomCompat +import com.g00fy2.developerwidget.ktx.systemWindowInsetIgnoringVisibilityBottomCompat import javax.inject.Inject class AboutActivity : BaseActivity(), AboutContract.AboutView { @@ -105,7 +105,7 @@ class AboutActivity : BaseActivity(), AboutContract.AboutView { if (VERSION.SDK_INT >= VERSION_CODES.O_MR1) { binding.aboutRootScrollview.apply { doOnApplyWindowInsets { _, insets, padding, _ -> - updatePadding(bottom = padding.bottom + insets.systemWindowInsetBottomCompat) + updatePadding(bottom = padding.bottom + insets.systemWindowInsetIgnoringVisibilityBottomCompat) } viewTreeObserver.addOnScrollChangedListener { val scrollableRange = getChildAt(0).bottom - height + paddingBottom diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt index ab7ddf04..8f5436bf 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkFile.kt @@ -113,10 +113,7 @@ class ApkFile private constructor() : Comparable { requestedPermissions?.distinct()?.forEach { permission -> try { packageManager.getPermissionInfo(permission, 0).let { - @Suppress("DEPRECATION") - if ((VERSION.SDK_INT >= VERSION_CODES.P && it.protection == PermissionInfo.PROTECTION_DANGEROUS) - || it.protectionLevel == PermissionInfo.PROTECTION_DANGEROUS - ) { + if (it.hasDangerousPermissions()) { add(Pair(it.name.substringAfterLast("."), it.loadDescription(packageManager)?.toString())) } } @@ -127,6 +124,15 @@ class ApkFile private constructor() : Comparable { } } + private fun PermissionInfo.hasDangerousPermissions(): Boolean { + return if (VERSION.SDK_INT >= VERSION_CODES.P) { + protection == PermissionInfo.PROTECTION_DANGEROUS + } else { + @Suppress("DEPRECATION") + protectionLevel == PermissionInfo.PROTECTION_DANGEROUS + } + } + private fun getFormattedSize(bytes: Long): String { return (round(bytes / 1048576.0 * 100.0) / 100.0).let { sizeMB -> if (sizeMB < 1) { diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt index 4c4354bb..8179071f 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/shortcut/CreateShortcutActivity.kt @@ -27,7 +27,7 @@ import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.base.BaseContract.BasePresenter import com.g00fy2.developerwidget.databinding.ActivityCreateShortcutBinding import com.g00fy2.developerwidget.ktx.doOnApplyWindowInsets -import com.g00fy2.developerwidget.ktx.systemWindowInsetBottomCompat +import com.g00fy2.developerwidget.ktx.systemWindowInsetIgnoringVisibilityBottomCompat import javax.inject.Inject @RequiresApi(VERSION_CODES.N_MR1) @@ -62,7 +62,7 @@ class CreateShortcutActivity : BaseActivity(), CreateShortcutContract.CreateShor adapter.setOnShortcutSelected { shortcutPosition -> onItemClick(shortcutPosition) } if (VERSION.SDK_INT >= VERSION_CODES.O_MR1) { binding.root.doOnApplyWindowInsets { view, insets, padding, _ -> - view.updatePadding(bottom = padding.bottom + insets.systemWindowInsetBottomCompat) + view.updatePadding(bottom = padding.bottom + insets.systemWindowInsetIgnoringVisibilityBottomCompat) } } } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt index 13498103..29d4de39 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/widgetconfig/WidgetConfigActivity.kt @@ -37,7 +37,7 @@ import com.g00fy2.developerwidget.databinding.ActivityWidgetConfigBinding import com.g00fy2.developerwidget.ktx.doOnApplyWindowInsets import com.g00fy2.developerwidget.ktx.hideKeyboard import com.g00fy2.developerwidget.ktx.showKeyboard -import com.g00fy2.developerwidget.ktx.systemWindowInsetBottomCompat +import com.g00fy2.developerwidget.ktx.systemWindowInsetIgnoringVisibilityBottomCompat import com.g00fy2.developerwidget.ktx.updateMargin import com.g00fy2.developerwidget.receiver.widget.WidgetProviderImpl import javax.inject.Inject @@ -131,10 +131,10 @@ class WidgetConfigActivity : BaseActivity(), WidgetConfigContract.WidgetConfigVi binding.shareFab.setOnClickListener { presenter.shareDeviceData() } if (VERSION.SDK_INT >= VERSION_CODES.O_MR1) { binding.widgetConfigRootScrollview.doOnApplyWindowInsets { view, insets, padding, _ -> - view.updatePadding(bottom = padding.bottom + insets.systemWindowInsetBottomCompat) + view.updatePadding(bottom = padding.bottom + insets.systemWindowInsetIgnoringVisibilityBottomCompat) } binding.shareFab.doOnApplyWindowInsets { view, insets, _, margin -> - view.updateMargin(bottom = margin.bottom + insets.systemWindowInsetBottomCompat) + view.updateMargin(bottom = margin.bottom + insets.systemWindowInsetIgnoringVisibilityBottomCompat) } } } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt index 2217e5b4..81054654 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/base/BaseActivity.kt @@ -14,8 +14,7 @@ import androidx.viewbinding.ViewBinding import com.g00fy2.developerwidget.R import com.g00fy2.developerwidget.controllers.DayNightController import com.g00fy2.developerwidget.ktx.doOnApplyWindowInsets -import com.g00fy2.developerwidget.ktx.systemGestureInsetsCompat -import com.g00fy2.developerwidget.ktx.systemWindowInsetTopVisibleCompat +import com.g00fy2.developerwidget.ktx.systemWindowInsetVisibleTopCompat import dagger.android.support.DaggerAppCompatActivity import timber.log.Timber import javax.inject.Inject @@ -86,15 +85,13 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag } protected fun isGesturalNavMode(): Boolean { - return if (VERSION.SDK_INT >= VERSION_CODES.Q) { - window.decorView.rootWindowInsets?.systemGestureInsetsCompat?.let { it.left > 0 } ?: false - } else { - false - } + return resources.getIdentifier("config_navBarInteractionMode", "integer", "android") + .takeIf { it != 0 }?.let { resources.getInteger(it) == 2 } ?: false } private fun initGestureNavigation() { if (VERSION.SDK_INT >= VERSION_CODES.O_MR1) { + // TODO check how to use API 30 features @Suppress("DEPRECATION") window.decorView.let { it.systemUiVisibility.let { flags -> @@ -105,7 +102,7 @@ abstract class BaseActivity(private val isDialogActivity: Boolean = false) : Dag findViewById(Window.ID_ANDROID_CONTENT)?.let { it.doOnApplyWindowInsets { view, insets, padding, _ -> - view.updatePadding(top = padding.top + insets.systemWindowInsetTopVisibleCompat) + view.updatePadding(top = padding.top + insets.systemWindowInsetVisibleTopCompat) } } } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/WindowInsetsExtensions.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/WindowInsetsExtensions.kt index 8b1e1f2e..e349c78e 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/WindowInsetsExtensions.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/WindowInsetsExtensions.kt @@ -1,34 +1,24 @@ package com.g00fy2.developerwidget.ktx -import android.graphics.Insets import android.os.Build.VERSION import android.os.Build.VERSION_CODES import android.view.WindowInsets import androidx.annotation.RequiresApi -@Suppress("DEPRECATION") -val WindowInsets.systemGestureInsetsCompat: Insets - @RequiresApi(VERSION_CODES.Q) - get() = if (VERSION.SDK_INT >= VERSION_CODES.R) { - getInsetsIgnoringVisibility(WindowInsets.Type.systemGestures()) - } else { - systemGestureInsets - } - -@Suppress("DEPRECATION") -val WindowInsets.systemWindowInsetTopVisibleCompat: Int +val WindowInsets.systemWindowInsetVisibleTopCompat: Int @RequiresApi(VERSION_CODES.Q) get() = if (VERSION.SDK_INT >= VERSION_CODES.R) { getInsets(WindowInsets.Type.systemBars()).top } else { + @Suppress("DEPRECATION") systemWindowInsetTop } -@Suppress("DEPRECATION") -val WindowInsets.systemWindowInsetBottomCompat: Int +val WindowInsets.systemWindowInsetIgnoringVisibilityBottomCompat: Int @RequiresApi(VERSION_CODES.Q) get() = if (VERSION.SDK_INT >= VERSION_CODES.R) { getInsetsIgnoringVisibility(WindowInsets.Type.systemBars()).bottom } else { + @Suppress("DEPRECATION") systemWindowInsetBottom } \ No newline at end of file From 394c98d82d86ef4d42b0e5f53e1245a374adf75f Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 8 Jul 2020 18:59:28 +0200 Subject: [PATCH 095/135] Adjust travis cmdline-tools setup --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8eded38b..8148e803 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,9 @@ before_install: # download and unzip Android SDK command line tools - wget -nv https://dl.google.com/android/repository/$ANDROID_SDK_CMD_TOOLS - mkdir -p $HOME/sdk/cmdline-tools && unzip -q $ANDROID_SDK_CMD_TOOLS -d $HOME/sdk/cmdline-tools + - mv $HOME/sdk/cmdline-tools/cmdline-tools $HOME/sdk/cmdline-tools/latest # set SDK tools path variable and ANDROID_HOME - - export PATH=$PATH:$HOME/sdk/cmdline-tools/tools/bin + - export PATH=$PATH:$HOME/sdk/cmdline-tools/latest/bin - export ANDROID_HOME=$HOME/sdk # create empty cfg file to prevent sdkmanager warning message - mkdir -p $HOME/.android && touch $HOME/.android/repositories.cfg From 3727563daccf6b54b715fb94c106be4f8cb4ed48 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Thu, 9 Jul 2020 09:29:37 +0200 Subject: [PATCH 096/135] Update android studio and fix release builds --- app/build.gradle.kts | 4 ++++ gradle.properties | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9e1ba145..d004a093 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -54,6 +54,10 @@ android { kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8.toString() } + lintOptions { + // TODO remove when https://issuetracker.google.com/issues/141126614 is fixed + isCheckReleaseBuilds = false + } } repositories { diff --git a/gradle.properties b/gradle.properties index a239005f..a3e297c3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ # Versions used for dependency resolution in settings.gradle.kts kotlinVersion=1.4-M3 -androidGradlePluginVersion=4.2.0-alpha03 +androidGradlePluginVersion=4.2.0-alpha04 nanogiantsVersioning=2.3.1 gradleEnterpriseVersion=3.3.4 From 4497d299ec64a978283bd8886e3fc8c2dd5c2db5 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sat, 18 Jul 2020 15:42:51 +0200 Subject: [PATCH 097/135] Update dagger, gradle and versioning plugin --- app/build.gradle.kts | 10 +++++----- gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d004a093..43b0de3b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -95,9 +95,9 @@ dependencies { implementation("com.g00fy2:versioncompare:1.3.4") // Dagger - implementation("com.google.dagger:dagger:2.28.1") - kapt("com.google.dagger:dagger-compiler:2.28.1") - implementation("com.google.dagger:dagger-android:2.28.1") - implementation("com.google.dagger:dagger-android-support:2.28.1") - kapt("com.google.dagger:dagger-android-processor:2.28.1") + implementation("com.google.dagger:dagger:2.28.3") + kapt("com.google.dagger:dagger-compiler:2.28.3") + implementation("com.google.dagger:dagger-android:2.28.3") + implementation("com.google.dagger:dagger-android-support:2.28.3") + kapt("com.google.dagger:dagger-android-processor:2.28.3") } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index a3e297c3..810258cd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ # Versions used for dependency resolution in settings.gradle.kts kotlinVersion=1.4-M3 androidGradlePluginVersion=4.2.0-alpha04 -nanogiantsVersioning=2.3.1 +nanogiantsVersioning=2.4.0 gradleEnterpriseVersion=3.3.4 # Allow usage of AndroidX instead of the old support libraries. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fbab48f3..ab5990d5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-milestone-3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From ef2078639e1a9cdeaf1ede45336bc26485a4dec9 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sat, 18 Jul 2020 16:05:47 +0200 Subject: [PATCH 098/135] Update Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 57784a8b..0fe71301 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

DeveloperWidget Icon

-# Developer Widget [![Build Status](https://travis-ci.com/G00fY2/DeveloperWidget.svg?branch=develop)](https://travis-ci.com/G00fY2/DeveloperWidget) [![Release](https://img.shields.io/github/release/G00fY2/DeveloperWidget.svg)](https://github.com/G00fY2/DeveloperWidget/releases) [![API](https://img.shields.io/badge/API-14%2B-blue.svg?style=flat)](https://android-arsenal.com/api?level=14) +# Developer Widget [![Build Status](https://travis-ci.com/G00fY2/DeveloperWidget.svg?branch=develop)](https://travis-ci.com/G00fY2/DeveloperWidget) [![Release](https://img.shields.io/github/v/release/G00fY2/DeveloperWidget)](https://github.com/G00fY2/DeveloperWidget/releases) [![Pre-Release](https://img.shields.io/github/v/release/G00fY2/DeveloperWidget?include_prereleases&label=pre-release)](https://github.com/G00fY2/DeveloperWidget/releases) [![API](https://img.shields.io/badge/API-14%2B-blue.svg?style=flat)](https://android-arsenal.com/api?level=14) **Lightweight Android app that offers a widget to show device data, manage installed apps and list locally stored APK files.** From 7bfd9b5a7f040c9e45a3f43038cfb5062fe3525b Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sat, 18 Jul 2020 16:08:04 +0200 Subject: [PATCH 099/135] Update Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0fe71301..b84719eb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

DeveloperWidget Icon

-# Developer Widget [![Build Status](https://travis-ci.com/G00fY2/DeveloperWidget.svg?branch=develop)](https://travis-ci.com/G00fY2/DeveloperWidget) [![Release](https://img.shields.io/github/v/release/G00fY2/DeveloperWidget)](https://github.com/G00fY2/DeveloperWidget/releases) [![Pre-Release](https://img.shields.io/github/v/release/G00fY2/DeveloperWidget?include_prereleases&label=pre-release)](https://github.com/G00fY2/DeveloperWidget/releases) [![API](https://img.shields.io/badge/API-14%2B-blue.svg?style=flat)](https://android-arsenal.com/api?level=14) +# Developer Widget [![Build Status](https://travis-ci.com/G00fY2/DeveloperWidget.svg?branch=develop)](https://travis-ci.com/G00fY2/DeveloperWidget) [![Release](https://img.shields.io/github/v/release/G00fY2/DeveloperWidget)](https://github.com/G00fY2/DeveloperWidget/releases) [![Pre-Release](https://img.shields.io/github/v/release/G00fY2/DeveloperWidget?include_prereleases&label=pre-release)](https://github.com/G00fY2/DeveloperWidget/releases) [![API](https://img.shields.io/badge/API-14%2B-blue.svg?style=flat)](https://developer.android.com/studio/releases/platforms#4.0) **Lightweight Android app that offers a widget to show device data, manage installed apps and list locally stored APK files.** From 1db2262d1e6d41c4e55a7577790266e5e851d2ab Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sat, 18 Jul 2020 16:16:21 +0200 Subject: [PATCH 100/135] Move lint ignore flags in root element --- app/src/main/AndroidManifest.xml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 35f1a3a2..200b87d3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,14 +2,12 @@ + tools:ignore="LockedOrientationActivity,QueryAllPackagesPermission,GoogleAppIndexingWarning"> - + Date: Sun, 19 Jul 2020 14:20:12 +0200 Subject: [PATCH 101/135] Disable unused default build features --- app/build.gradle.kts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 43b0de3b..eff21876 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -39,6 +39,10 @@ android { } buildFeatures { viewBinding = true + aidl = false + renderScript = false + resValues = false + shaders = false } dependenciesInfo { includeInApk = false From b1a6ce7c5c2add2aea5ae230a8e1c1c74de6aedc Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sun, 19 Jul 2020 14:21:06 +0200 Subject: [PATCH 102/135] Add experimental gradle flag for R class handling --- gradle.properties | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 810258cd..9901995c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,21 +6,18 @@ gradleEnterpriseVersion=3.3.4 # Allow usage of AndroidX instead of the old support libraries. android.useAndroidX=true - # Use R8 in full mode instead of ProGuard compatibility mode. android.enableR8.fullMode=true - # Enable rudimentary R class namespacing where each library only contains references to the resources it declares # instead of declarations plus all transitive dependency references. android.nonTransitiveRClass=true - +# Generate the compile time only R class using the app's local resources +android.enableAppCompileTimeRClass=true # Only keep the single relevant constructor for types mentioned in XML files instead of using a parameter wildcard which # keeps them all. android.useMinimalKeepRules=true - # Enable supported AAPT2 optimize suboperations (ResourceObfuscation, SparseResourceEncoding, ResourcePathShortening) as # an effort to reduce APK size. android.enableResourceOptimizations=true - # Set the build VMs heap size. org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 \ No newline at end of file From ca76410e98f14e05bee60266f8cfde31a62b5658 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Tue, 21 Jul 2020 23:01:13 +0200 Subject: [PATCH 103/135] Update android studio and gradle --- gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 9901995c..aed48ab0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ # Versions used for dependency resolution in settings.gradle.kts kotlinVersion=1.4-M3 -androidGradlePluginVersion=4.2.0-alpha04 +androidGradlePluginVersion=4.2.0-alpha05 nanogiantsVersioning=2.4.0 gradleEnterpriseVersion=3.3.4 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ab5990d5..dace20ec 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From b8508dcbbb09cc7f9dcbe4884f69b3bcc94efa6a Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 22 Jul 2020 23:42:43 +0200 Subject: [PATCH 104/135] Update deps --- app/build.gradle.kts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index eff21876..595087ab 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -84,10 +84,10 @@ dependencies { // AndroidX implementation("androidx.appcompat:appcompat:1.3.0-alpha01") implementation("androidx.core:core-ktx:1.5.0-alpha01") - implementation("androidx.activity:activity:1.2.0-alpha06") - implementation("androidx.fragment:fragment:1.3.0-alpha06") - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha05") - implementation("androidx.recyclerview:recyclerview:1.2.0-alpha04") + implementation("androidx.activity:activity:1.2.0-alpha07") + implementation("androidx.fragment:fragment:1.3.0-alpha07") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha06") + implementation("androidx.recyclerview:recyclerview:1.2.0-alpha05") implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta8") implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha01") From 889479065c380367adf3331db80713cff57a5ef7 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 29 Jul 2020 17:20:23 +0200 Subject: [PATCH 105/135] Update android studio, gradle and deps --- app/build.gradle.kts | 4 ++-- gradle.properties | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 595087ab..595a0787 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -79,7 +79,7 @@ repositories { dependencies { // Kotlin implementation(kotlin("stdlib-jdk7")) - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7-1.4-M3") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8-1.4.0-rc") // AndroidX implementation("androidx.appcompat:appcompat:1.3.0-alpha01") @@ -92,7 +92,7 @@ dependencies { implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha01") // UI - implementation("com.google.android.material:material:1.3.0-alpha01") + implementation("com.google.android.material:material:1.3.0-alpha02") // Misc implementation("com.jakewharton.timber:timber:4.7.1") diff --git a/gradle.properties b/gradle.properties index aed48ab0..46bfd6a3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ # Versions used for dependency resolution in settings.gradle.kts -kotlinVersion=1.4-M3 -androidGradlePluginVersion=4.2.0-alpha05 +kotlinVersion=1.4.0-rc +androidGradlePluginVersion=4.2.0-alpha06 nanogiantsVersioning=2.4.0 gradleEnterpriseVersion=3.3.4 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index dace20ec..50e13927 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From cf1726463b4fd0517c853f09c2cfcaf68501fb0b Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 31 Jul 2020 12:59:04 +0200 Subject: [PATCH 106/135] Update android studio and gradle --- app/build.gradle.kts | 3 +-- gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 595a0787..5ae4ba5b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -78,7 +78,6 @@ repositories { } dependencies { // Kotlin - implementation(kotlin("stdlib-jdk7")) implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8-1.4.0-rc") // AndroidX @@ -88,7 +87,7 @@ dependencies { implementation("androidx.fragment:fragment:1.3.0-alpha07") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha06") implementation("androidx.recyclerview:recyclerview:1.2.0-alpha05") - implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta8") + implementation("androidx.constraintlayout:constraintlayout:2.0.0-rc1") implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha01") // UI diff --git a/gradle.properties b/gradle.properties index 46bfd6a3..5f43cadb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ # Versions used for dependency resolution in settings.gradle.kts kotlinVersion=1.4.0-rc -androidGradlePluginVersion=4.2.0-alpha06 +androidGradlePluginVersion=4.2.0-alpha07 nanogiantsVersioning=2.4.0 gradleEnterpriseVersion=3.3.4 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 50e13927..e42c0b0e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 7c1a92a5e05a6208e94f9d94deaadf8a04367456 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sun, 2 Aug 2020 23:52:56 +0200 Subject: [PATCH 107/135] Update gradle enterprise plugin --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 5f43cadb..9fae6053 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ kotlinVersion=1.4.0-rc androidGradlePluginVersion=4.2.0-alpha07 nanogiantsVersioning=2.4.0 -gradleEnterpriseVersion=3.3.4 +gradleEnterpriseVersion=3.4 # Allow usage of AndroidX instead of the old support libraries. android.useAndroidX=true From 188e8816cfbecfc277f1983de9830ebfe85a899b Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sun, 2 Aug 2020 23:54:47 +0200 Subject: [PATCH 108/135] Rename instead of copy mapping file --- app/build.gradle.kts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5ae4ba5b..7ef04e48 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -64,6 +64,10 @@ android { } } +versioning { + keepOriginalMappingFile = false +} + repositories { google() mavenCentral() From 2c2bc676b28b1242570ce09155e920a2e0078aab Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Wed, 5 Aug 2020 10:22:35 +0200 Subject: [PATCH 109/135] Update gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e42c0b0e..013ba4bc 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-5-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From d132fe346c68716bfcce038d8d99944c619b5d3d Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Fri, 7 Aug 2020 19:00:44 +0200 Subject: [PATCH 110/135] Update gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 013ba4bc..910c5a98 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-6-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 66ca8e6a3c094ba856c9665c82bc1f182de67e8f Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Tue, 11 Aug 2020 11:36:59 +0200 Subject: [PATCH 111/135] Update gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 910c5a98..bca17f36 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-rc-6-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 40f5b1f74b586dea6945a23b58c9ef303c4df4f2 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sun, 16 Aug 2020 23:23:41 +0200 Subject: [PATCH 112/135] Update kotlin and build tools --- app/build.gradle.kts | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 7ef04e48..62014220 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -7,7 +7,7 @@ plugins { android { compileSdkVersion(30) - buildToolsVersion = "30.0.1" + buildToolsVersion = "30.0.2" defaultConfig { applicationId = "com.g00fy2.developerwidget" minSdkVersion(14) diff --git a/gradle.properties b/gradle.properties index 9fae6053..318a377e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Versions used for dependency resolution in settings.gradle.kts -kotlinVersion=1.4.0-rc +kotlinVersion=1.4.0 androidGradlePluginVersion=4.2.0-alpha07 nanogiantsVersioning=2.4.0 gradleEnterpriseVersion=3.4 From b13b127dda7ac103e8ab3f17ef7dcc1745b2fe83 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Mon, 17 Aug 2020 20:23:49 +0200 Subject: [PATCH 113/135] Update coroutines --- app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 62014220..e4a519d4 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -82,7 +82,7 @@ repositories { } dependencies { // Kotlin - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8-1.4.0-rc") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9") // AndroidX implementation("androidx.appcompat:appcompat:1.3.0-alpha01") From aa2a38cef0546f42c3cd9b8e71903d16d1528081 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Tue, 18 Aug 2020 09:42:33 +0200 Subject: [PATCH 114/135] Remove obsolete package import rule --- .idea/codeStyles/Project.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index dfe2a9cc..a5a6c41b 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -89,11 +89,6 @@
Install APK Manage Apps + OK Cancel Missing permissions No APK files found @@ -34,6 +35,7 @@ Release notes Feedback Request features or report bugs + APK search depth Show app icon Display application icon on launcher You may need to reboot to take effect. @@ -67,6 +69,8 @@ Permissions without runtime request: Keep me safe Install anyway + Infinite (can slow down APK search) + %d (Default) Device System From 358d5d8a7d0fbd303168871c9f4ba51a19cf365b Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Mon, 5 Oct 2020 23:02:32 +0200 Subject: [PATCH 133/135] Run shared preference calls in IO dispatcher --- .../controllers/PreferenceControllerImpl.kt | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PreferenceControllerImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PreferenceControllerImpl.kt index 8d46a4eb..f5d3e494 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PreferenceControllerImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/controllers/PreferenceControllerImpl.kt @@ -3,6 +3,8 @@ package com.g00fy2.developerwidget.controllers import android.content.Context import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.di.annotations.ACTIVITY +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext import javax.inject.Inject import javax.inject.Named @@ -17,34 +19,50 @@ class PreferenceControllerImpl @Inject constructor() : PreferenceController { } override suspend fun get(key: String, default: String): String { - return sharedPreference.getString(key, default) ?: default + return withContext(Dispatchers.IO) { + sharedPreference.getString(key, default) ?: default + } } override suspend fun get(key: String, default: Long): Long { - return sharedPreference.getLong(key, default) + return withContext(Dispatchers.IO) { + sharedPreference.getLong(key, default) + } } override suspend fun get(key: String, default: Int): Int { - return sharedPreference.getInt(key, default) + return withContext(Dispatchers.IO) { + sharedPreference.getInt(key, default) + } } override suspend fun get(key: String, default: Boolean): Boolean { - return sharedPreference.getBoolean(key, default) + return withContext(Dispatchers.IO) { + sharedPreference.getBoolean(key, default) + } } override suspend fun set(key: String, data: String) { - return sharedPreference.edit().putString(key, data).apply() + return withContext(Dispatchers.IO) { + sharedPreference.edit().putString(key, data).apply() + } } override suspend fun set(key: String, data: Long) { - return sharedPreference.edit().putLong(key, data).apply() + return withContext(Dispatchers.IO) { + sharedPreference.edit().putLong(key, data).apply() + } } override suspend fun set(key: String, data: Int) { - return sharedPreference.edit().putInt(key, data).apply() + return withContext(Dispatchers.IO) { + sharedPreference.edit().putInt(key, data).apply() + } } override suspend fun set(key: String, data: Boolean) { - return sharedPreference.edit().putBoolean(key, data).apply() + return withContext(Dispatchers.IO) { + sharedPreference.edit().putBoolean(key, data).apply() + } } } \ No newline at end of file From 3ca10666bdf002fcf478705330cf75667995d547 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sat, 10 Oct 2020 16:56:26 +0200 Subject: [PATCH 134/135] Update deps and gradle --- app/build.gradle.kts | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 0d1d4f85..a7bd5283 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -88,7 +88,7 @@ dependencies { implementation("androidx.fragment:fragment:1.3.0-beta01") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-beta01") implementation("androidx.recyclerview:recyclerview:1.2.0-alpha06") - implementation("androidx.constraintlayout:constraintlayout:2.0.1") + implementation("androidx.constraintlayout:constraintlayout:2.0.2") implementation("androidx.vectordrawable:vectordrawable:1.2.0-alpha02") // UI @@ -96,7 +96,7 @@ dependencies { // Misc implementation("com.jakewharton.timber:timber:4.7.1") - implementation("com.g00fy2:versioncompare:1.3.4") + implementation("com.g00fy2:versioncompare:1.3.5") // Dagger implementation("com.google.dagger:dagger:2.29.1") diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8dbe2cd2..8c6ce341 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-rc-3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-rc-4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 07df5309806ddd526cf812aaafa55ec1694ecb79 Mon Sep 17 00:00:00 2001 From: Thomas Wirth Date: Sat, 10 Oct 2020 16:56:56 +0200 Subject: [PATCH 135/135] Add hint to apk search to allow configuring the search depth --- .../activities/about/AboutActivity.kt | 24 ++++++++++++++ .../activities/apkinstall/ApkActivity.kt | 23 +++++++++++-- .../activities/apkinstall/ApkContract.kt | 2 +- .../activities/apkinstall/ApkPresenterImpl.kt | 5 +-- .../developerwidget/ktx/TextViewExtensions.kt | 32 +++++++++++++++++++ app/src/main/res/layout/activity_apk.xml | 2 +- app/src/main/res/values/strings.xml | 1 + 7 files changed, 83 insertions(+), 6 deletions(-) create mode 100644 app/src/main/kotlin/com/g00fy2/developerwidget/ktx/TextViewExtensions.kt diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt index 2f464e8a..afa05e0b 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/about/AboutActivity.kt @@ -5,7 +5,9 @@ import android.content.ComponentName import android.content.pm.PackageManager import android.os.Build.VERSION import android.os.Build.VERSION_CODES +import android.os.Bundle import android.view.MenuItem +import android.view.View import androidx.appcompat.app.AppCompatDelegate import androidx.core.view.WindowInsetsCompat import androidx.core.view.updatePadding @@ -28,6 +30,20 @@ class AboutActivity : BaseActivity(), AboutContract.AboutView { override val binding: ActivityAboutBinding by viewBinding(ActivityAboutBinding::inflate) override fun providePresenter(): BasePresenter = presenter + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + if (intent.getBooleanExtra(SCROLL_BOTTOM, false)) { + intent.removeExtra(SCROLL_BOTTOM) + binding.aboutRootScrollview.run { + postDelayed({ smoothScrollTo(0, bottom) }, 300) + setPressedState(binding.searchDepthItem, true, 600) + setPressedState(binding.searchDepthItem, false, 800) + setPressedState(binding.searchDepthItem, true, 1000) + } + } + } + override fun initView() { supportActionBar?.setDisplayHomeAsUpEnabled(true) setActionbarElevationListener(binding.aboutRootScrollview) @@ -204,4 +220,12 @@ class AboutActivity : BaseActivity(), AboutContract.AboutView { updateLauncherIconItem() presenter.showRebootNotice() } + + private fun setPressedState(item: View, pressed: Boolean, delay: Int) { + item.run { postDelayed({ isPressed = pressed }, delay.toLong()) } + } + + companion object { + const val SCROLL_BOTTOM = "scrollBottom" + } } \ No newline at end of file diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt index 80bf8e20..df123bf9 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkActivity.kt @@ -1,15 +1,19 @@ package com.g00fy2.developerwidget.activities.apkinstall +import android.content.Intent import android.view.View import androidx.appcompat.widget.TooltipCompat import androidx.core.view.ViewCompat import androidx.recyclerview.widget.LinearLayoutManager import com.g00fy2.developerwidget.R +import com.g00fy2.developerwidget.activities.about.AboutActivity +import com.g00fy2.developerwidget.activities.about.AboutActivity.Companion.SCROLL_BOTTOM import com.g00fy2.developerwidget.activities.apkinstall.dialogs.ApkDeleteDialog import com.g00fy2.developerwidget.activities.apkinstall.dialogs.ApkWarningDialog import com.g00fy2.developerwidget.base.BaseActivity import com.g00fy2.developerwidget.base.BaseContract.BasePresenter import com.g00fy2.developerwidget.databinding.ActivityApkBinding +import com.g00fy2.developerwidget.ktx.setClickableText import javax.inject.Inject class ApkActivity : BaseActivity(true), ApkContract.ApkView { @@ -47,13 +51,21 @@ class ApkActivity : BaseActivity(true), ApkContract.ApkView { } } - override fun toggleResultView(apkFiles: List, missingPermissions: Boolean) { + override fun toggleResultView(apkFiles: List, missingPermissions: Boolean, searchDepth: Int) { if (missingPermissions) { binding.progressbar.visibility = View.GONE binding.noItemsTextview.text = getString(R.string.missing_permissions) } else { binding.noItemsTextview.visibility = View.INVISIBLE - binding.noItemsTextview.text = getString(R.string.no_apk_found) + if (searchDepth != Int.MAX_VALUE) { + binding.noItemsTextview.setClickableText( + getString(R.string.no_apk_found) + "\n" + getString(R.string.no_apk_found_search_depth, searchDepth), + getString(R.string.no_apk_found_search_depth, searchDepth) + ) { openAboutActivity() } + } else { + binding.noItemsTextview.text = getString(R.string.no_apk_found) + } + ViewCompat.animate(binding.progressbar).alpha(0f) .setDuration(resources.getInteger(android.R.integer.config_shortAnimTime).toLong()).withEndAction { binding.progressbar.visibility = View.INVISIBLE @@ -70,6 +82,13 @@ class ApkActivity : BaseActivity(true), ApkContract.ApkView { }.show() } + private fun openAboutActivity() { + startActivity(Intent(this, AboutActivity::class.java).apply { + flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK + putExtra(SCROLL_BOTTOM, true) + }) + } + private fun showOptions(show: Boolean) { binding.deleteHeaderGroup.visibility = if (show) View.VISIBLE else View.GONE } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkContract.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkContract.kt index 601f7ca6..56fabfde 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkContract.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkContract.kt @@ -6,7 +6,7 @@ interface ApkContract { interface ApkView : BaseContract.BaseView { - fun toggleResultView(apkFiles: List, missingPermissions: Boolean) + fun toggleResultView(apkFiles: List, missingPermissions: Boolean, searchDepth: Int = 0) fun showPermissionWarning(apkFile: ApkFile) } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt index 7ee9d643..c7c89523 100644 --- a/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/activities/apkinstall/ApkPresenterImpl.kt @@ -46,16 +46,17 @@ class ApkPresenterImpl @Inject constructor() : BasePresenterImpl(), ApkContract. } private fun scanStorageForApks() { + var depth: Int view.lifecycleScope.launch { withContext(Dispatchers.IO) { - val depth = preferenceController.get(PreferenceController.SEARCH_DEPTH, 2) + depth = preferenceController.get(PreferenceController.SEARCH_DEPTH, 2) mutableSetOf().apply { for (dir in storageDirsController.getStorageDirectories()) { addAll(searchAPKs(dir, depth)) } }.sorted() }.let { - view.toggleResultView(it, false) + view.toggleResultView(it, false, depth) } } } diff --git a/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/TextViewExtensions.kt b/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/TextViewExtensions.kt new file mode 100644 index 00000000..eb983316 --- /dev/null +++ b/app/src/main/kotlin/com/g00fy2/developerwidget/ktx/TextViewExtensions.kt @@ -0,0 +1,32 @@ +package com.g00fy2.developerwidget.ktx + +import android.text.SpannableString +import android.text.Spanned +import android.text.TextPaint +import android.text.method.LinkMovementMethod +import android.text.style.ClickableSpan +import android.view.View +import android.widget.TextView +import androidx.core.content.res.ResourcesCompat +import com.g00fy2.developerwidget.R + +fun TextView.setClickableText(text: String, linkTarget: String, onClick: () -> Unit) { + val result = SpannableString(text) + val clickableSpan = object : ClickableSpan() { + override fun onClick(widget: View) { + onClick() + } + + override fun updateDrawState(ds: TextPaint) { + super.updateDrawState(ds) + ds.color = ResourcesCompat.getColor(context.resources, R.color.colorAccent, null) + ds.isUnderlineText = false + } + } + val linkStart = result.indexOf(linkTarget) + if (linkStart >= 0) { + result.setSpan(clickableSpan, linkStart, linkStart + linkTarget.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) + } + this.text = result + movementMethod = LinkMovementMethod.getInstance() +} \ No newline at end of file diff --git a/app/src/main/res/layout/activity_apk.xml b/app/src/main/res/layout/activity_apk.xml index 1a0fe979..85fff135 100644 --- a/app/src/main/res/layout/activity_apk.xml +++ b/app/src/main/res/layout/activity_apk.xml @@ -124,8 +124,8 @@ android:layout_marginTop="8dp" android:ellipsize="end" android:gravity="center" - android:singleLine="true" android:text="@string/scanning_apks" + android:textColorHighlight="@color/backgroundColor" android:textSize="14sp" app:layout_constraintBottom_toBottomOf="@+id/recyclerview" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d318d04f..2cf715d9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -7,6 +7,7 @@ Cancel Missing permissions No APK files found + search depth %d No apps found Loading data… Filter