From 051c572e7fb5fa5a1a28e8d0efa54703e55f5084 Mon Sep 17 00:00:00 2001 From: Stypox Date: Tue, 13 Sep 2022 15:08:37 +0200 Subject: [PATCH] Show correct tooltips for actions in feed --- .../schabi/newpipe/local/feed/FeedFragment.kt | 19 +++++++++++++++++++ app/src/main/res/values/strings.xml | 4 +++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt index 899163050..d0608e833 100644 --- a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt +++ b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt @@ -41,6 +41,7 @@ import androidx.appcompat.app.AlertDialog import androidx.appcompat.content.res.AppCompatResources import androidx.core.content.edit import androidx.core.os.bundleOf +import androidx.core.view.MenuItemCompat import androidx.core.view.isVisible import androidx.lifecycle.ViewModelProvider import androidx.preference.PreferenceManager @@ -286,6 +287,15 @@ class FeedFragment : BaseStateFragment() { requireContext(), if (showPlayedItems) R.drawable.ic_visibility_on else R.drawable.ic_visibility_off ) + MenuItemCompat.setTooltipText( + menuItem, + getString( + if (showPlayedItems) + R.string.feed_toggle_hide_played_items + else + R.string.feed_toggle_show_played_items + ) + ) } private fun updateToggleFutureItemsButton(menuItem: MenuItem) { @@ -294,6 +304,15 @@ class FeedFragment : BaseStateFragment() { requireContext(), if (showFutureItems) R.drawable.ic_history_future else R.drawable.ic_history ) + MenuItemCompat.setTooltipText( + menuItem, + getString( + if (showPlayedItems) + R.string.feed_toggle_hide_future_items + else + R.string.feed_toggle_show_future_items + ) + ) } // ////////////////////////////////////////////////////////////////////////// diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b742f2517..8b4a2efcd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -684,6 +684,7 @@ \n \nSo the choice boils down to what you prefer: speed or precise information. Show watched items + Hide watched items This content is not yet supported by NewPipe.\n\nIt will hopefully be supported in a future version. Channel\'s avatar thumbnail Created by %s @@ -746,5 +747,6 @@ Select quality for external players Unknown format Unknown quality - Show future videos + Show future items + Hide future items \ No newline at end of file