Skip to content

Commit

Permalink
6.2.1 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
XilinJia committed Jul 28, 2024
1 parent ccb4b15 commit 13870ce
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 47 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ android {
testApplicationId "ac.mdiq.podcini.tests"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

versionCode 3020221
versionName "6.2.0"
versionCode 3020222
versionName "6.2.1"

applicationId "ac.mdiq.podcini.R"
def commit = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package ac.mdiq.podcini.ui.fragment
import ac.mdiq.podcini.R
import ac.mdiq.podcini.databinding.BaseEpisodesListFragmentBinding
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.storage.database.RealmDB.unmanaged
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.EpisodeMedia
import ac.mdiq.podcini.storage.utils.EpisodeUtil
import ac.mdiq.podcini.ui.actions.EpisodeMultiSelectHandler
import ac.mdiq.podcini.ui.actions.menuhandler.EpisodeMenuHandler
import ac.mdiq.podcini.ui.actions.menuhandler.MenuItemUtils
Expand All @@ -18,10 +18,8 @@ import ac.mdiq.podcini.ui.adapter.EpisodesAdapter
import ac.mdiq.podcini.ui.adapter.SelectableAdapter
import ac.mdiq.podcini.ui.dialog.ConfirmationDialog
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.storage.utils.EpisodeUtil
import ac.mdiq.podcini.ui.fragment.SubscriptionsFragment.Companion
import ac.mdiq.podcini.ui.view.EpisodesRecyclerView
import ac.mdiq.podcini.util.Logd
import ac.mdiq.podcini.util.event.EventFlow
import ac.mdiq.podcini.util.event.FlowEvent
Expand All @@ -38,13 +36,15 @@ import androidx.lifecycle.lifecycleScope
import androidx.media3.common.util.UnstableApi
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.SimpleItemAnimator
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.google.android.material.appbar.MaterialToolbar
import com.google.android.material.snackbar.Snackbar
import com.leinardi.android.speeddial.SpeedDialActionItem
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.launch
import kotlinx.coroutines.withContext


@UnstableApi abstract class BaseEpisodesFragment : Fragment(), SelectableAdapter.OnSelectModeListener, Toolbar.OnMenuItemClickListener {
Expand All @@ -63,7 +63,7 @@ import kotlinx.coroutines.flow.collectLatest
lateinit var emptyView: EmptyViewHandler
lateinit var speedDialView: SpeedDialView
lateinit var toolbar: MaterialToolbar
lateinit var swipeRefreshLayout: SwipeRefreshLayout
// lateinit var swipeRefreshLayout: SwipeRefreshLayout
lateinit var swipeActions: SwipeActions
private lateinit var progressBar: ProgressBar
lateinit var adapter: EpisodesAdapter
Expand Down Expand Up @@ -108,8 +108,8 @@ import kotlinx.coroutines.flow.collectLatest
val animator: RecyclerView.ItemAnimator? = recyclerView.itemAnimator
if (animator is SimpleItemAnimator) animator.supportsChangeAnimations = false

swipeRefreshLayout = binding.swipeRefresh
swipeRefreshLayout.setDistanceToTriggerSync(resources.getInteger(R.integer.swipe_refresh_distance))
// swipeRefreshLayout = binding.swipeRefresh
// swipeRefreshLayout.setDistanceToTriggerSync(resources.getInteger(R.integer.swipe_refresh_distance))
// swipeRefreshLayout.setOnRefreshListener { FeedUpdateManager.runOnceOrAsk(requireContext()) }

createListAdaptor()
Expand Down Expand Up @@ -417,7 +417,7 @@ import kotlinx.coroutines.flow.collectLatest
Logd(TAG, "Received sticky event: ${event.TAG}")
when (event) {
is FlowEvent.EpisodeDownloadEvent -> onEpisodeDownloadEvent(event)
is FlowEvent.FeedUpdatingEvent -> onFeedUpdateRunningEvent(event)
// is FlowEvent.FeedUpdatingEvent -> onFeedUpdateRunningEvent(event)
else -> {}
}
}
Expand Down Expand Up @@ -476,9 +476,9 @@ import kotlinx.coroutines.flow.collectLatest

protected open fun updateToolbar() {}

private fun onFeedUpdateRunningEvent(event: FlowEvent.FeedUpdatingEvent) {
swipeRefreshLayout.isRefreshing = event.isRunning
}
// private fun onFeedUpdateRunningEvent(event: FlowEvent.FeedUpdatingEvent) {
// swipeRefreshLayout.isRefreshing = event.isRunning
// }

override fun onSaveInstanceState(outState: Bundle) {
outState.putBoolean(KEY_UP_ARROW, displayUpArrow)
Expand Down
25 changes: 16 additions & 9 deletions app/src/main/kotlin/ac/mdiq/podcini/ui/fragment/QueueFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import ac.mdiq.podcini.ui.actions.swipeactions.SwipeActions
import ac.mdiq.podcini.ui.activity.MainActivity
import ac.mdiq.podcini.ui.adapter.EpisodesAdapter
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.EpisodeSortDialog
import ac.mdiq.podcini.ui.utils.EmptyViewHandler
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.viewholder.EpisodeViewHolder
import ac.mdiq.podcini.util.Logd
Expand Down Expand Up @@ -68,7 +68,6 @@ import androidx.media3.common.util.UnstableApi
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.SimpleItemAnimator
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.google.android.material.appbar.MaterialToolbar
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.snackbar.Snackbar
Expand All @@ -92,7 +91,7 @@ import java.util.*
private lateinit var recyclerView: EpisodesRecyclerView
private lateinit var emptyView: EmptyViewHandler
private lateinit var toolbar: MaterialToolbar
private lateinit var swipeRefreshLayout: SwipeRefreshLayout
// private lateinit var swipeRefreshLayout: SwipeRefreshLayout
private lateinit var swipeActions: SwipeActions
private lateinit var speedDialView: SpeedDialView

Expand Down Expand Up @@ -172,8 +171,8 @@ import java.util.*
adapter?.setOnSelectModeListener(this)
recyclerView.adapter = adapter

swipeRefreshLayout = binding.swipeRefresh
swipeRefreshLayout.setDistanceToTriggerSync(resources.getInteger(R.integer.swipe_refresh_distance))
// swipeRefreshLayout = binding.swipeRefresh
// swipeRefreshLayout.setDistanceToTriggerSync(resources.getInteger(R.integer.swipe_refresh_distance))
// swipeRefreshLayout.setOnRefreshListener { FeedUpdateManager.runOnceOrAsk(requireContext()) }

emptyView = EmptyViewHandler(requireContext())
Expand Down Expand Up @@ -262,7 +261,7 @@ import java.util.*
Logd(TAG, "Received sticky event: ${event.TAG}")
when (event) {
is FlowEvent.EpisodeDownloadEvent -> onEpisodeDownloadEvent(event)
is FlowEvent.FeedUpdatingEvent -> swipeRefreshLayout.isRefreshing = event.isRunning
// is FlowEvent.FeedUpdatingEvent -> swipeRefreshLayout.isRefreshing = event.isRunning
else -> {}
}
}
Expand Down Expand Up @@ -392,9 +391,17 @@ import java.util.*
val pos: Int = EpisodeUtil.indexOfItemWithDownloadUrl(queueItems.toList(), downloadUrl)
if (pos >= 0) {
val item = unmanaged(queueItems[pos])
// item.media?.downloaded = true
item.media?.setIsDownloaded()
adapter?.notifyItemChangedCompat(pos)
if (item.media != null) {
val m = unmanaged(item.media!!)
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)
}
}
}
Expand Down
29 changes: 18 additions & 11 deletions app/src/main/res/layout/base_episodes_list_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,26 @@

