From 3de4b508b2494a6100b1236ef6b7a05cb18fc451 Mon Sep 17 00:00:00 2001 From: Xilin Jia <6257601+XilinJia@users.noreply.github.com> Date: Mon, 4 Mar 2024 10:02:39 +0100 Subject: [PATCH] change click control and autodownload bugfix --- app/build.gradle | 4 ++-- .../mdiq/podcini/storage/AutomaticDownloadAlgorithm.kt | 4 ++-- .../ac/mdiq/podcini/ui/adapter/EpisodeItemListAdapter.kt | 8 ++++---- .../podcini/ui/adapter/SubscriptionsRecyclerAdapter.kt | 6 +++--- changelog.md | 9 ++++++++- fastlane/metadata/android/en-US/changelogs/3020105.txt | 8 ++++++++ 6 files changed, 27 insertions(+), 12 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/3020105.txt diff --git a/app/build.gradle b/app/build.gradle index 6f597640..8d6780e6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -22,8 +22,8 @@ android { // Version code schema: // "1.2.3-beta4" -> 1020304 // "1.2.3" -> 1020395 - versionCode 3020104 - versionName "4.2.1" + versionCode 3020105 + versionName "4.2.2" def commit = "" try { diff --git a/app/src/main/java/ac/mdiq/podcini/storage/AutomaticDownloadAlgorithm.kt b/app/src/main/java/ac/mdiq/podcini/storage/AutomaticDownloadAlgorithm.kt index 77d7bfaa..67346de2 100644 --- a/app/src/main/java/ac/mdiq/podcini/storage/AutomaticDownloadAlgorithm.kt +++ b/app/src/main/java/ac/mdiq/podcini/storage/AutomaticDownloadAlgorithm.kt @@ -37,8 +37,8 @@ open class AutomaticDownloadAlgorithm { @UnstableApi open fun autoDownloadUndownloadedItems(context: Context): Runnable? { return Runnable { // true if we should auto download based on network status - val networkShouldAutoDl = (isAutoDownloadAllowed) -// val networkShouldAutoDl = (isAutoDownloadAllowed && isEnableAutodownload) +// val networkShouldAutoDl = (isAutoDownloadAllowed) + val networkShouldAutoDl = (isAutoDownloadAllowed && isEnableAutodownload) // true if we should auto download based on power status val powerShouldAutoDl = (deviceCharging(context) || isEnableAutodownloadOnBattery) diff --git a/app/src/main/java/ac/mdiq/podcini/ui/adapter/EpisodeItemListAdapter.kt b/app/src/main/java/ac/mdiq/podcini/ui/adapter/EpisodeItemListAdapter.kt index 7c963a27..dc4463cd 100644 --- a/app/src/main/java/ac/mdiq/podcini/ui/adapter/EpisodeItemListAdapter.kt +++ b/app/src/main/java/ac/mdiq/podcini/ui/adapter/EpisodeItemListAdapter.kt @@ -71,14 +71,14 @@ open class EpisodeItemListAdapter(mainActivity: MainActivity) : val item: FeedItem = episodes[pos] holder.bind(item) - holder.coverHolder.setOnCreateContextMenuListener(this) - holder.coverHolder.setOnLongClickListener { + holder.infoCard.setOnCreateContextMenuListener(this) + holder.infoCard.setOnLongClickListener { longPressedItem = item longPressedPosition = holder.bindingAdapterPosition startSelectMode(longPressedPosition) false } - holder.coverHolder.setOnClickListener { + holder.infoCard.setOnClickListener { if (inActionMode()) { toggleSelection(holder.bindingAdapterPosition) } else { @@ -94,7 +94,7 @@ open class EpisodeItemListAdapter(mainActivity: MainActivity) : // longPressedPosition = holder.bindingAdapterPosition // false // } - holder.infoCard.setOnClickListener { + holder.coverHolder.setOnClickListener { val activity: MainActivity? = mainActivityRef.get() if (!inActionMode()) { val ids: LongArray = FeedItemUtil.getIds(episodes) diff --git a/app/src/main/java/ac/mdiq/podcini/ui/adapter/SubscriptionsRecyclerAdapter.kt b/app/src/main/java/ac/mdiq/podcini/ui/adapter/SubscriptionsRecyclerAdapter.kt index ecc79149..7333dff9 100644 --- a/app/src/main/java/ac/mdiq/podcini/ui/adapter/SubscriptionsRecyclerAdapter.kt +++ b/app/src/main/java/ac/mdiq/podcini/ui/adapter/SubscriptionsRecyclerAdapter.kt @@ -69,14 +69,14 @@ open class SubscriptionsRecyclerAdapter(mainActivity: MainActivity) : holder.coverImage.alpha = 1.0f } - holder.coverImage.setOnCreateContextMenuListener(this) - holder.coverImage.setOnLongClickListener { + holder.infoCard.setOnCreateContextMenuListener(this) + holder.infoCard.setOnLongClickListener { longPressedPosition = holder.bindingAdapterPosition selectedItem = drawerItem startSelectMode(longPressedPosition) false } - holder.coverImage.setOnClickListener { + holder.infoCard.setOnClickListener { if (inActionMode()) { holder.selectCheckbox.setChecked(!isSelected(holder.bindingAdapterPosition)) } else { diff --git a/changelog.md b/changelog.md index 32c8f7eb..4134b5e9 100644 --- a/changelog.md +++ b/changelog.md @@ -46,4 +46,11 @@ * long-press on title area would be the same as a click * click on an icon allows operation on the single item * long-press on an icon would allow for multi-select - \ No newline at end of file + +## 4.2.2 + +* bug fix on auto-download mistakenly set in 4.2.1 +* Sorry for another change in click operation + * long-press on an icon would be the same as a click + * click on title area allows operation on the single item + * long-press on title area would allow for multi-select diff --git a/fastlane/metadata/android/en-US/changelogs/3020105.txt b/fastlane/metadata/android/en-US/changelogs/3020105.txt new file mode 100644 index 00000000..43e797fd --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/3020105.txt @@ -0,0 +1,8 @@ + +Version 4.2.2 brings several changes: + +* bug fix on auto-download mistakenly set in 4.2.1 +* Sorry for another change in click operation + * long-press on an icon would be the same as a click + * click on title area allows operation on the single item + * long-press on title area would allow for multi-select