mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-26 23:10:32 +05:30
commit
02bdffeb3f
@ -13,8 +13,8 @@ android {
|
||||
applicationId 'com.github.libretube'
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
versionCode 20
|
||||
versionName '0.6.1'
|
||||
versionCode 21
|
||||
versionName '0.7.0'
|
||||
multiDexEnabled true
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
resValue "string", "app_name", "LibreTube"
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.github.libretube.ui.adapters
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.graphics.Color
|
||||
import android.text.format.DateUtils
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
@ -12,6 +13,8 @@ import com.github.libretube.util.PlayingQueue
|
||||
import com.github.libretube.util.ThemeHelper
|
||||
|
||||
class PlayingQueueAdapter : RecyclerView.Adapter<PlayingQueueViewHolder>() {
|
||||
private val currentIndex = PlayingQueue.currentIndex()
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PlayingQueueViewHolder {
|
||||
val binding = QueueRowBinding.inflate(
|
||||
LayoutInflater.from(parent.context),
|
||||
@ -34,11 +37,13 @@ class PlayingQueueAdapter : RecyclerView.Adapter<PlayingQueueViewHolder>() {
|
||||
videoInfo.text = streamItem.uploaderName + " • " +
|
||||
DateUtils.formatElapsedTime(streamItem.duration ?: 0)
|
||||
|
||||
if (PlayingQueue.currentIndex() == position) {
|
||||
root.setBackgroundColor(
|
||||
root.setBackgroundColor(
|
||||
if (currentIndex == position) {
|
||||
ThemeHelper.getThemeColor(root.context, android.R.attr.colorControlHighlight)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
Color.TRANSPARENT
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,11 +34,11 @@ class PlayingQueueSheet : BottomSheetDialogFragment() {
|
||||
binding.optionsRecycler.adapter = adapter
|
||||
|
||||
binding.shuffle.setOnClickListener {
|
||||
val streams = PlayingQueue.getStreams()
|
||||
var streams = PlayingQueue.getStreams()
|
||||
val currentIndex = PlayingQueue.currentIndex()
|
||||
val current = streams[currentIndex]
|
||||
|
||||
streams.shuffle()
|
||||
streams = streams.shuffled().toMutableList()
|
||||
streams.remove(current)
|
||||
streams.add(currentIndex, current)
|
||||
PlayingQueue.setStreams(streams)
|
||||
@ -47,11 +47,11 @@ class PlayingQueueSheet : BottomSheetDialogFragment() {
|
||||
}
|
||||
|
||||
binding.clear.setOnClickListener {
|
||||
val streams = PlayingQueue.getStreams()
|
||||
val index = PlayingQueue.currentIndex()
|
||||
val currentIndex = PlayingQueue.currentIndex()
|
||||
|
||||
while (index >= PlayingQueue.size()) {
|
||||
streams.removeAt(index)
|
||||
val streams = PlayingQueue.getStreams().filterIndexed {
|
||||
position, _ ->
|
||||
position <= currentIndex
|
||||
}
|
||||
|
||||
PlayingQueue.setStreams(streams)
|
||||
|
@ -3,7 +3,6 @@ package com.github.libretube.util
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.SystemClock
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
|
||||
abstract class DoubleTapListener : View.OnClickListener {
|
||||
@ -31,7 +30,6 @@ abstract class DoubleTapListener : View.OnClickListener {
|
||||
|
||||
private val runnable = Runnable {
|
||||
if (isSecondClick()) return@Runnable
|
||||
Log.e("single", "single")
|
||||
onSingleClick()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user