</com.google.android.material.appbar.AppBarLayout>

<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefresh"
<ac.mdiq.podcini.ui.view.EpisodesRecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/appbar">

<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>
android:paddingHorizontal="@dimen/additional_horizontal_spacing"
android:layout_below="@id/appbar"/>

<!-- <androidx.swiperefreshlayout.widget.SwipeRefreshLayout-->
<!-- android:id="@+id/swipeRefresh"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_below="@id/appbar">-->

<!-- <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
android:id="@+id/progressBar"
Expand Down
29 changes: 18 additions & 11 deletions app/src/main/res/layout/queue_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,26 @@
</LinearLayout>
</com.google.android.material.appbar.AppBarLayout>

<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefresh"
<ac.mdiq.podcini.ui.view.EpisodesRecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/appbar">

<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>
android:paddingHorizontal="@dimen/additional_horizontal_spacing"
android:layout_below="@id/appbar"/>

<!-- <androidx.swiperefreshlayout.widget.SwipeRefreshLayout-->
<!-- android:id="@+id/swipeRefresh"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_below="@id/appbar">-->

<!-- <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
android:id="@+id/progressBar"
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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

* first foot into Jetpack Compose, various views are in Compose
Expand Down
5 changes: 5 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/3020222.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 13870ce

Please sign in to comment.