diff --git a/android/app/src/main/java/com/github/quarck/calnotify/prefs/NavigationSettingsFragmentX.kt b/android/app/src/main/java/com/github/quarck/calnotify/prefs/NavigationSettingsFragmentX.kt index 7855c4edc..836b0ff89 100644 --- a/android/app/src/main/java/com/github/quarck/calnotify/prefs/NavigationSettingsFragmentX.kt +++ b/android/app/src/main/java/com/github/quarck/calnotify/prefs/NavigationSettingsFragmentX.kt @@ -20,6 +20,7 @@ package com.github.quarck.calnotify.prefs import android.content.Intent +import android.net.Uri import android.os.Bundle import android.os.Handler import android.os.Looper @@ -45,6 +46,12 @@ class NavigationSettingsFragmentX : PreferenceFragmentCompat() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { setPreferencesFromResource(R.xml.navigation_preferences, rootKey) + // Set up click handler for "About Upcoming Events" help + findPreference("upcoming_events_help")?.setOnPreferenceClickListener { + showUpcomingEventsHelpDialog() + true + } + // Set up click handler for "Switch to Classic View" button findPreference("switch_to_classic_view")?.setOnPreferenceClickListener { showSwitchToClassicViewDialog() @@ -58,6 +65,25 @@ class NavigationSettingsFragmentX : PreferenceFragmentCompat() { } } + private fun showUpcomingEventsHelpDialog() { + val ctx = context ?: return + AlertDialog.Builder(ctx) + .setTitle(R.string.upcoming_events_help_dialog_title) + .setMessage(R.string.upcoming_events_help_dialog_message) + .setPositiveButton(R.string.upcoming_events_help_view_full_docs) { _, _ -> + openUpcomingEventsDocumentation() + } + .setNegativeButton(android.R.string.ok, null) + .show() + } + + private fun openUpcomingEventsDocumentation() { + val ctx = context ?: return + val docsUrl = ctx.getString(R.string.upcoming_events_docs_url) + val intent = Intent(Intent.ACTION_VIEW, Uri.parse(docsUrl)) + startActivity(intent) + } + private fun showSwitchToClassicViewDialog() { val ctx = context ?: return AlertDialog.Builder(ctx) diff --git a/android/app/src/main/res/drawable/ic_help_outline_24dp.xml b/android/app/src/main/res/drawable/ic_help_outline_24dp.xml new file mode 100644 index 000000000..0073d4286 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_help_outline_24dp.xml @@ -0,0 +1,12 @@ + + + + + diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 2ba192112..327bf02dd 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -733,4 +733,12 @@ Enable new UI and restart with the tabbed navigation view Switch to new view? The app will restart. Restarting… + + + About Upcoming Events + Learn how the Upcoming tab works + Upcoming Events + The Upcoming tab shows calendar events that are scheduled to fire reminders within your configured lookahead window.\n\n• Events appear based on when their reminder fires, not the event start time\n• Once a reminder fires, the event moves to the Active tab\n• Configure how far ahead to look in the settings below\n\nLookahead Modes:\n• Fixed hours: Show events X hours ahead (default: 8 hours)\n• Day boundary: Show events until a configurable \"new day\" time (for night owls) + View Full Documentation + https://github.com/williscool/CalendarNotification/blob/master/docs/features/UPCOMING_EVENTS_README.md diff --git a/android/app/src/main/res/xml/navigation_preferences.xml b/android/app/src/main/res/xml/navigation_preferences.xml index 0ed4e3f33..da197c2e7 100644 --- a/android/app/src/main/res/xml/navigation_preferences.xml +++ b/android/app/src/main/res/xml/navigation_preferences.xml @@ -13,6 +13,13 @@ android:summary="@string/use_new_navigation_ui_summary" android:defaultValue="true" /> + + +