From 2c83fae82a62b74e0db84cef697657a401173c4e Mon Sep 17 00:00:00 2001 From: Yuri Volkov Date: Wed, 3 Jan 2024 15:02:11 +0300 Subject: [PATCH] #80 Do not make all permissions mandatory --- README.md | 11 ++++++-- app/build.gradle | 4 +-- .../todoagenda/EnvironmentChangedReceiver.kt | 4 ++- .../org/andstatus/todoagenda/MainActivity.kt | 26 ++++++++----------- .../todoagenda/provider/EventProviderType.kt | 4 +++ .../main/play/release-notes/en-US/default.txt | 7 ++++- .../main/play/release-notes/ru-RU/default.txt | 7 ++++- app/src/main/res/values-ru/strings.xml | 1 + 8 files changed, 42 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index b424d1d2..983bc2e0 100644 --- a/README.md +++ b/README.md @@ -85,13 +85,20 @@ In particular, see these solutions: ## Changelog + + +### 2024-01-03 v4.8.0 Time zone changes fixed +* Fixed "[Default Time zone in app doesn't change, when Android System Time Zone changes](https://github.com/andstatus/todoagenda/issues/106)". +* Fixed "[Do not make all permissions mandatory](https://github.com/andstatus/todoagenda/issues/80)". +* App converted from Java to Kotlin. + ### 2023-12-31 v4.7.3 Show based on keywords in a title -* Date range filtering extended with "[Today and Tomorrow](https://github.com/plusonelabs/calendar-widget/issues/123)" +* Date range filtering extended with "[Today and Tomorrow](https://github.com/andstatus/todoagenda/issues/123)" option. This is different from the "One day" option as that hides events after current time on the next day, which is a bit confusing. -* [Show based on keywords in a title](https://github.com/plusonelabs/calendar-widget/issues/122) option added, +* [Show based on keywords in a title](https://github.com/andstatus/todoagenda/issues/122) option added, allowing to see events that have certain text included. In addition to existing option "Hide based on keywords in a title". * Allow changing language of User Interface for Android 13+ in Android System Settings - Apps, see diff --git a/app/build.gradle b/app/build.gradle index 4722ddf2..a7d615a5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { } defaultConfig { - versionCode 703 - versionName '4.7.3' + versionCode 704 + versionName '4.8.0' minSdkVersion rootProject.minSdkVersion targetSdkVersion rootProject.targetSdkVersion diff --git a/app/src/main/kotlin/org/andstatus/todoagenda/EnvironmentChangedReceiver.kt b/app/src/main/kotlin/org/andstatus/todoagenda/EnvironmentChangedReceiver.kt index 79088690..359ad551 100644 --- a/app/src/main/kotlin/org/andstatus/todoagenda/EnvironmentChangedReceiver.kt +++ b/app/src/main/kotlin/org/andstatus/todoagenda/EnvironmentChangedReceiver.kt @@ -34,7 +34,9 @@ class EnvironmentChangedReceiver : BroadcastReceiver() { val action = if (settings == null || intent.action.isNullOrBlank()) { RemoteViewsFactory.ACTION_REFRESH } else if (PermissionsUtil.mustRequestPermissions(context)) { - RemoteViewsFactory.ACTION_CONFIGURE + // Recheck + AllSettings.reInitialize(context) + if (PermissionsUtil.mustRequestPermissions(context)) RemoteViewsFactory.ACTION_CONFIGURE else intent.action } else { intent.action } diff --git a/app/src/main/kotlin/org/andstatus/todoagenda/MainActivity.kt b/app/src/main/kotlin/org/andstatus/todoagenda/MainActivity.kt index 896d9103..ecc90d40 100644 --- a/app/src/main/kotlin/org/andstatus/todoagenda/MainActivity.kt +++ b/app/src/main/kotlin/org/andstatus/todoagenda/MainActivity.kt @@ -5,6 +5,7 @@ import android.content.Context import android.content.Intent import android.net.Uri import android.os.Bundle +import android.provider.Settings import android.util.Log import android.view.View import android.widget.AdapterView.OnItemClickListener @@ -13,13 +14,11 @@ import android.widget.ListView import android.widget.SimpleAdapter import android.widget.TextView import androidx.appcompat.app.AppCompatActivity -import androidx.core.app.ActivityCompat import androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback import org.andstatus.todoagenda.prefs.AllSettings import org.andstatus.todoagenda.prefs.ApplicationPreferences import org.andstatus.todoagenda.prefs.ApplicationPreferences.isAskForPermissions import org.andstatus.todoagenda.provider.EventProviderType -import org.andstatus.todoagenda.provider.EventProviderType.Companion.neededPermissions import org.andstatus.todoagenda.util.IntentUtil import org.andstatus.todoagenda.util.PermissionsUtil @@ -85,7 +84,9 @@ class MainActivity : AppCompatActivity(), OnRequestPermissionsResultCallback { findViewById