Merge pull request #1238 from Bnyro/master

bug fixes
This commit is contained in:
Bnyro 2022-09-08 22:00:39 +02:00 committed by GitHub
commit 1f95760271
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 27 deletions

View File

@ -55,17 +55,7 @@ class RouterActivity : BaseActivity() {
intent.putExtra(IntentData.channelName, channelName)
}
uri.path!!.contains("/playlist") -> {
var playlistId = uri.query!!
if (playlistId.contains("&")) {
for (v in playlistId.split("&")) {
if (v.contains("list=")) {
playlistId = v.replace("list=", "")
break
}
}
} else {
playlistId = playlistId.replace("list=", "")
}
val playlistId = uri.getQueryParameter("list")
intent.putExtra(IntentData.playlistId, playlistId)
}
@ -81,20 +71,7 @@ class RouterActivity : BaseActivity() {
intent.putExtra(IntentData.videoId, videoId)
}
uri.path!!.contains("/watch") && uri.query != null -> {
var videoId = uri.query!!
if (videoId.contains("&")) {
val watches = videoId.split("&")
for (v in watches) {
if (v.contains("v=")) {
videoId = v.replace("v=", "")
break
}
}
} else {
videoId = videoId
.replace("v=", "")
}
val videoId = uri.getQueryParameter("v")
intent.putExtra(IntentData.videoId, videoId)
}

View File

@ -101,7 +101,6 @@ import com.google.android.exoplayer2.upstream.DefaultHttpDataSource
import com.google.android.exoplayer2.util.RepeatModeUtil
import com.google.android.exoplayer2.video.VideoSize
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import kotlin.math.abs
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
@ -109,6 +108,7 @@ import org.chromium.net.CronetEngine
import retrofit2.HttpException
import java.io.IOException
import java.util.concurrent.Executors
import kotlin.math.abs
class PlayerFragment : BaseFragment() {

View File

@ -46,7 +46,10 @@ class SearchFragment : BaseFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.suggestionsRecycler.layoutManager = LinearLayoutManager(requireContext())
binding.suggestionsRecycler.layoutManager = LinearLayoutManager(requireContext()).apply {
reverseLayout = true
stackFromEnd = true
}
// waiting for the query to change
viewModel.searchQuery.observe(viewLifecycleOwner) {