6.12.1 commit

This commit is contained in:
Xilin Jia 2024-10-23 12:41:07 +01:00
parent 54aefefe83
commit bfab83a125
8 changed files with 52 additions and 12 deletions

View File

@ -31,8 +31,8 @@ android {
testApplicationId "ac.mdiq.podcini.tests"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
versionCode 3020278
versionName "6.12.0"
versionCode 3020279
versionName "6.12.1"
applicationId "ac.mdiq.podcini.R"
def commit = ""

View File

@ -2,6 +2,7 @@ package ac.mdiq.podcini.playback.cast
import android.view.Menu
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.runtime.Composable
/**
* Activity that allows for showing the MediaRouter button whenever there's a cast device in the
@ -10,8 +11,8 @@ import androidx.appcompat.app.AppCompatActivity
abstract class CastEnabledActivity : AppCompatActivity() {
val TAG = this::class.simpleName ?: "Anonymous"
fun requestCastButton(menu: Menu?) {
// no-op
}
fun requestCastButton(menu: Menu?) {}
@Composable
fun CastIconButton() {}
}

View File

@ -6,11 +6,10 @@ import ac.mdiq.podcini.playback.PlaybackServiceStarter
import ac.mdiq.podcini.playback.ServiceStatusHandler
import ac.mdiq.podcini.playback.base.InTheatre.curEpisode
import ac.mdiq.podcini.playback.base.InTheatre.curMedia
import ac.mdiq.podcini.playback.base.InTheatre.curQueue
import ac.mdiq.podcini.playback.base.InTheatre.isCurrentlyPlaying
import ac.mdiq.podcini.playback.base.MediaPlayerBase.Companion.status
import ac.mdiq.podcini.playback.base.PlayerStatus
import ac.mdiq.podcini.playback.base.VideoMode
import ac.mdiq.podcini.playback.cast.CastEnabledActivity
import ac.mdiq.podcini.playback.service.PlaybackService.Companion.curDurationFB
import ac.mdiq.podcini.playback.service.PlaybackService.Companion.curPositionFB
import ac.mdiq.podcini.playback.service.PlaybackService.Companion.curSpeedFB
@ -338,7 +337,7 @@ class AudioPlayerFragment : Fragment() {
val textColor = MaterialTheme.colorScheme.onSurface
val mediaType = curMedia?.getMediaType()
val notAudioOnly = (curMedia as? EpisodeMedia)?.episode?.feed?.preferences?.videoModePolicy != VideoMode.AUDIO_ONLY
Row(modifier = Modifier.fillMaxWidth().padding(10.dp), horizontalArrangement = Arrangement.SpaceBetween) {
Row(modifier = Modifier.fillMaxWidth().padding(10.dp), horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically) {
Icon(imageVector = ImageVector.vectorResource(R.drawable.ic_arrow_down), tint = textColor, contentDescription = "Collapse", modifier = Modifier.clickable {
(activity as MainActivity).bottomSheet.setState(BottomSheetBehavior.STATE_COLLAPSED)
})
@ -389,6 +388,7 @@ class AudioPlayerFragment : Fragment() {
context.startActivity(intent)
}
})
(activity as? CastEnabledActivity)?.CastIconButton()
}
}
@ -555,7 +555,7 @@ class AudioPlayerFragment : Fragment() {
private fun updateDetails() {
// if (isLoading) return
lifecycleScope.launch {
Logd(TAG, "in updateInfo")
Logd(TAG, "in updateDetails")
isLoading = true
withContext(Dispatchers.IO) {
currentMedia = curMedia
@ -589,7 +589,7 @@ class AudioPlayerFragment : Fragment() {
withContext(Dispatchers.Main) {
Logd(TAG, "subscribe: ${currentMedia?.getEpisodeTitle()}")
displayMediaInfo(currentMedia!!)
(activity as MainActivity).setPlayerVisible(curMedia != null)
// (activity as MainActivity).setPlayerVisible(curMedia != null)
// shownoteView.loadDataWithBaseURL("https://127.0.0.1", cleanedNotes?:"No notes", "text/html", "utf-8", "about:blank")
Logd(TAG, "Webview loaded")
}

View File

@ -987,7 +987,7 @@ class SubscriptionsFragment : Fragment(), Toolbar.OnMenuItemClickListener {
Row {
if (feed.rating != Rating.UNRATED.code)
Icon(imageVector = ImageVector.vectorResource(Rating.fromCode(feed.rating).res), tint = MaterialTheme.colorScheme.tertiary, contentDescription = "rating",
modifier = Modifier.background(MaterialTheme.colorScheme.tertiaryContainer))
modifier = Modifier.width(20.dp).height(20.dp).background(MaterialTheme.colorScheme.tertiaryContainer))
Text(feed.title ?: "No title", color = textColor, maxLines = 1, overflow = TextOverflow.Ellipsis,
style = MaterialTheme.typography.bodyMedium.copy(fontWeight = FontWeight.Bold))
}

View File

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M1,18v3h3c0,-1.66 -1.34,-3 -3,-3zM1,14v2c2.76,0 5,2.24 5,5h2c0,-3.87 -3.13,-7 -7,-7zM19,7L5,7v1.63c3.96,1.28 7.09,4.41 8.37,8.37L19,17L19,7zM1,10v2c4.97,0 9,4.03 9,9h2c0,-6.08 -4.93,-11 -11,-11zM21,3L3,3c-1.1,0 -2,0.9 -2,2v3h2L3,5h18v14h-7v2h7c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2z"/>
</vector>

View File

@ -1,9 +1,21 @@
package ac.mdiq.podcini.playback.cast
import ac.mdiq.podcini.R
import ac.mdiq.podcini.util.Logd
import android.os.Bundle
import android.view.Menu
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Icon
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import androidx.mediarouter.app.MediaRouteButton
import com.google.android.gms.cast.framework.CastButtonFactory
import com.google.android.gms.cast.framework.CastContext
import com.google.android.gms.common.ConnectionResult
@ -14,7 +26,7 @@ import com.google.android.gms.common.GoogleApiAvailability
* network.
*/
abstract class CastEnabledActivity : AppCompatActivity() {
private var canCast = false
private var canCast by mutableStateOf(false)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@ -33,4 +45,17 @@ abstract class CastEnabledActivity : AppCompatActivity() {
menuInflater.inflate(R.menu.cast_button, menu)
CastButtonFactory.setUpMediaRouteButton(applicationContext, menu!!, R.id.media_route_menu_item)
}
@Composable
fun CastIconButton() {
if (canCast) {
AndroidView( modifier = Modifier.size(24.dp),
factory = { ctx ->
MediaRouteButton(ctx).apply {
CastButtonFactory.setUpMediaRouteButton(ctx, this)
}
},
)
}
}
}

View File

@ -1,3 +1,8 @@
# 6.12.1
* fixed circular calling functions when PlayerDetailed view is open
* in the Play apk, added back the cast button that's been missing after 6.10.0
# 6.12.0
* created a new play state system: Unspecified, Building, New, Unplayed, Later, Soon, InQueue, InProgress, Skipped, Played, Ignored,

View File

@ -0,0 +1,4 @@
Version 6.12.1
* fixed circular calling functions when PlayerDetailed view is open
* in the Play apk, added back the cast button that's been missing after 6.10.0