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