6.2.1 commit

This commit is contained in:
Xilin Jia 2024-07-28 20:50:45 +01:00
parent ccb4b15153
commit 13870cedd2
7 changed files with 74 additions and 43 deletions

View File

@ -34,8 +34,8 @@ android {
testApplicationId "ac.mdiq.podcini.tests" testApplicationId "ac.mdiq.podcini.tests"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
versionCode 3020221 versionCode 3020222
versionName "6.2.0" versionName "6.2.1"
applicationId "ac.mdiq.podcini.R" applicationId "ac.mdiq.podcini.R"
def commit = "" def commit = ""

View File

@ -3,12 +3,12 @@ package ac.mdiq.podcini.ui.fragment
import ac.mdiq.podcini.R import ac.mdiq.podcini.R
import ac.mdiq.podcini.databinding.BaseEpisodesListFragmentBinding import ac.mdiq.podcini.databinding.BaseEpisodesListFragmentBinding
import ac.mdiq.podcini.databinding.MultiSelectSpeedDialBinding import ac.mdiq.podcini.databinding.MultiSelectSpeedDialBinding
import ac.mdiq.podcini.net.feed.FeedUpdateManager
import ac.mdiq.podcini.playback.base.InTheatre.isCurMedia import ac.mdiq.podcini.playback.base.InTheatre.isCurMedia
import ac.mdiq.podcini.storage.database.RealmDB.unmanaged import ac.mdiq.podcini.storage.database.RealmDB.unmanaged
import ac.mdiq.podcini.storage.model.Episode import ac.mdiq.podcini.storage.model.Episode
import ac.mdiq.podcini.storage.model.EpisodeMedia
import ac.mdiq.podcini.storage.model.EpisodeFilter import ac.mdiq.podcini.storage.model.EpisodeFilter
import ac.mdiq.podcini.storage.model.EpisodeMedia
import ac.mdiq.podcini.storage.utils.EpisodeUtil
import ac.mdiq.podcini.ui.actions.EpisodeMultiSelectHandler import ac.mdiq.podcini.ui.actions.EpisodeMultiSelectHandler
import ac.mdiq.podcini.ui.actions.menuhandler.EpisodeMenuHandler import ac.mdiq.podcini.ui.actions.menuhandler.EpisodeMenuHandler
import ac.mdiq.podcini.ui.actions.menuhandler.MenuItemUtils import ac.mdiq.podcini.ui.actions.menuhandler.MenuItemUtils
@ -18,10 +18,8 @@ import ac.mdiq.podcini.ui.adapter.EpisodesAdapter
import ac.mdiq.podcini.ui.adapter.SelectableAdapter import ac.mdiq.podcini.ui.adapter.SelectableAdapter
import ac.mdiq.podcini.ui.dialog.ConfirmationDialog import ac.mdiq.podcini.ui.dialog.ConfirmationDialog
import ac.mdiq.podcini.ui.utils.EmptyViewHandler import ac.mdiq.podcini.ui.utils.EmptyViewHandler
import ac.mdiq.podcini.ui.view.EpisodesRecyclerView
import ac.mdiq.podcini.ui.utils.LiftOnScrollListener import ac.mdiq.podcini.ui.utils.LiftOnScrollListener
import ac.mdiq.podcini.storage.utils.EpisodeUtil import ac.mdiq.podcini.ui.view.EpisodesRecyclerView
import ac.mdiq.podcini.ui.fragment.SubscriptionsFragment.Companion
import ac.mdiq.podcini.util.Logd import ac.mdiq.podcini.util.Logd
import ac.mdiq.podcini.util.event.EventFlow import ac.mdiq.podcini.util.event.EventFlow
import ac.mdiq.podcini.util.event.FlowEvent import ac.mdiq.podcini.util.event.FlowEvent
@ -38,13 +36,15 @@ import androidx.lifecycle.lifecycleScope
import androidx.media3.common.util.UnstableApi import androidx.media3.common.util.UnstableApi
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.SimpleItemAnimator import androidx.recyclerview.widget.SimpleItemAnimator
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.google.android.material.appbar.MaterialToolbar import com.google.android.material.appbar.MaterialToolbar
import com.google.android.material.snackbar.Snackbar import com.google.android.material.snackbar.Snackbar
import com.leinardi.android.speeddial.SpeedDialActionItem import com.leinardi.android.speeddial.SpeedDialActionItem
import com.leinardi.android.speeddial.SpeedDialView import com.leinardi.android.speeddial.SpeedDialView
import kotlinx.coroutines.* import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
@UnstableApi abstract class BaseEpisodesFragment : Fragment(), SelectableAdapter.OnSelectModeListener, Toolbar.OnMenuItemClickListener { @UnstableApi abstract class BaseEpisodesFragment : Fragment(), SelectableAdapter.OnSelectModeListener, Toolbar.OnMenuItemClickListener {
@ -63,7 +63,7 @@ import kotlinx.coroutines.flow.collectLatest
lateinit var emptyView: EmptyViewHandler lateinit var emptyView: EmptyViewHandler
lateinit var speedDialView: SpeedDialView lateinit var speedDialView: SpeedDialView
lateinit var toolbar: MaterialToolbar lateinit var toolbar: MaterialToolbar
lateinit var swipeRefreshLayout: SwipeRefreshLayout // lateinit var swipeRefreshLayout: SwipeRefreshLayout
lateinit var swipeActions: SwipeActions lateinit var swipeActions: SwipeActions
private lateinit var progressBar: ProgressBar private lateinit var progressBar: ProgressBar
lateinit var adapter: EpisodesAdapter lateinit var adapter: EpisodesAdapter
@ -108,8 +108,8 @@ import kotlinx.coroutines.flow.collectLatest
val animator: RecyclerView.ItemAnimator? = recyclerView.itemAnimator val animator: RecyclerView.ItemAnimator? = recyclerView.itemAnimator
if (animator is SimpleItemAnimator) animator.supportsChangeAnimations = false if (animator is SimpleItemAnimator) animator.supportsChangeAnimations = false
swipeRefreshLayout = binding.swipeRefresh // swipeRefreshLayout = binding.swipeRefresh
swipeRefreshLayout.setDistanceToTriggerSync(resources.getInteger(R.integer.swipe_refresh_distance)) // swipeRefreshLayout.setDistanceToTriggerSync(resources.getInteger(R.integer.swipe_refresh_distance))
// swipeRefreshLayout.setOnRefreshListener { FeedUpdateManager.runOnceOrAsk(requireContext()) } // swipeRefreshLayout.setOnRefreshListener { FeedUpdateManager.runOnceOrAsk(requireContext()) }
createListAdaptor() createListAdaptor()
@ -417,7 +417,7 @@ import kotlinx.coroutines.flow.collectLatest
Logd(TAG, "Received sticky event: ${event.TAG}") Logd(TAG, "Received sticky event: ${event.TAG}")
when (event) { when (event) {
is FlowEvent.EpisodeDownloadEvent -> onEpisodeDownloadEvent(event) is FlowEvent.EpisodeDownloadEvent -> onEpisodeDownloadEvent(event)
is FlowEvent.FeedUpdatingEvent -> onFeedUpdateRunningEvent(event) // is FlowEvent.FeedUpdatingEvent -> onFeedUpdateRunningEvent(event)
else -> {} else -> {}
} }
} }
@ -476,9 +476,9 @@ import kotlinx.coroutines.flow.collectLatest
protected open fun updateToolbar() {} protected open fun updateToolbar() {}
private fun onFeedUpdateRunningEvent(event: FlowEvent.FeedUpdatingEvent) { // private fun onFeedUpdateRunningEvent(event: FlowEvent.FeedUpdatingEvent) {
swipeRefreshLayout.isRefreshing = event.isRunning // swipeRefreshLayout.isRefreshing = event.isRunning
} // }
override fun onSaveInstanceState(outState: Bundle) { override fun onSaveInstanceState(outState: Bundle) {
outState.putBoolean(KEY_UP_ARROW, displayUpArrow) outState.putBoolean(KEY_UP_ARROW, displayUpArrow)

View File

@ -30,11 +30,11 @@ import ac.mdiq.podcini.ui.actions.swipeactions.SwipeActions
import ac.mdiq.podcini.ui.activity.MainActivity import ac.mdiq.podcini.ui.activity.MainActivity
import ac.mdiq.podcini.ui.adapter.EpisodesAdapter import ac.mdiq.podcini.ui.adapter.EpisodesAdapter
import ac.mdiq.podcini.ui.adapter.SelectableAdapter import ac.mdiq.podcini.ui.adapter.SelectableAdapter
import ac.mdiq.podcini.ui.compose.CustomTheme
import ac.mdiq.podcini.ui.dialog.ConfirmationDialog import ac.mdiq.podcini.ui.dialog.ConfirmationDialog
import ac.mdiq.podcini.ui.dialog.EpisodeSortDialog import ac.mdiq.podcini.ui.dialog.EpisodeSortDialog
import ac.mdiq.podcini.ui.utils.EmptyViewHandler import ac.mdiq.podcini.ui.utils.EmptyViewHandler
import ac.mdiq.podcini.ui.utils.LiftOnScrollListener import ac.mdiq.podcini.ui.utils.LiftOnScrollListener
import ac.mdiq.podcini.ui.compose.CustomTheme
import ac.mdiq.podcini.ui.view.EpisodesRecyclerView import ac.mdiq.podcini.ui.view.EpisodesRecyclerView
import ac.mdiq.podcini.ui.view.viewholder.EpisodeViewHolder import ac.mdiq.podcini.ui.view.viewholder.EpisodeViewHolder
import ac.mdiq.podcini.util.Logd import ac.mdiq.podcini.util.Logd
@ -68,7 +68,6 @@ import androidx.media3.common.util.UnstableApi
import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.SimpleItemAnimator import androidx.recyclerview.widget.SimpleItemAnimator
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.google.android.material.appbar.MaterialToolbar import com.google.android.material.appbar.MaterialToolbar
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.snackbar.Snackbar import com.google.android.material.snackbar.Snackbar
@ -92,7 +91,7 @@ import java.util.*
private lateinit var recyclerView: EpisodesRecyclerView private lateinit var recyclerView: EpisodesRecyclerView
private lateinit var emptyView: EmptyViewHandler private lateinit var emptyView: EmptyViewHandler
private lateinit var toolbar: MaterialToolbar private lateinit var toolbar: MaterialToolbar
private lateinit var swipeRefreshLayout: SwipeRefreshLayout // private lateinit var swipeRefreshLayout: SwipeRefreshLayout
private lateinit var swipeActions: SwipeActions private lateinit var swipeActions: SwipeActions
private lateinit var speedDialView: SpeedDialView private lateinit var speedDialView: SpeedDialView
@ -172,8 +171,8 @@ import java.util.*
adapter?.setOnSelectModeListener(this) adapter?.setOnSelectModeListener(this)
recyclerView.adapter = adapter recyclerView.adapter = adapter
swipeRefreshLayout = binding.swipeRefresh // swipeRefreshLayout = binding.swipeRefresh
swipeRefreshLayout.setDistanceToTriggerSync(resources.getInteger(R.integer.swipe_refresh_distance)) // swipeRefreshLayout.setDistanceToTriggerSync(resources.getInteger(R.integer.swipe_refresh_distance))
// swipeRefreshLayout.setOnRefreshListener { FeedUpdateManager.runOnceOrAsk(requireContext()) } // swipeRefreshLayout.setOnRefreshListener { FeedUpdateManager.runOnceOrAsk(requireContext()) }
emptyView = EmptyViewHandler(requireContext()) emptyView = EmptyViewHandler(requireContext())
@ -262,7 +261,7 @@ import java.util.*
Logd(TAG, "Received sticky event: ${event.TAG}") Logd(TAG, "Received sticky event: ${event.TAG}")
when (event) { when (event) {
is FlowEvent.EpisodeDownloadEvent -> onEpisodeDownloadEvent(event) is FlowEvent.EpisodeDownloadEvent -> onEpisodeDownloadEvent(event)
is FlowEvent.FeedUpdatingEvent -> swipeRefreshLayout.isRefreshing = event.isRunning // is FlowEvent.FeedUpdatingEvent -> swipeRefreshLayout.isRefreshing = event.isRunning
else -> {} else -> {}
} }
} }
@ -392,9 +391,17 @@ import java.util.*
val pos: Int = EpisodeUtil.indexOfItemWithDownloadUrl(queueItems.toList(), downloadUrl) val pos: Int = EpisodeUtil.indexOfItemWithDownloadUrl(queueItems.toList(), downloadUrl)
if (pos >= 0) { if (pos >= 0) {
val item = unmanaged(queueItems[pos]) val item = unmanaged(queueItems[pos])
// item.media?.downloaded = true if (item.media != null) {
item.media?.setIsDownloaded() val m = unmanaged(item.media!!)
adapter?.notifyItemChangedCompat(pos) m.downloaded = true
item.media = m
queueItems[pos] = item
adapter?.notifyItemChangedCompat(pos)
}
// val item = unmanaged(queueItems[pos])
//// item.media?.downloaded = true
// item.media?.setIsDownloaded()
// adapter?.notifyItemChangedCompat(pos)
} }
} }
} }

