feat:(queue): add tooltips

This commit is contained in:
FineFindus 2023-08-14 15:21:36 +02:00 committed by Bnyro
parent 7cd944ffe7
commit 4ef4cf33d5
3 changed files with 22 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package com.github.libretube.ui.sheets
import android.annotation.SuppressLint
import android.os.Build
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
@ -49,6 +50,18 @@ class PlayingQueueSheet : ExpandedBottomSheet() {
val currentPlayingIndex = PlayingQueue.currentIndex()
if (currentPlayingIndex != -1) binding.optionsRecycler.scrollToPosition(currentPlayingIndex)
// tooltips are only supported since API 26
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
binding.repeat.tooltipText = getString(R.string.repeat)
binding.shuffle.tooltipText = getString(R.string.shuffle)
binding.reverse.tooltipText = getString(R.string.reverse)
binding.addToPlaylist.tooltipText = getString(R.string.addToPlaylist)
binding.sort.tooltipText = getString(R.string.sort)
binding.watchPositionsOptions.tooltipText = getString(R.string.watch_position)
binding.clearQueue.tooltipText = getString(R.string.clear_queue)
binding.dismiss?.tooltipText = getString(R.string.dismiss)
}
binding.shuffle.setOnClickListener {
val streams = PlayingQueue.getStreams().toMutableList()
val currentIndex = PlayingQueue.currentIndex()

View File

@ -73,6 +73,7 @@
android:src="@drawable/ic_close" />
<ImageView
android:id="@+id/dismiss"
style="@style/QueueSheetOption"
android:layout_width="0dp"
android:layout_weight="1"

View File

@ -486,4 +486,12 @@
<item quantity="one">%d new stream</item>
<item quantity="other">%d new streams</item>
</plurals>
<!--Tooltips for queue options-->
<string name="repeat">Repeat</string>
<string name="reverse">Reverse</string>
<string name="sort">Sort</string>
<string name="watch_position">Watch position</string>
<string name="clear_queue">Clear queue</string>
<string name="dismiss">Dismiss</string>
</resources>