From 7766fd13fd2274eb8bbe2bbfdc9f9849587dc62d Mon Sep 17 00:00:00 2001 From: Stypox Date: Sun, 16 Aug 2020 00:01:43 +0200 Subject: [PATCH] Extract hardcoded strings into strings.xml and improve them --- .../newpipe/player/NotificationUtil.java | 10 +- app/src/main/res/values/settings_keys.xml | 172 +++++++++--------- app/src/main/res/values/strings.xml | 33 +++- app/src/main/res/xml/appearance_settings.xml | 58 +++--- 4 files changed, 144 insertions(+), 129 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/NotificationUtil.java b/app/src/main/java/org/schabi/newpipe/player/NotificationUtil.java index 3b7e2ac3d..96ade4d7e 100644 --- a/app/src/main/java/org/schabi/newpipe/player/NotificationUtil.java +++ b/app/src/main/java/org/schabi/newpipe/player/NotificationUtil.java @@ -208,15 +208,15 @@ public final class NotificationUtil { private void initializeNotificationSlots(final VideoPlayerImpl player) { notificationSlot0 = player.sharedPreferences.getString( - player.context.getString(R.string.notification_slot_0_key), notificationSlot0); + player.context.getString(R.string.notification_action_0_key), notificationSlot0); notificationSlot1 = player.sharedPreferences.getString( - player.context.getString(R.string.notification_slot_1_key), notificationSlot1); + player.context.getString(R.string.notification_action_1_key), notificationSlot1); notificationSlot2 = player.sharedPreferences.getString( - player.context.getString(R.string.notification_slot_2_key), notificationSlot2); + player.context.getString(R.string.notification_action_2_key), notificationSlot2); notificationSlot3 = player.sharedPreferences.getString( - player.context.getString(R.string.notification_slot_3_key), notificationSlot3); + player.context.getString(R.string.notification_action_3_key), notificationSlot3); notificationSlot4 = player.sharedPreferences.getString( - player.context.getString(R.string.notification_slot_4_key), notificationSlot4); + player.context.getString(R.string.notification_action_4_key), notificationSlot4); } @SuppressLint("RestrictedApi") diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml index 36dde583c..6099c6ecf 100644 --- a/app/src/main/res/values/settings_keys.xml +++ b/app/src/main/res/values/settings_keys.xml @@ -118,107 +118,107 @@ 0,1,2 scale_to_square_image_in_notifications - prev - next - rewind - forward - smart_rewind_prev - smart_forward_next - play_pause_buffering - play_pause - repeat - shuffle - close - n/a + prev + next + rewind + forward + smart_rewind_prev + smart_forward_next + play_pause_buffering + play_pause + repeat + shuffle + close + n/a - notification_slot_0_key - @string/notification_slot_smart_rewind_prev_key - - Rewind / Previous - Previous - Rewind + notification_action_0_key + @string/notification_action_smart_rewind_prev_key + + @string/notification_action_smart_rewind_prev_value + @string/notification_action_prev_value + @string/notification_action_rewind_value - - @string/notification_slot_smart_rewind_prev_key - @string/notification_slot_prev_key - @string/notification_slot_rewind_key + + @string/notification_action_smart_rewind_prev_key + @string/notification_action_prev_key + @string/notification_action_rewind_key - notification_slot_1_key - @string/notification_slot_play_pause_buffering_key - - Play / Pause / Buffering - Play / Pause - Rewind + notification_action_1_key + @string/notification_action_play_pause_buffering_key + + @string/notification_action_play_pause_buffering_value + @string/notification_action_play_pause_value + @string/notification_action_rewind_value - - @string/notification_slot_play_pause_buffering_key - @string/notification_slot_play_pause_key - @string/notification_slot_rewind_key + + @string/notification_action_play_pause_buffering_key + @string/notification_action_play_pause_key + @string/notification_action_rewind_key - notification_slot_2_key - @string/notification_slot_smart_forward_next_key - - Forward / Next - Forward - Next - Play / Pause / Buffering - Play / Pause + notification_action_2_key + @string/notification_action_smart_forward_next_key + + @string/notification_action_smart_forward_next_value + @string/notification_action_forward_value + @string/notification_action_next_value + @string/notification_action_play_pause_buffering_value + @string/notification_action_play_pause_value - - @string/notification_slot_smart_forward_next_key - @string/notification_slot_forward_key - @string/notification_slot_next_key - @string/notification_slot_play_pause_buffering_key - @string/notification_slot_play_pause_key + + @string/notification_action_smart_forward_next_key + @string/notification_action_forward_key + @string/notification_action_next_key + @string/notification_action_play_pause_buffering_key + @string/notification_action_play_pause_key - notification_slot_3_key - @string/notification_slot_repeat_key - - Repeat - Shuffle - Previous - Forward - Forward / Next - Rewind - Rewind / Previous - Close - N/A + notification_action_3_key + @string/notification_action_repeat_key + + @string/notification_action_repeat_value + @string/notification_action_shuffle_value + @string/notification_action_prev_value + @string/notification_action_forward_value + @string/notification_action_smart_forward_next_value + @string/notification_action_rewind_value + @string/notification_action_smart_rewind_prev_value + @string/notification_action_close_value + @string/notification_action_n_a_value - - @string/notification_slot_repeat_key - @string/notification_slot_shuffle_key - @string/notification_slot_prev_key - @string/notification_slot_forward_key - @string/notification_slot_smart_forward_next_key - @string/notification_slot_rewind_key - @string/notification_slot_smart_rewind_prev_key - @string/notification_slot_close_key - @string/notification_slot_n_a_key + + @string/notification_action_repeat_key + @string/notification_action_shuffle_key + @string/notification_action_prev_key + @string/notification_action_forward_key + @string/notification_action_smart_forward_next_key + @string/notification_action_rewind_key + @string/notification_action_smart_rewind_prev_key + @string/notification_action_close_key + @string/notification_action_n_a_key - notification_slot_4_key - @string/notification_slot_close_key - - Close - Repeat - Shuffle - Next - Forward - Forward / Next - N/A + notification_action_4_key + @string/notification_action_close_key + + @string/notification_action_close_value + @string/notification_action_repeat_value + @string/notification_action_shuffle_value + @string/notification_action_next_value + @string/notification_action_forward_value + @string/notification_action_smart_forward_next_value + @string/notification_action_n_a_value - - @string/notification_slot_close_key - @string/notification_slot_repeat_key - @string/notification_slot_shuffle_key - @string/notification_slot_next_key - @string/notification_slot_forward_key - @string/notification_slot_smart_forward_next_key - @string/notification_slot_n_a_key + + @string/notification_action_close_key + @string/notification_action_repeat_key + @string/notification_action_shuffle_key + @string/notification_action_next_key + @string/notification_action_forward_key + @string/notification_action_smart_forward_next_key + @string/notification_action_n_a_key video_mp4 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 20b6b81f6..3f58d186a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -58,15 +58,30 @@ org.xbmc.kore Show \"Play with Kodi\" option Display an option to play a video via Kodi media center - Scale image to 1:1 aspect ratio - This will scale the notification image from 16:9 to 1:1 aspect ratio - Notification slot 0 - Notification slot 1 - Notification slot 2 - Notification slot 3 - Notification slot 4 - Notification compact view - Notification slots to show in compact view + + Scale image to 1:1 aspect ratio + This will scale the notification image from 16:9 to 1:1 aspect ratio + First action button + Second action button + Third action button + Fourth action button + Fifth action button + Notification compact view + Notification slots to show in compact view + + Previous + Next + Rewind + Forward + Rewind / Previous + Forward / Next + Play / Pause / Buffering + Play / Pause + Repeat + Shuffle + Close + Nothing + Audio Default audio format Default video format diff --git a/app/src/main/res/xml/appearance_settings.xml b/app/src/main/res/xml/appearance_settings.xml index 3cdaf8e9e..7b25a4ab5 100644 --- a/app/src/main/res/xml/appearance_settings.xml +++ b/app/src/main/res/xml/appearance_settings.xml @@ -42,60 +42,60 @@