From 69600179d256c4fe6c29fe4f386d8a29516a2db7 Mon Sep 17 00:00:00 2001 From: bjoern Date: Tue, 14 Mar 2023 15:41:54 +0100 Subject: [PATCH] fix "empty hints" for "all media" view (#2499) a common hint makes things easier, and also has the advantage, that it is more clear to the user what the focus of this view is as it picks up the wording from the title. --- res/values/strings.xml | 1 + src/org/thoughtcrime/securesms/ProfileDocumentsFragment.java | 4 +++- src/org/thoughtcrime/securesms/ProfileGalleryFragment.java | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 7f78b616d..e37b74d11 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -457,6 +457,7 @@ Videos shared in this chat will appear here. Audio files and voice messages shared in this chat will appear here. Private apps shared in this chat will appear here. + Media shared in any chat will appear here. Media Preview Send Message diff --git a/src/org/thoughtcrime/securesms/ProfileDocumentsFragment.java b/src/org/thoughtcrime/securesms/ProfileDocumentsFragment.java index 746328fd5..9900ef350 100644 --- a/src/org/thoughtcrime/securesms/ProfileDocumentsFragment.java +++ b/src/org/thoughtcrime/securesms/ProfileDocumentsFragment.java @@ -124,7 +124,9 @@ public class ProfileDocumentsFragment ((ProfileDocumentsAdapter) recyclerView.getAdapter()).notifyAllSectionsDataSetChanged(); noMedia.setVisibility(recyclerView.getAdapter().getItemCount() > 0 ? View.GONE : View.VISIBLE); - if (showAudio) { + if (chatId == 0) { + noMedia.setText(R.string.tab_all_media_empty_hint); + } else if (showAudio) { noMedia.setText(R.string.tab_audio_empty_hint); } else if (showWebxdc) { noMedia.setText(R.string.tab_webxdc_empty_hint); diff --git a/src/org/thoughtcrime/securesms/ProfileGalleryFragment.java b/src/org/thoughtcrime/securesms/ProfileGalleryFragment.java index 7b971847b..06d550ce4 100644 --- a/src/org/thoughtcrime/securesms/ProfileGalleryFragment.java +++ b/src/org/thoughtcrime/securesms/ProfileGalleryFragment.java @@ -120,6 +120,9 @@ public class ProfileGalleryFragment ((ProfileGalleryAdapter) recyclerView.getAdapter()).notifyAllSectionsDataSetChanged(); noMedia.setVisibility(recyclerView.getAdapter().getItemCount() > 0 ? View.GONE : View.VISIBLE); + if (chatId == 0) { + noMedia.setText(R.string.tab_all_media_empty_hint); + } getActivity().invalidateOptionsMenu(); }