From 85704a12752e47f27ae8338981fd2f73f2ffa109 Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Sun, 20 Mar 2022 15:04:26 -0400 Subject: [PATCH] Finalize banner --- app/src/main/java/io/heckel/ntfy/db/Repository.kt | 12 +++--------- .../main/java/io/heckel/ntfy/ui/MainActivity.kt | 1 - app/src/main/res/layout/activity_main.xml | 2 +- app/src/main/res/values/strings.xml | 10 +++++----- app/src/main/res/xml/main_preferences.xml | 14 ++++++-------- 5 files changed, 15 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/io/heckel/ntfy/db/Repository.kt b/app/src/main/java/io/heckel/ntfy/db/Repository.kt index 822f711..d339ff8 100644 --- a/app/src/main/java/io/heckel/ntfy/db/Repository.kt +++ b/app/src/main/java/io/heckel/ntfy/db/Repository.kt @@ -256,15 +256,9 @@ class Repository(private val sharedPrefs: SharedPreferences, private val databas } fun setConnectionProtocol(connectionProtocol: String) { - if (connectionProtocol == CONNECTION_PROTOCOL_JSONHTTP) { - sharedPrefs.edit() - .remove(SHARED_PREFS_CONNECTION_PROTOCOL) - .apply() - } else { - sharedPrefs.edit() - .putString(SHARED_PREFS_CONNECTION_PROTOCOL, connectionProtocol) - .apply() - } + sharedPrefs.edit() + .putString(SHARED_PREFS_CONNECTION_PROTOCOL, connectionProtocol) + .apply() } fun getConnectionProtocol(): String { diff --git a/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt b/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt index 6d8db1d..8790e0d 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt @@ -248,7 +248,6 @@ class MainActivity : AppCompatActivity(), ActionMode.Callback, AddFragment.Subsc workManager!!.enqueueUniquePeriodicWork(PollWorker.WORK_NAME_PERIODIC_ALL, workPolicy, work) } - private fun schedulePeriodicDeleteWorker() { val workerVersion = repository.getDeleteWorkerVersion() val workPolicy = if (workerVersion == DeleteWorker.VERSION) { diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index d9c30fe..863acb8 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -108,7 +108,7 @@ app:layout_constraintTop_toTopOf="parent" android:layout_marginEnd="15dp" android:layout_marginTop="15dp" app:layout_constraintStart_toEndOf="@+id/main_banner_json_stream_image" - android:layout_marginStart="10dp"/> + android:layout_marginStart="10dp" android:autoLink="web"/> Battery optimization should be disabled to avoid issues with notification delivery. - Remind later + Ask later Dismiss Fix now - Starting June 2022, WebSockets will be used to communicate with the server. Be sure get your selfhosted server ready. - Remind later + Starting June 2022, WebSockets will be used to communicate with the ntfy servers. Be sure to configure your selfhosted server to support it. To check if WebSocket support is working, enable it in the Settings under Connection protocol. + Ask later Dismiss Learn more https://ntfy.sh/docs/deprecations + Enable now Subscribe to topic @@ -331,13 +332,12 @@ Clear logs Delete previously recorded logs, and start over Logs successfully deleted - Experimental ConnectionProtocol Connection protocol Use a JSON stream over HTTP to connect to the server. This is the tried and true method, though it may consume more battery. Use WebSockets to connect to the server. This option is experimental. Let us know if it consumes less battery or is unstable. JSON stream over HTTP - WebSockets (experimental) + WebSockets About Version Version diff --git a/app/src/main/res/xml/main_preferences.xml b/app/src/main/res/xml/main_preferences.xml index 3dd3826..79f12ae 100644 --- a/app/src/main/res/xml/main_preferences.xml +++ b/app/src/main/res/xml/main_preferences.xml @@ -58,6 +58,12 @@ app:summary="@string/settings_backup_restore_restore_summary"/> + - - -