6.11.6 commit
This commit is contained in:
parent
ca6afe3c27
commit
29f7c6ce87
|
@ -31,8 +31,8 @@ android {
|
||||||
testApplicationId "ac.mdiq.podcini.tests"
|
testApplicationId "ac.mdiq.podcini.tests"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
versionCode 3020275
|
versionCode 3020276
|
||||||
versionName "6.11.5"
|
versionName "6.11.6"
|
||||||
|
|
||||||
applicationId "ac.mdiq.podcini.R"
|
applicationId "ac.mdiq.podcini.R"
|
||||||
def commit = ""
|
def commit = ""
|
||||||
|
|
|
@ -122,10 +122,9 @@ class Episode : RealmObject {
|
||||||
val imageLocation: String?
|
val imageLocation: String?
|
||||||
get() = when {
|
get() = when {
|
||||||
imageUrl != null -> imageUrl
|
imageUrl != null -> imageUrl
|
||||||
media != null && media?.hasEmbeddedPicture() == true -> EpisodeMedia.FILENAME_PREFIX_EMBEDDED_COVER + media!!.getLocalMediaUrl()
|
// TODO: this can be very expensive for list
|
||||||
feed != null -> {
|
// media != null && media?.hasEmbeddedPicture() == true -> EpisodeMedia.FILENAME_PREFIX_EMBEDDED_COVER + media!!.getLocalMediaUrl()
|
||||||
feed!!.imageUrl
|
feed != null -> feed!!.imageUrl
|
||||||
}
|
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,8 @@ import androidx.compose.ui.window.Dialog
|
||||||
import androidx.constraintlayout.compose.ConstraintLayout
|
import androidx.constraintlayout.compose.ConstraintLayout
|
||||||
import androidx.documentfile.provider.DocumentFile
|
import androidx.documentfile.provider.DocumentFile
|
||||||
import coil.compose.rememberAsyncImagePainter
|
import coil.compose.rememberAsyncImagePainter
|
||||||
|
import coil.request.CachePolicy
|
||||||
|
import coil.request.ImageRequest
|
||||||
import io.realm.kotlin.notifications.SingleQueryChange
|
import io.realm.kotlin.notifications.SingleQueryChange
|
||||||
import io.realm.kotlin.notifications.UpdatedObject
|
import io.realm.kotlin.notifications.UpdatedObject
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
|
@ -326,6 +328,7 @@ fun EpisodeLazyColumn(activity: MainActivity, vms: SnapshotStateList<EpisodeVM>,
|
||||||
val lazyListState = rememberLazyListState()
|
val lazyListState = rememberLazyListState()
|
||||||
var longPressIndex by remember { mutableIntStateOf(-1) }
|
var longPressIndex by remember { mutableIntStateOf(-1) }
|
||||||
val dls = remember { DownloadServiceInterface.get() }
|
val dls = remember { DownloadServiceInterface.get() }
|
||||||
|
val context = LocalContext.current
|
||||||
|
|
||||||
val showConfirmYoutubeDialog = remember { mutableStateOf(false) }
|
val showConfirmYoutubeDialog = remember { mutableStateOf(false) }
|
||||||
val youtubeUrls = remember { mutableListOf<String>() }
|
val youtubeUrls = remember { mutableListOf<String>() }
|
||||||
|
@ -588,8 +591,8 @@ fun EpisodeLazyColumn(activity: MainActivity, vms: SnapshotStateList<EpisodeVM>,
|
||||||
}
|
}
|
||||||
val textColor = MaterialTheme.colorScheme.onSurface
|
val textColor = MaterialTheme.colorScheme.onSurface
|
||||||
Column {
|
Column {
|
||||||
val dur = vm.episode.media?.getDuration() ?: 0
|
val dur = remember { vm.episode.media?.getDuration() ?: 0 }
|
||||||
val durText = DurationConverter.getDurationStringLong(dur)
|
val durText = remember { DurationConverter.getDurationStringLong(dur) }
|
||||||
Row(Modifier.background(if (vm.isSelected) MaterialTheme.colorScheme.secondaryContainer else MaterialTheme.colorScheme.surface)) {
|
Row(Modifier.background(if (vm.isSelected) MaterialTheme.colorScheme.secondaryContainer else MaterialTheme.colorScheme.surface)) {
|
||||||
if (false) {
|
if (false) {
|
||||||
val typedValue = TypedValue()
|
val typedValue = TypedValue()
|
||||||
|
@ -597,10 +600,15 @@ fun EpisodeLazyColumn(activity: MainActivity, vms: SnapshotStateList<EpisodeVM>,
|
||||||
Icon(painter = painterResource(typedValue.resourceId), tint = textColor, contentDescription = "drag handle",
|
Icon(painter = painterResource(typedValue.resourceId), tint = textColor, contentDescription = "drag handle",
|
||||||
modifier = Modifier.width(16.dp).align(Alignment.CenterVertically))
|
modifier = Modifier.width(16.dp).align(Alignment.CenterVertically))
|
||||||
}
|
}
|
||||||
|
Logd(TAG, "episode.imageUrl: ${vm.episode.imageUrl}")
|
||||||
ConstraintLayout(modifier = Modifier.width(56.dp).height(56.dp)) {
|
ConstraintLayout(modifier = Modifier.width(56.dp).height(56.dp)) {
|
||||||
val (imgvCover, checkMark) = createRefs()
|
val (imgvCover, checkMark) = createRefs()
|
||||||
val imgLoc = ImageResourceUtils.getEpisodeListImageLocation(vm.episode)
|
val imgLoc = remember { ImageResourceUtils.getEpisodeListImageLocation(vm.episode) }
|
||||||
val painter = rememberAsyncImagePainter(model = imgLoc)
|
Logd(TAG, "imgLoc: $imgLoc")
|
||||||
|
val painter = rememberAsyncImagePainter(model = ImageRequest.Builder(context).data(imgLoc)
|
||||||
|
.memoryCachePolicy(CachePolicy.ENABLED)
|
||||||
|
.placeholder(R.mipmap.ic_launcher)
|
||||||
|
.error(R.mipmap.ic_launcher).build())
|
||||||
Image(painter = painter, contentDescription = "imgvCover",
|
Image(painter = painter, contentDescription = "imgvCover",
|
||||||
modifier = Modifier.width(56.dp).height(56.dp)
|
modifier = Modifier.width(56.dp).height(56.dp)
|
||||||
.constrainAs(imgvCover) {
|
.constrainAs(imgvCover) {
|
||||||
|
@ -614,9 +622,7 @@ fun EpisodeLazyColumn(activity: MainActivity, vms: SnapshotStateList<EpisodeVM>,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
val alpha = if (vm.playedState) 1.0f else 0f
|
val alpha = if (vm.playedState) 1.0f else 0f
|
||||||
if (vm.playedState) Icon(painter = painterResource(R.drawable.ic_check),
|
if (vm.playedState) Icon(painter = painterResource(R.drawable.ic_check), tint = textColor, contentDescription = "played_mark",
|
||||||
tint = textColor,
|
|
||||||
contentDescription = "played_mark",
|
|
||||||
modifier = Modifier.background(Color.Green).alpha(alpha).constrainAs(checkMark) {
|
modifier = Modifier.background(Color.Green).alpha(alpha).constrainAs(checkMark) {
|
||||||
bottom.linkTo(parent.bottom)
|
bottom.linkTo(parent.bottom)
|
||||||
end.linkTo(parent.end)
|
end.linkTo(parent.end)
|
||||||
|
@ -700,7 +706,7 @@ fun EpisodeLazyColumn(activity: MainActivity, vms: SnapshotStateList<EpisodeVM>,
|
||||||
if (vm.showAltActionsDialog) vm.actionButton?.AltActionsDialog(activity, vm.showAltActionsDialog,
|
if (vm.showAltActionsDialog) vm.actionButton?.AltActionsDialog(activity, vm.showAltActionsDialog,
|
||||||
onDismiss = { vm.showAltActionsDialog = false })
|
onDismiss = { vm.showAltActionsDialog = false })
|
||||||
}
|
}
|
||||||
if (InTheatre.isCurMedia(vm.episode.media) || vm.inProgressState) {
|
if (vm.inProgressState || InTheatre.isCurMedia(vm.episode.media)) {
|
||||||
val pos = vm.positionState
|
val pos = vm.positionState
|
||||||
vm.prog = if (dur > 0 && pos >= 0 && dur >= pos) 1.0f * pos / dur else 0f
|
vm.prog = if (dur > 0 && pos >= 0 && dur >= pos) 1.0f * pos / dur else 0f
|
||||||
Logd(TAG, "$index vm.prog: ${vm.prog}")
|
Logd(TAG, "$index vm.prog: ${vm.prog}")
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
# 6.11.6
|
||||||
|
|
||||||
|
* fixed a serious performance issue when scrolling list of episode having no defined image url
|
||||||
|
|
||||||
# 6.11.5
|
# 6.11.5
|
||||||
|
|
||||||
* back to be built to target Android 15
|
* back to be built to target Android 15
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
Version 6.11.5
|
||||||
|
|
||||||
|
* fixed a serious performance issue when scrolling list of episode having no defined image url
|
Loading…
Reference in New Issue