enhancement on tags and player controls
|
@ -6,10 +6,12 @@ This is based on a fork from the popular project AntennaPod (<https://github.com
|
|||
|
||||
Differing from the forked project, this project is purely Kotlin based, relies on the most recent dependencies, and most importantly has migrated the media player to androidx.media3, and added mechanism of AudioOffloadMode which is supposed to be kind to device battery. Efficiencies are also sought on running the app. App build is also upgraded to target Android 14.
|
||||
|
||||
## Version 4.0
|
||||
## Version 4
|
||||
|
||||
Some drastic changes are made in the project since version 4.0. There is now a whole new interface of the Subscriptions page showing only the feeds with tags as filters, no longer having tags as folders in the page. And the default page of the app is changed to the Subscriptions page. Alongside, the Home and Echo pages are removed from the project. Also, the project becomes mono-module, with only the app module.
|
||||
|
||||
Version 4.1 brings a more convenient player control and tags enhancements, while also enables view binding for most views in the codebase.
|
||||
|
||||
## Screenshots
|
||||
|
||||
<img src="./images/1_drawer1.jpg" width="238" /> <img src="./images/2_setting.jpg" width="238" /> <img src="./images/3_setting.jpg" width="238" />
|
||||
|
|
|
@ -22,8 +22,8 @@ android {
|
|||
// Version code schema:
|
||||
// "1.2.3-beta4" -> 1020304
|
||||
// "1.2.3" -> 1020395
|
||||
versionCode 3020101
|
||||
versionName "4.0.1"
|
||||
versionCode 3020102
|
||||
versionName "4.1.0"
|
||||
|
||||
def commit = ""
|
||||
try {
|
||||
|
|
|
@ -9,25 +9,13 @@ class NavDrawerData(@JvmField val items: List<FeedDrawerItem>,
|
|||
val feedCounters: Map<Long, Int>,
|
||||
val reclaimableSpace: Int
|
||||
) {
|
||||
abstract class DrawerItem(val type: Type, var id: Long) {
|
||||
enum class Type {
|
||||
FEED
|
||||
}
|
||||
|
||||
class FeedDrawerItem(val feed: Feed, val id: Long, val counter: Int) {
|
||||
var layer: Int = 0
|
||||
|
||||
abstract val title: String?
|
||||
|
||||
open val producer: String = ""
|
||||
|
||||
abstract val counter: Int
|
||||
}
|
||||
|
||||
class FeedDrawerItem(val feed: Feed, id: Long, override val counter: Int) : DrawerItem(Type.FEED, id) {
|
||||
override val title: String?
|
||||
val title: String?
|
||||
get() = feed.title
|
||||
|
||||
override val producer: String
|
||||
val producer: String
|
||||
get() = feed.author?:""
|
||||
}
|
||||
}
|
||||
|
|
|
@ -179,11 +179,7 @@ class NavListAdapter(private val itemAccess: ItemAccess, context: Activity) :
|
|||
val item = itemAccess.getItem(itemPos)
|
||||
if (item != null) {
|
||||
bindListItem(item, holder as FeedHolder)
|
||||
if (item.type == DrawerItem.Type.FEED) {
|
||||
bindFeedView(item as FeedDrawerItem, holder)
|
||||
} else {
|
||||
// bindTagView(item as TagDrawerItem, holder)
|
||||
}
|
||||
}
|
||||
holder.itemView.setOnCreateContextMenuListener(itemAccess)
|
||||
}
|
||||
|
@ -276,7 +272,7 @@ class NavListAdapter(private val itemAccess: ItemAccess, context: Activity) :
|
|||
}
|
||||
}
|
||||
|
||||
private fun bindListItem(item: DrawerItem, holder: FeedHolder) {
|
||||
private fun bindListItem(item: FeedDrawerItem, holder: FeedHolder) {
|
||||
if (item.counter > 0) {
|
||||
holder.count.visibility = View.VISIBLE
|
||||
holder.count.text = NumberFormat.getInstance().format(item.counter.toLong())
|
||||
|
@ -348,7 +344,7 @@ class NavListAdapter(private val itemAccess: ItemAccess, context: Activity) :
|
|||
interface ItemAccess : OnCreateContextMenuListener {
|
||||
val count: Int
|
||||
|
||||
fun getItem(position: Int): DrawerItem?
|
||||
fun getItem(position: Int): FeedDrawerItem?
|
||||
|
||||
fun isSelected(position: Int): Boolean
|
||||
|
||||
|
|
|
@ -169,7 +169,9 @@ open class SubscriptionsRecyclerAdapter(mainActivity: MainActivity) :
|
|||
producer.text = drawerItem.producer
|
||||
coverImage.contentDescription = drawerItem.title
|
||||
if (drawerItem.counter > 0) {
|
||||
count.text = NumberFormat.getInstance().format(drawerItem.feed.items.size.toLong()) + " episodes"
|
||||
// TODO: need to use more specific number
|
||||
count.text = NumberFormat.getInstance().format(drawerItem.counter.toLong()) + " episodes"
|
||||
// count.text = NumberFormat.getInstance().format(drawerItem.feed.items.size.toLong()) + " episodes"
|
||||
count.visibility = View.VISIBLE
|
||||
} else {
|
||||
count.visibility = View.GONE
|
||||
|
|
|
@ -2,10 +2,9 @@ package ac.mdiq.podcini.ui.dialog
|
|||
|
||||
import ac.mdiq.podcini.R
|
||||
import ac.mdiq.podcini.databinding.EditTextDialogBinding
|
||||
import ac.mdiq.podcini.storage.model.feed.Feed
|
||||
import ac.mdiq.podcini.storage.model.feed.FeedPreferences
|
||||
import ac.mdiq.podcini.storage.DBWriter
|
||||
import ac.mdiq.podcini.storage.NavDrawerData.*
|
||||
import ac.mdiq.podcini.storage.NavDrawerData.FeedDrawerItem
|
||||
import ac.mdiq.podcini.storage.model.feed.Feed
|
||||
import android.app.Activity
|
||||
import android.content.DialogInterface
|
||||
import android.util.Log
|
||||
|
@ -20,14 +19,14 @@ import java.lang.ref.WeakReference
|
|||
class RenameItemDialog {
|
||||
private val activityRef: WeakReference<Activity>
|
||||
private var feed: Feed? = null
|
||||
private var drawerItem: DrawerItem? = null
|
||||
private var drawerItem: FeedDrawerItem? = null
|
||||
|
||||
constructor(activity: Activity, feed: Feed?) {
|
||||
this.activityRef = WeakReference(activity)
|
||||
this.feed = feed
|
||||
}
|
||||
|
||||
constructor(activity: Activity, drawerItem: DrawerItem?) {
|
||||
constructor(activity: Activity, drawerItem: FeedDrawerItem?) {
|
||||
this.activityRef = WeakReference(activity)
|
||||
this.drawerItem = drawerItem
|
||||
}
|
||||
|
|
|
@ -269,7 +269,6 @@ class ExternalPlayerFragment : Fragment(), SeekBar.OnSeekBarChangeListener {
|
|||
txtvFF.text = NumberFormat.getInstance().format(UserPreferences.fastForwardSecs.toLong())
|
||||
val media = controller?.getMedia()
|
||||
if (media != null) updatePlaybackSpeedButton(SpeedChangedEvent(PlaybackSpeedUtils.getCurrentPlaybackSpeed(media)))
|
||||
|
||||
}
|
||||
|
||||
@UnstableApi
|
||||
|
|
Before Width: | Height: | Size: 292 KiB After Width: | Height: | Size: 256 KiB |
Before Width: | Height: | Size: 230 KiB After Width: | Height: | Size: 230 KiB |
Before Width: | Height: | Size: 292 KiB After Width: | Height: | Size: 256 KiB |
Before Width: | Height: | Size: 230 KiB After Width: | Height: | Size: 230 KiB |