Skip to content

Commit

Permalink
6.12.1 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
XilinJia committed Oct 23, 2024
1 parent 54aefef commit bfab83a
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
})
Expand Down Expand Up @@ -389,6 +388,7 @@ class AudioPlayerFragment : Fragment() {
context.startActivity(intent)
}
})
(activity as? CastEnabledActivity)?.CastIconButton()
}
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/baseline_cast_connected_24.xml
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand All @@ -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)
}
},
)
}
}
}
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
4 changes: 4 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/3020279.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bfab83a

Please sign in to comment.