Explorar o código

Proposed UI changes of notification settings

Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Dariusz Olszewski %!s(int64=3) %!d(string=hai) anos
pai
achega
09879ff347

+ 6 - 0
app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java

@@ -156,6 +156,8 @@ public class SettingsController extends BaseController {
     TextView serverAgeTextView;
     TextView serverAgeTextView;
     @BindView(R.id.server_age_warning_icon)
     @BindView(R.id.server_age_warning_icon)
     ImageView serverAgeIcon;
     ImageView serverAgeIcon;
+    @BindView(R.id.settings_notifications_category)
+    MaterialPreferenceCategory notificationsCategory;
     @BindView(R.id.settings_call_sound)
     @BindView(R.id.settings_call_sound)
     MaterialStandardPreference settingsCallSound;
     MaterialStandardPreference settingsCallSound;
     @BindView(R.id.settings_message_sound)
     @BindView(R.id.settings_message_sound)
@@ -514,6 +516,10 @@ public class SettingsController extends BaseController {
             }
             }
         }
         }
 
 
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+            notificationsCategory.setTitle(getResources().getString(R.string.nc_settings_notification_sounds_post_oreo));
+        }
+
         Uri callRingtoneUri = NotificationUtils.INSTANCE.getCallRingtoneUri(view.getContext(), appPreferences);
         Uri callRingtoneUri = NotificationUtils.INSTANCE.getCallRingtoneUri(view.getContext(), appPreferences);
         settingsCallSound.setSummary(getRingtoneName(view.getContext(), callRingtoneUri));
         settingsCallSound.setSummary(getRingtoneName(view.getContext(), callRingtoneUri));
 
 

+ 1 - 1
app/src/main/java/com/nextcloud/talk/utils/NotificationUtils.kt

@@ -136,7 +136,7 @@ object NotificationUtils {
             context,
             context,
             NOTIFICATION_CHANNEL_MESSAGES_V3,
             NOTIFICATION_CHANNEL_MESSAGES_V3,
             context.resources.getString(R.string.nc_notification_channel_messages),
             context.resources.getString(R.string.nc_notification_channel_messages),
-            context.resources.getString(R.string.nc_notification_channel_messages),
+            context.resources.getString(R.string.nc_notification_channel_messages_description),
             true,
             true,
             NotificationManagerCompat.IMPORTANCE_HIGH,
             NotificationManagerCompat.IMPORTANCE_HIGH,
             soundUri,
             soundUri,

+ 1 - 0
app/src/main/res/layout/controller_settings.xml

@@ -161,6 +161,7 @@
     </com.yarolegovich.mp.MaterialPreferenceCategory>
     </com.yarolegovich.mp.MaterialPreferenceCategory>
 
 
     <com.yarolegovich.mp.MaterialPreferenceCategory
     <com.yarolegovich.mp.MaterialPreferenceCategory
+        android:id="@+id/settings_notifications_category"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
         android:animateLayoutChanges="true"
         android:animateLayoutChanges="true"

+ 7 - 5
app/src/main/res/values/strings.xml

@@ -94,10 +94,11 @@
     <string name="nc_settings_no_talk_installed">Talk app is not installed on the server you tried to authenticate against</string>
     <string name="nc_settings_no_talk_installed">Talk app is not installed on the server you tried to authenticate against</string>
     <string name="nc_settings_account_updated">Your already existing account was updated, instead of adding a new one</string>
     <string name="nc_settings_account_updated">Your already existing account was updated, instead of adding a new one</string>
     <string name="nc_account_scheduled_for_deletion">The account is scheduled for deletion, and cannot be changed</string>
     <string name="nc_account_scheduled_for_deletion">The account is scheduled for deletion, and cannot be changed</string>
-    <string name="nc_settings_notification_sounds">Sound</string>
+    <string name="nc_settings_notification_sounds">Notification sounds</string>
+    <string name="nc_settings_notification_sounds_post_oreo">Notifications</string>
     <string name="nc_settings_call_ringtone">Calls</string>
     <string name="nc_settings_call_ringtone">Calls</string>
     <string name="nc_settings_call_ringtone_key" translatable="false">call_ringtone</string>
     <string name="nc_settings_call_ringtone_key" translatable="false">call_ringtone</string>
-    <string name="nc_settings_other_notifications_ringtone">Notifications</string>
+    <string name="nc_settings_other_notifications_ringtone">Messages</string>
     <string name="nc_settings_message_ringtone_key" translatable="false">message_ringtone</string>
     <string name="nc_settings_message_ringtone_key" translatable="false">message_ringtone</string>
     <string name="nc_settings_default_ringtone" translatable="false">Librem by feandesign</string>
     <string name="nc_settings_default_ringtone" translatable="false">Librem by feandesign</string>
     <string name="nc_settings_no_ringtone">No sound</string>
     <string name="nc_settings_no_ringtone">No sound</string>
@@ -227,9 +228,10 @@
 
 
     <!-- Notification channels -->
     <!-- Notification channels -->
     <string name="nc_notification_channel">%1$s on %2$s notification channel</string>
     <string name="nc_notification_channel">%1$s on %2$s notification channel</string>
-    <string name="nc_notification_channel_calls">Calls notification channel</string>
-    <string name="nc_notification_channel_messages">Messages notification channel</string>
-    <string name="nc_notification_channel_calls_description">Shows incoming calls</string>
+    <string name="nc_notification_channel_calls">Calls</string>
+    <string name="nc_notification_channel_messages">Messages</string>
+    <string name="nc_notification_channel_calls_description">Notify about incoming calls</string>
+    <string name="nc_notification_channel_messages_description">Notify about incoming messages</string>
     <string name="nc_notification_settings">Notification settings</string>
     <string name="nc_notification_settings">Notification settings</string>
     <string name="nc_plain_old_messages">Messages</string>
     <string name="nc_plain_old_messages">Messages</string>
     <string name="nc_notify_me_always">Always notify</string>
     <string name="nc_notify_me_always">Always notify</string>