Skip to content

Commit

Permalink
Merge pull request #8966 from Stypox/feed-menuitem-tooltip
Browse files Browse the repository at this point in the history
Show correct tooltips for actions in feed
  • Loading branch information
Stypox authored Sep 19, 2022
2 parents ca29f6c + 051c572 commit f26bf33
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
19 changes: 19 additions & 0 deletions app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -286,6 +287,15 @@ class FeedFragment : BaseStateFragment<FeedState>() {
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) {
Expand All @@ -294,6 +304,15 @@ class FeedFragment : BaseStateFragment<FeedState>() {
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
)
)
}

// //////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@
\n
\nSo the choice boils down to what you prefer: speed or precise information.</string>
<string name="feed_toggle_show_played_items">Show watched items</string>
<string name="feed_toggle_hide_played_items">Hide watched items</string>
<string name="content_not_supported">This content is not yet supported by NewPipe.\n\nIt will hopefully be supported in a future version.</string>
<string name="detail_sub_channel_thumbnail_view_description">Channel\'s avatar thumbnail</string>
<string name="channel_created_by">Created by %s</string>
Expand Down Expand Up @@ -746,5 +747,6 @@
<string name="select_quality_external_players">Select quality for external players</string>
<string name="unknown_format">Unknown format</string>
<string name="unknown_quality">Unknown quality</string>
<string name="feed_toggle_show_future_items">Show future videos</string>
<string name="feed_toggle_show_future_items">Show future items</string>
<string name="feed_toggle_hide_future_items">Hide future items</string>
</resources>

0 comments on commit f26bf33

Please sign in to comment.