mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -17,6 +17,7 @@ import androidx.media3.datasource.cache.LeastRecentlyUsedCacheEvictor
|
||||
import androidx.media3.datasource.cache.SimpleCache
|
||||
import androidx.media3.exoplayer.DefaultLoadControl
|
||||
import androidx.media3.exoplayer.ExoPlayer
|
||||
import androidx.media3.exoplayer.LoadControl.Parameters
|
||||
import androidx.media3.exoplayer.offline.DefaultDownloaderFactory
|
||||
import androidx.media3.exoplayer.offline.DownloadRequest
|
||||
import androidx.media3.exoplayer.offline.Downloader
|
||||
@@ -596,22 +597,8 @@ class HttpReadAloudService : BaseReadAloudService(),
|
||||
}
|
||||
|
||||
inner class CustomLoadControl : DefaultLoadControl() {
|
||||
override fun shouldStartPlayback(
|
||||
timeline: Timeline,
|
||||
mediaPeriodId: MediaSource.MediaPeriodId,
|
||||
bufferedDurationUs: Long,
|
||||
playbackSpeed: Float,
|
||||
rebuffering: Boolean,
|
||||
targetLiveOffsetUs: Long
|
||||
): Boolean {
|
||||
return super.shouldStartPlayback(
|
||||
timeline,
|
||||
mediaPeriodId,
|
||||
bufferedDurationUs,
|
||||
playbackSpeed,
|
||||
rebuffering,
|
||||
targetLiveOffsetUs
|
||||
) || bufferedPercentage == 100
|
||||
override fun shouldStartPlayback(parameters: Parameters): Boolean {
|
||||
return super.shouldStartPlayback(parameters) || bufferedPercentage == 100
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@ class ReadBookActivity : BaseReadBookActivity(),
|
||||
}
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent?) {
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
if (!ReadBook.inBookshelf) {
|
||||
viewModel.removeFromBookshelf(null)
|
||||
|
||||
@@ -93,9 +93,9 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
|
||||
receiptIntent(intent)
|
||||
}
|
||||
|
||||
override fun onNewIntent(data: Intent?) {
|
||||
super.onNewIntent(data)
|
||||
receiptIntent(data)
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
receiptIntent(intent)
|
||||
}
|
||||
|
||||
override fun onCompatCreateOptionsMenu(menu: Menu): Boolean {
|
||||
|
||||
@@ -8,7 +8,7 @@ import androidx.activity.result.ActivityResult
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.activity.result.contract.ActivityResultContract
|
||||
|
||||
fun ActivityResultLauncher<*>.launch() {
|
||||
fun <T> ActivityResultLauncher<T?>.launch() {
|
||||
launch(null)
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ room = "2.6.1"
|
||||
splitties = "3.0.0"
|
||||
rhino = "1.7.15"
|
||||
|
||||
activity = "1.8.2"
|
||||
activity = "1.9.1"
|
||||
kotlinxSerialization = "1.7.1"
|
||||
swiperefreshlayout = "1.1.0"
|
||||
viewpager2 = "1.1.0"
|
||||
|
||||
Reference in New Issue
Block a user