mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
fix linter
This commit is contained in:
parent
31f20219d5
commit
c02b815ff2
@ -40,9 +40,9 @@
|
||||
|
||||
<activity
|
||||
android:name=".ui.activities.OfflinePlayerActivity"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
|
||||
android:label="@string/player" />
|
||||
android:label="@string/player"
|
||||
android:supportsPictureInPicture="true" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.activities.MainActivity"
|
||||
|
@ -12,5 +12,5 @@ data class Channel(
|
||||
var nextpage: String? = null,
|
||||
var subscriberCount: Long = 0,
|
||||
var verified: Boolean = false,
|
||||
var relatedStreams: List<com.github.libretube.api.obj.StreamItem>? = null
|
||||
var relatedStreams: List<StreamItem>? = null
|
||||
)
|
||||
|
@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
data class CommentsPage(
|
||||
val comments: MutableList<com.github.libretube.api.obj.Comment> = arrayListOf(),
|
||||
val comments: MutableList<Comment> = arrayListOf(),
|
||||
val disabled: Boolean? = null,
|
||||
val nextpage: String? = ""
|
||||
)
|
||||
|
@ -12,5 +12,5 @@ data class Playlist(
|
||||
var uploaderUrl: String? = null,
|
||||
var uploaderAvatar: String? = null,
|
||||
var videos: Int? = 0,
|
||||
var relatedStreams: List<com.github.libretube.api.obj.StreamItem>? = null
|
||||
var relatedStreams: List<StreamItem>? = null
|
||||
)
|
||||
|
@ -4,5 +4,5 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
data class Segments(
|
||||
val segments: MutableList<com.github.libretube.api.obj.Segment> = arrayListOf()
|
||||
val segments: MutableList<Segment> = arrayListOf()
|
||||
)
|
||||
|
@ -19,10 +19,10 @@ fun View?.setWatchProgressLength(videoId: String, duration: Long) {
|
||||
return
|
||||
}
|
||||
|
||||
view.getViewTreeObserver()
|
||||
view.viewTreeObserver
|
||||
.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
|
||||
override fun onGlobalLayout() {
|
||||
this@setWatchProgressLength.getViewTreeObserver().removeOnGlobalLayoutListener(this)
|
||||
this@setWatchProgressLength.viewTreeObserver.removeOnGlobalLayoutListener(this)
|
||||
if (progress == null || duration == 0L) {
|
||||
view.visibility = View.GONE
|
||||
return
|
||||
|
@ -74,13 +74,15 @@ class RouterActivity : BaseActivity() {
|
||||
val videoId = uri.getQueryParameter("v")
|
||||
|
||||
intent.putExtra(IntentData.videoId, videoId)
|
||||
uri.getQueryParameter("t")?.let { intent.putExtra(IntentData.timeStamp, it.toLong()) }
|
||||
uri.getQueryParameter("t")
|
||||
?.let { intent.putExtra(IntentData.timeStamp, it.toLong()) }
|
||||
}
|
||||
else -> {
|
||||
val videoId = uri.path!!.replace("/", "")
|
||||
|
||||
intent.putExtra(IntentData.videoId, videoId)
|
||||
uri.getQueryParameter("t")?.let { intent.putExtra(IntentData.timeStamp, it.toLong()) }
|
||||
uri.getQueryParameter("t")
|
||||
?.let { intent.putExtra(IntentData.timeStamp, it.toLong()) }
|
||||
}
|
||||
}
|
||||
return intent
|
||||
|
@ -70,7 +70,10 @@ class CommentsAdapter(
|
||||
if (comment.pinned == true) pinnedImageView.visibility = View.VISIBLE
|
||||
if (comment.hearted == true) heartedImageView.visibility = View.VISIBLE
|
||||
if (comment.repliesPage != null) repliesAvailable.visibility = View.VISIBLE
|
||||
if ((comment.replyCount ?: -1L) > 0L) repliesCount.text = comment.replyCount?.formatShort()
|
||||
if ((comment.replyCount ?: -1L) > 0L) {
|
||||
repliesCount.text =
|
||||
comment.replyCount?.formatShort()
|
||||
}
|
||||
|
||||
commentorImage.setOnClickListener {
|
||||
NavigationHelper.navigateChannel(root.context, comment.commentorUrl)
|
||||
|
@ -411,7 +411,8 @@ class PlayerFragment : BaseFragment() {
|
||||
|
||||
// FullScreen button trigger
|
||||
// hide fullscreen button if auto rotation enabled
|
||||
playerBinding.fullscreen.visibility = if (PlayerHelper.autoRotationEnabled) View.GONE else View.VISIBLE
|
||||
playerBinding.fullscreen.visibility =
|
||||
if (PlayerHelper.autoRotationEnabled) View.GONE else View.VISIBLE
|
||||
playerBinding.fullscreen.setOnClickListener {
|
||||
// hide player controller
|
||||
exoPlayerView.hideController()
|
||||
@ -426,7 +427,8 @@ class PlayerFragment : BaseFragment() {
|
||||
|
||||
// share button
|
||||
binding.relPlayerShare.setOnClickListener {
|
||||
val shareDialog = ShareDialog(videoId!!, ShareObjectType.VIDEO, exoPlayer.currentPosition / 1000)
|
||||
val shareDialog =
|
||||
ShareDialog(videoId!!, ShareObjectType.VIDEO, exoPlayer.currentPosition / 1000)
|
||||
shareDialog.show(childFragmentManager, ShareDialog::class.java.name)
|
||||
}
|
||||
|
||||
@ -670,7 +672,12 @@ class PlayerFragment : BaseFragment() {
|
||||
if (binding.player.autoplayEnabled) setNextStream()
|
||||
|
||||
// add the video to the watch history
|
||||
if (PlayerHelper.watchHistoryEnabled) DatabaseHelper.addToWatchHistory(videoId!!, streams)
|
||||
if (PlayerHelper.watchHistoryEnabled) {
|
||||
DatabaseHelper.addToWatchHistory(
|
||||
videoId!!,
|
||||
streams
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -818,7 +825,10 @@ class PlayerFragment : BaseFragment() {
|
||||
playerTitle.text = response.title
|
||||
playerDescription.text = response.description
|
||||
|
||||
playerChannelSubCount.text = context?.getString(R.string.subscribers, response.uploaderSubscriberCount?.formatShort())
|
||||
playerChannelSubCount.text = context?.getString(
|
||||
R.string.subscribers,
|
||||
response.uploaderSubscriberCount?.formatShort()
|
||||
)
|
||||
}
|
||||
|
||||
// duration that's not greater than 0 indicates that the video is live
|
||||
@ -1000,7 +1010,8 @@ class PlayerFragment : BaseFragment() {
|
||||
} else {
|
||||
View.INVISIBLE
|
||||
}
|
||||
playerBinding.skipNext.visibility = if (PlayerHelper.skipButtonsEnabled) View.VISIBLE else View.INVISIBLE
|
||||
playerBinding.skipNext.visibility =
|
||||
if (PlayerHelper.skipButtonsEnabled) View.VISIBLE else View.INVISIBLE
|
||||
|
||||
playerBinding.skipPrev.setOnClickListener {
|
||||
videoId = PlayingQueue.getPrev()
|
||||
|
@ -83,6 +83,7 @@ object ImageHelper {
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private fun saveImage(context: Context, bitmapImage: Bitmap, imagePath: Uri) {
|
||||
context.contentResolver.openFileDescriptor(imagePath, "w")?.use {
|
||||
FileOutputStream(it.fileDescriptor).use { fos ->
|
||||
|
@ -72,7 +72,12 @@ class NowPlayingNotification(
|
||||
}
|
||||
}
|
||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
PendingIntent.getActivity(
|
||||
context,
|
||||
0,
|
||||
intent,
|
||||
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT
|
||||
)
|
||||
} else {
|
||||
PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
}
|
||||
|
@ -243,7 +243,8 @@ object PlayerHelper {
|
||||
false
|
||||
)
|
||||
|
||||
val pipEnabled: Boolean get() = PreferenceHelper.getBoolean(
|
||||
val pipEnabled: Boolean
|
||||
get() = PreferenceHelper.getBoolean(
|
||||
PreferenceKeys.PICTURE_IN_PICTURE,
|
||||
true
|
||||
)
|
||||
|
@ -10,10 +10,10 @@
|
||||
|
||||
<de.hdodenhof.circleimageview.CircleImageView
|
||||
android:id="@+id/subscription_channel_image"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerVertical="true" />
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="8dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subscription_channel_name"
|
||||
@ -34,10 +34,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:stateListAnimator="@null"
|
||||
android:text="@string/unsubscribe"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:textSize="12sp"
|
||||
app:cornerRadius="20dp" />
|
||||
</RelativeLayout>
|
@ -28,14 +28,14 @@
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:visibility="gone"
|
||||
android:id="@+id/timeStampLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="25dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:hint="@string/time_code">
|
||||
android:hint="@string/time_code"
|
||||
android:visibility="gone">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/timeStamp"
|
||||
|
@ -27,8 +27,8 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<de.hdodenhof.circleimageview.CircleImageView
|
||||
@ -107,12 +107,12 @@
|
||||
<TextView
|
||||
android:id="@+id/channel_description"
|
||||
android:layout_width="wrap_content"
|
||||
android:background="@drawable/rounded_ripple"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:autoLink="web"
|
||||
android:background="@drawable/rounded_ripple"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2" />
|
||||
|
||||
|
@ -258,9 +258,9 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
|
Loading…
x
Reference in New Issue
Block a user