mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
format
This commit is contained in:
parent
e32758d17d
commit
8be5a293bc
@ -247,7 +247,8 @@ class MainActivity : BaseActivity() {
|
||||
lastSeenVideoId == it.url?.toID()
|
||||
} ?: return@observe
|
||||
if (lastSeenVideoIndex < 1) return@observe
|
||||
binding.bottomNav.getOrCreateBadge(R.id.subscriptionsFragment).number = lastSeenVideoIndex
|
||||
binding.bottomNav.getOrCreateBadge(R.id.subscriptionsFragment).number =
|
||||
lastSeenVideoIndex
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,8 +23,14 @@ class BottomSheetAdapter(
|
||||
override fun onBindViewHolder(holder: BottomSheetViewHolder, position: Int) {
|
||||
val item = items[position]
|
||||
holder.binding.apply {
|
||||
title.text = if (item.currentValue != null) "${item.title} (${item.currentValue})" else item.title
|
||||
if (item.drawable != null) drawable.setImageResource(item.drawable) else drawable.visibility = View.GONE
|
||||
title.text =
|
||||
if (item.currentValue != null) "${item.title} (${item.currentValue})" else item.title
|
||||
if (item.drawable != null) {
|
||||
drawable.setImageResource(item.drawable)
|
||||
} else {
|
||||
drawable.visibility =
|
||||
View.GONE
|
||||
}
|
||||
|
||||
root.setOnClickListener {
|
||||
listener.invoke(position)
|
||||
|
@ -32,9 +32,10 @@ class BackupDialog(
|
||||
|
||||
binding = DialogBackupBinding.inflate(layoutInflater)
|
||||
binding.backupOptionsRecycler.layoutManager = LinearLayoutManager(context)
|
||||
binding.backupOptionsRecycler.adapter = BackupOptionsAdapter(backupOptions) { position, isChecked ->
|
||||
selected[position] = isChecked
|
||||
}
|
||||
binding.backupOptionsRecycler.adapter =
|
||||
BackupOptionsAdapter(backupOptions) { position, isChecked ->
|
||||
selected[position] = isChecked
|
||||
}
|
||||
|
||||
return MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(R.string.backup)
|
||||
|
@ -477,7 +477,8 @@ class PlayerFragment : BaseFragment() {
|
||||
exoPlayer.setMediaItem(mediaItem)
|
||||
} else {
|
||||
val videoUri = videosUrlArray[which]
|
||||
val audioUrl = PlayerHelper.getAudioSource(requireContext(), streams.audioStreams!!)
|
||||
val audioUrl =
|
||||
PlayerHelper.getAudioSource(requireContext(), streams.audioStreams!!)
|
||||
setMediaSource(videoUri, audioUrl)
|
||||
}
|
||||
exoPlayer.seekTo(lastPosition)
|
||||
@ -1290,7 +1291,8 @@ class PlayerFragment : BaseFragment() {
|
||||
// search for quality preference in the available stream sources
|
||||
if (pipedStream.contains(defRes)) {
|
||||
val videoUri = videosUrlArray[index]
|
||||
val audioUrl = PlayerHelper.getAudioSource(requireContext(), streams.audioStreams!!)
|
||||
val audioUrl =
|
||||
PlayerHelper.getAudioSource(requireContext(), streams.audioStreams!!)
|
||||
setMediaSource(videoUri, audioUrl)
|
||||
return
|
||||
}
|
||||
|
@ -47,12 +47,14 @@ object NetworkHelper {
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
fun isNetworkMobile(context: Context): Boolean {
|
||||
val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||
val connectivityManager =
|
||||
context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
val networkCapabilities = connectivityManager.getNetworkCapabilities(
|
||||
connectivityManager.activeNetwork ?: return false
|
||||
)
|
||||
return networkCapabilities?.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) ?: false
|
||||
return networkCapabilities?.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR)
|
||||
?: false
|
||||
} else {
|
||||
val activeNetwork = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE)
|
||||
return activeNetwork != null && activeNetwork.isConnected
|
||||
|
@ -173,7 +173,8 @@ internal class CustomExoPlayerView(
|
||||
BottomSheetItem(
|
||||
context.getString(R.string.playback_speed),
|
||||
R.drawable.ic_speed,
|
||||
"${player?.playbackParameters?.speed
|
||||
"${
|
||||
player?.playbackParameters?.speed
|
||||
.toString()
|
||||
.replace(".0", "")
|
||||
}x"
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.github.libretube.views.CustomExoPlayerView
|
||||
android:id="@+id/player"
|
||||
|
@ -385,8 +385,8 @@
|
||||
android:layout_marginEnd="-10dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:paddingEnd="10dp"
|
||||
app:strokeWidth="1dp"
|
||||
app:cardBackgroundColor="#88000000"
|
||||
app:strokeWidth="1dp"
|
||||
tools:ignore="RtlSymmetry">
|
||||
|
||||
<LinearLayout
|
||||
|
Loading…
x
Reference in New Issue
Block a user