Merge branch 'dev' of https://github.com/rebelonion/Dantotsu into dev
This commit is contained in:
commit
160f783c6d
4 changed files with 50 additions and 14 deletions
|
@ -61,6 +61,7 @@ import androidx.media3.exoplayer.util.EventLogger
|
|||
import androidx.media3.session.MediaSession
|
||||
import androidx.media3.ui.*
|
||||
import androidx.media3.ui.CaptionStyleCompat.*
|
||||
import androidx.media3.exoplayer.DefaultLoadControl
|
||||
import androidx.mediarouter.app.MediaRouteButton
|
||||
import ani.dantotsu.*
|
||||
import ani.dantotsu.R
|
||||
|
@ -1448,10 +1449,26 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
|||
|
||||
private fun buildExoplayer() {
|
||||
//Player
|
||||
val DEFAULT_MIN_BUFFER_MS = 600000
|
||||
val DEFAULT_MAX_BUFFER_MS = 600000
|
||||
val BUFFER_FOR_PLAYBACK_MS = 2500
|
||||
val BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS = 5000
|
||||
|
||||
val loadControl = DefaultLoadControl.Builder()
|
||||
.setBackBuffer(1000 * 60 * 2, true)
|
||||
.setBufferDurationsMs(
|
||||
DEFAULT_MIN_BUFFER_MS,
|
||||
DEFAULT_MAX_BUFFER_MS,
|
||||
BUFFER_FOR_PLAYBACK_MS,
|
||||
BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS
|
||||
)
|
||||
.build()
|
||||
|
||||
hideSystemBars()
|
||||
exoPlayer = ExoPlayer.Builder(this)
|
||||
.setMediaSourceFactory(DefaultMediaSourceFactory(cacheFactory))
|
||||
.setTrackSelector(trackSelector)
|
||||
.setLoadControl(loadControl)
|
||||
.build().apply {
|
||||
playWhenReady = true
|
||||
this.playbackParameters = this@ExoplayerView.playbackParameters
|
||||
|
@ -2032,4 +2049,4 @@ class CustomCastButton : MediaRouteButton {
|
|||
true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,12 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import ani.dantotsu.R
|
||||
import ani.dantotsu.connections.comments.Comment
|
||||
import ani.dantotsu.connections.comments.CommentsAPI
|
||||
import ani.dantotsu.copyToClipboard
|
||||
import ani.dantotsu.currActivity
|
||||
import ani.dantotsu.databinding.ItemCommentsBinding
|
||||
import ani.dantotsu.loadImage
|
||||
import ani.dantotsu.openLinkInBrowser
|
||||
import ani.dantotsu.others.ImageViewDialog
|
||||
import ani.dantotsu.snackString
|
||||
import com.xwray.groupie.GroupieAdapter
|
||||
import com.xwray.groupie.Section
|
||||
|
@ -53,9 +56,11 @@ class CommentItem(val comment: Comment,
|
|||
viewBinding.commentEdit.visibility = if (isUserComment) View.VISIBLE else View.GONE
|
||||
if ((comment.replyCount ?: 0) > 0) {
|
||||
viewBinding.commentTotalReplies.visibility = View.VISIBLE
|
||||
viewBinding.commentRepliesDivider.visibility = View.VISIBLE
|
||||
viewBinding.commentTotalReplies.text = "View ${comment.replyCount} repl${if (comment.replyCount == 1) "y" else "ies"}"
|
||||
} else {
|
||||
viewBinding.commentTotalReplies.visibility = View.GONE
|
||||
viewBinding.commentRepliesDivider.visibility = View.GONE
|
||||
}
|
||||
viewBinding.commentReply.visibility = View.VISIBLE
|
||||
viewBinding.commentTotalReplies.setOnClickListener {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue