From 967a6d03f2653699176b4565e4b586a4f260cd46 Mon Sep 17 00:00:00 2001 From: Umnik Date: Sun, 30 Jan 2022 17:05:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=20=D0=BF=D0=B5=D1=80=D0=B5=D1=81?= =?UTF-8?q?=D0=BE=D0=B7=D0=B4=D0=B0=D1=91=D0=BC=20=D0=BD=D0=BE=D1=82=D0=B8?= =?UTF-8?q?=D1=84=D0=B8=D0=BA=D0=B0=D1=86=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 12 ++++++------ .../ui/notification/ResetDefaultsNotification.kt | 7 ++++++- build.gradle | 2 +- fastlane/metadata/android/en-US/changelogs/19.txt | 2 ++ fastlane/metadata/android/ru/changelogs /19.txt | 2 ++ gradle/wrapper/gradle-wrapper.properties | 2 +- 6 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/19.txt create mode 100644 fastlane/metadata/android/ru/changelogs /19.txt diff --git a/app/build.gradle b/app/build.gradle index ee9dd37..fce62c4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { applicationId "xyz.myachin.saveto" minSdkVersion 23 targetSdkVersion 32 - versionCode 18 - versionName '1.15.3' + versionCode 19 + versionName '1.15.4' } buildTypes { @@ -34,11 +34,11 @@ android { } compileOptions { - sourceCompatibility "1.8" - targetCompatibility "1.8" + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = JavaVersion.VERSION_1_8.toString() } } @@ -47,7 +47,7 @@ dependencies { implementation 'androidx.core:core-ktx:1.7.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.3' - implementation 'androidx.preference:preference-ktx:1.1.1' + implementation 'androidx.preference:preference-ktx:1.2.0' implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.google.android.material:material:1.5.0' diff --git a/app/src/main/java/xyz/myachin/saveto/ui/notification/ResetDefaultsNotification.kt b/app/src/main/java/xyz/myachin/saveto/ui/notification/ResetDefaultsNotification.kt index 628ca9a..372dbdb 100644 --- a/app/src/main/java/xyz/myachin/saveto/ui/notification/ResetDefaultsNotification.kt +++ b/app/src/main/java/xyz/myachin/saveto/ui/notification/ResetDefaultsNotification.kt @@ -15,6 +15,9 @@ import androidx.core.app.NotificationManagerCompat import xyz.myachin.saveto.R class ResetDefaultsNotification(private val context: Context) { + private val manager = + context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager + private val notificationChannel by lazy { NotificationChannelCompat.Builder(REMOVE_DEFAULT_NOTIFICATION_CHANNEL_ID, NotificationManagerCompat.IMPORTANCE_DEFAULT) @@ -41,7 +44,7 @@ class ResetDefaultsNotification(private val context: Context) { init { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - (context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager) + manager .createNotificationChannel(NotificationChannel( notificationChannel.id, notificationChannel.name, @@ -50,6 +53,8 @@ class ResetDefaultsNotification(private val context: Context) { } fun reset() { + manager.activeNotifications.forEach { if (it.id == REMOVE_DEFAULT_REQUEST_CODE) return } + NotificationManagerCompat.from(context.applicationContext) .notify(REMOVE_DEFAULT_REQUEST_CODE, NotificationCompat .Builder(context.applicationContext, REMOVE_DEFAULT_NOTIFICATION_CHANNEL_ID) diff --git a/build.gradle b/build.gradle index e1882d2..002fb4e 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.4' + classpath 'com.android.tools.build:gradle:7.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/fastlane/metadata/android/en-US/changelogs/19.txt b/fastlane/metadata/android/en-US/changelogs/19.txt new file mode 100644 index 0000000..8bc7e6d --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/19.txt @@ -0,0 +1,2 @@ +1. Updating dependencies +2. Notification for ACTION_VIEW defaults reset is no longer recreated if it already exists \ No newline at end of file diff --git a/fastlane/metadata/android/ru/changelogs /19.txt b/fastlane/metadata/android/ru/changelogs /19.txt new file mode 100644 index 0000000..3b9a782 --- /dev/null +++ b/fastlane/metadata/android/ru/changelogs /19.txt @@ -0,0 +1,2 @@ +1. Обновление зависимостей +2. Уведомление об установке приложения по умолчанию для обраотки ACTION_VIEW теперь не пересоздаётся, если оно уже существует \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d6ad100..e5f7a99 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Sep 01 13:49:20 MSK 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME