Merge pull request #278 from cyb3rko/notification-channels

Separate Notification channels for each app
This commit is contained in:
Jannis Mattheis
2023-02-21 13:59:20 +01:00
committed by GitHub
11 changed files with 281 additions and 85 deletions

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.materialswitch.MaterialSwitch
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/switchWidget"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

View File

@@ -34,4 +34,5 @@
</string-array>
<string name="time_format_value_absolute">time_format_absolute</string>
<string name="time_format_value_relative">time_format_relative</string>
<bool name="notification_channels">false</bool>
</resources>

View File

@@ -74,12 +74,15 @@
<string name="setting_key_theme">theme</string>
<string name="setting_message_layout">Message layout</string>
<string name="setting_key_message_layout">message_layout</string>
<string name="setting_message_layout_dialog_title">Restart App?</string>
<string name="setting_message_layout_dialog_message">The change will be effective on next app start.\n\nDo you want to restart now?</string>
<string name="setting_message_layout_dialog_button1">Restart</string>
<string name="setting_message_layout_dialog_button2">Later</string>
<string name="setting_restart_dialog_title">Restart App?</string>
<string name="setting_restart_dialog_message">The change will be effective on next app start.\n\nDo you want to restart now?</string>
<string name="setting_restart_dialog_button1">Restart</string>
<string name="setting_restart_dialog_button2">Later</string>
<string name="setting_time_format">Time format</string>
<string name="setting_key_time_format">time_format</string>
<string name="setting_notifications">Notifications</string>
<string name="setting_notification_channels">Separate app notification channels</string>
<string name="setting_key_notification_channels">notification_channels</string>
<string name="push_message">Push message</string>
<string name="appListDescription">App:</string>
<string name="priorityDescription">Priority:</string>
@@ -97,4 +100,10 @@
<item quantity="one">in %d minute</item>
<item quantity="other">in %d minutes</item>
</plurals>
<string name="notification_channel_title_foreground">Gotify foreground notification</string>
<string name="notification_channel_title_min">Min priority messages (&lt;1)</string>
<string name="notification_channel_title_low">Low priority messages (13)</string>
<string name="notification_channel_title_normal">Normal priority messages (47)</string>
<string name="notification_channel_title_high">High priority messages (>7)</string>
</resources>

View File

@@ -1,4 +1,4 @@
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.Material3.DayNight">
@@ -25,4 +25,8 @@
<style name="AppTheme.PopupOverlay" parent="AppTheme" />
<style name="Preference.SwitchPreferenceCompat" parent="@style/Preference.SwitchPreferenceCompat.Material" tools:ignore="ResourceCycle">
<item name="widgetLayout">@layout/preference_switch</item>
</style>
</resources>

View File

@@ -24,4 +24,13 @@
android:title="@string/setting_time_format" />
</PreferenceCategory>
<PreferenceCategory app:title="@string/setting_notifications" >
<SwitchPreferenceCompat
android:enabled="false"
android:defaultValue="@bool/notification_channels"
android:key="@string/setting_key_notification_channels"
android:title="@string/setting_notification_channels"
app:singleLineTitle="false" />
</PreferenceCategory>
</PreferenceScreen>