View File

@ -77,19 +77,26 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout <ac.mdiq.podcini.ui.view.EpisodesRecyclerView
android:id="@+id/swipeRefresh" android:id="@+id/recyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/appbar"> android:paddingHorizontal="@dimen/additional_horizontal_spacing"
android:layout_below="@id/appbar"/>
<ac.mdiq.podcini.ui.view.EpisodesRecyclerView <!-- <androidx.swiperefreshlayout.widget.SwipeRefreshLayout-->
android:id="@+id/recyclerView" <!-- android:id="@+id/swipeRefresh"-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="match_parent" <!-- android:layout_height="match_parent"-->
android:paddingHorizontal="@dimen/additional_horizontal_spacing" /> <!-- android:layout_below="@id/appbar">-->
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> <!-- <ac.mdiq.podcini.ui.view.EpisodesRecyclerView-->
<!-- android:id="@+id/recyclerView"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:paddingHorizontal="@dimen/additional_horizontal_spacing" />-->
<!-- </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>-->
<ProgressBar <ProgressBar
android:id="@+id/progressBar" android:id="@+id/progressBar"

View File

@ -75,19 +75,26 @@
</LinearLayout> </LinearLayout>
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout <ac.mdiq.podcini.ui.view.EpisodesRecyclerView
android:id="@+id/swipeRefresh" android:id="@+id/recyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/appbar"> android:paddingHorizontal="@dimen/additional_horizontal_spacing"
android:layout_below="@id/appbar"/>
<ac.mdiq.podcini.ui.view.EpisodesRecyclerView <!-- <androidx.swiperefreshlayout.widget.SwipeRefreshLayout-->
android:id="@+id/recyclerView" <!-- android:id="@+id/swipeRefresh"-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="match_parent" <!-- android:layout_height="match_parent"-->
android:paddingHorizontal="@dimen/additional_horizontal_spacing" /> <!-- android:layout_below="@id/appbar">-->
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> <!-- <ac.mdiq.podcini.ui.view.EpisodesRecyclerView-->
<!-- android:id="@+id/recyclerView"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:paddingHorizontal="@dimen/additional_horizontal_spacing" />-->
<!-- </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>-->
<ProgressBar <ProgressBar
android:id="@+id/progressBar" android:id="@+id/progressBar"

View File

@ -1,3 +1,8 @@
# 6.2.1
* likely fixed crash issue in Queue view during download
* fully disabled down-swipe in Queue, AllEpisodes, History, and Downloads views
# 6.2.0 # 6.2.0
* first foot into Jetpack Compose, various views are in Compose * first foot into Jetpack Compose, various views are in Compose

View File

@ -0,0 +1,5 @@
Version 6.2.1 brings several changes:
* likely fixed crash issue in Queue view during download
* fully disabled down-swipe in Queue, AllEpisodes, History, and Downloads views