Skip to content

Commit

Permalink
6.7.3 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
XilinJia committed Sep 24, 2024
1 parent d84dbeb commit eb6ce74
Show file tree
Hide file tree
Showing 23 changed files with 1,243 additions and 175 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ An open source podcast instrument, attuned to Puccini ![Puccini](./images/Puccin
[<img src="./images/external/getItf-droid.png" alt="F-Droid" height="50">](https://f-droid.org/packages/ac.mdiq.podcini.R/)
[<img src="./images/external/amazon.png" alt="Amazon" height="40">](https://www.amazon.com/%E8%B4%BE%E8%A5%BF%E6%9E%97-Podcini-R/dp/B0D9WR8P13)

#### Podcini.R version 6.5 as a major step forward brings YouTube contents in the app. Channels can be searched, received from share, subscribed. Since 6.5, podcasts, playlists as well as single media from Youtube and YT Music can be shared to Podcini. For more see the Youtube section below or the changelogs
#### Podcini.R version 6.5 as a major step forward brings YouTube contents in the app. Channels can be searched, received from share, subscribed. Since 6.6, podcasts, playlists as well as single media from Youtube and YT Music can be shared to Podcini. For more see the Youtube section below or the changelogs
That means finally: [Nessun dorma](https://www.youtube.com/watch?v=cWc7vYjgnTs)
#### For Podcini to show up on car's HUD with Android Auto, please read AnroidAuto.md for instructions.
#### If you are migrating from Podcini version 5, please read the migrationTo5.md file for migration instructions.
Expand Down
171 changes: 88 additions & 83 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 3020255
versionName "6.7.2"
versionCode 3020256
versionName "6.7.3"

applicationId "ac.mdiq.podcini.R"
def commit = ""
Expand Down Expand Up @@ -170,110 +170,115 @@ android {
}

dependencies {
implementation libs.androidx.material3.android

/** Desugaring for using VistaGuide **/
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.1.2'
implementation 'com.github.XilinJia.vistaguide:VistaGuide:lv0.24.2.6'
coreLibraryDesugaring libs.desugar.jdk.libs.nio
implementation libs.vistaguide

def composeBom = platform('androidx.compose:compose-bom:2024.09.02')
def composeBom = libs.androidx.compose.bom
implementation composeBom
androidTestImplementation composeBom
implementation 'androidx.compose.material:material:1.7.2'
implementation 'androidx.compose.ui:ui-tooling-preview:1.7.2'
debugImplementation 'androidx.compose.ui:ui-tooling:1.7.2'

implementation 'androidx.activity:activity-compose:1.9.2'
implementation 'androidx.window:window:1.3.0'

implementation "androidx.core:core-ktx:1.13.1"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1'

implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.8.6"
implementation "androidx.annotation:annotation:1.8.2"
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
implementation libs.androidx.material
implementation libs.androidx.ui.tooling.preview
debugImplementation libs.androidx.ui.tooling
implementation libs.androidx.constraintlayout.compose

implementation libs.androidx.activity.compose
implementation libs.androidx.window

implementation libs.androidx.core.ktx
implementation libs.kotlinx.coroutines.android

implementation libs.androidx.lifecycle.runtime.ktx
implementation libs.androidx.annotation
implementation libs.androidx.appcompat
implementation libs.androidx.coordinatorlayout
//noinspection UseTomlInstead
implementation "androidx.fragment:fragment-ktx:1.8.3"
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation "androidx.media3:media3-exoplayer:1.4.1"
implementation "androidx.media3:media3-ui:1.4.1"
implementation "androidx.media3:media3-datasource-okhttp:1.4.1"
implementation "androidx.media3:media3-common:1.4.1"
implementation "androidx.media3:media3-session:1.4.1"
implementation "androidx.palette:palette-ktx:1.0.0"
implementation "androidx.preference:preference-ktx:1.2.1"
implementation "androidx.recyclerview:recyclerview:1.3.2"
implementation "androidx.viewpager2:viewpager2:1.1.0"
implementation "androidx.work:work-runtime:2.9.1"
implementation "androidx.core:core-splashscreen:1.0.1"
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'androidx.webkit:webkit:1.12.0'

implementation "com.google.android.material:material:1.12.0"

implementation 'io.realm.kotlin:library-base:2.1.0'

implementation 'org.apache.commons:commons-lang3:3.15.0'
implementation 'commons-io:commons-io:2.16.1'
implementation 'org.jsoup:jsoup:1.18.1'

implementation 'io.coil-kt:coil:2.7.0'

implementation "com.squareup.okhttp3:okhttp:4.12.0"
implementation "com.squareup.okhttp3:okhttp-urlconnection:4.12.0"
implementation 'com.squareup.okio:okio:3.9.0'

implementation "io.reactivex.rxjava2:rxjava:2.2.21"
implementation "io.reactivex.rxjava3:rxjava:3.1.8"
implementation "io.reactivex.rxjava3:rxandroid:3.0.2"
implementation libs.androidx.gridlayout
implementation libs.androidx.media3.exoplayer
implementation libs.androidx.media3.ui
implementation libs.androidx.media3.media3.datasource.okhttp
implementation libs.media3.common
implementation libs.media3.session
implementation libs.androidx.palette.ktx
implementation libs.androidx.preference.ktx
implementation libs.androidx.recyclerview
implementation libs.androidx.viewpager2
implementation libs.androidx.work.runtime
implementation libs.androidx.core.splashscreen
implementation libs.androidx.documentfile
implementation libs.androidx.webkit

implementation libs.material

implementation libs.library.base

implementation libs.commons.lang3
implementation libs.commons.io
implementation libs.jsoup

implementation libs.coil
implementation libs.coil.compose

implementation libs.okhttp
implementation libs.okhttp3.okhttp.urlconnection
implementation libs.okio

implementation libs.rxjava
implementation libs.rxjava3.rxjava
implementation libs.rxandroid

// 5.5.0-b01 is newer than 5.5.0-compose01
implementation 'com.mikepenz:iconics-core:5.5.0-b01'
implementation 'com.mikepenz:iconics-views:5.5.0-b01'
implementation 'com.mikepenz:google-material-typeface:4.0.0.3-kotlin@aar'
implementation 'com.mikepenz:google-material-typeface-outlined:4.0.0.2-kotlin@aar'
implementation 'com.mikepenz:fontawesome-typeface:5.13.3.0-kotlin@aar'
implementation libs.iconics.core
implementation libs.iconics.views
implementation libs.google.material.typeface
implementation libs.google.material.typeface.outlined
implementation libs.fontawesome.typeface

implementation 'com.leinardi.android:speed-dial:3.3.0'
implementation 'com.github.ByteHamster:SearchPreference:v2.5.0'
implementation 'com.github.skydoves:balloon:1.6.6'
implementation 'com.github.xabaras:RecyclerViewSwipeDecorator:1.3'
implementation "com.annimon:stream:1.2.2"
implementation libs.speed.dial
implementation libs.searchpreference
implementation libs.balloon
implementation libs.recyclerviewswipedecorator
implementation libs.stream

implementation 'com.github.mfietz:fyydlin:v0.5.0'
implementation libs.fyydlin

implementation "net.dankito.readability4j:readability4j:1.0.8"
implementation libs.readability4j

// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'

// Non-free dependencies:
playImplementation 'com.google.android.play:core-ktx:1.8.1'
compileOnly "com.google.android.wearable:wearable:2.9.0"
playImplementation libs.core.ktx
compileOnly libs.wearable

// this one can not be updated? TODO: need to get an alternative
androidTestImplementation 'com.nanohttpd:nanohttpd:2.1.1'
androidTestImplementation libs.nanohttpd

androidTestImplementation "androidx.test.espresso:espresso-core:3.6.1"
androidTestImplementation "androidx.test.espresso:espresso-contrib:3.6.1"
androidTestImplementation "androidx.test.espresso:espresso-intents:3.6.1"
androidTestImplementation "androidx.test:runner:1.6.2"
androidTestImplementation "androidx.test:rules:1.6.1"
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'org.awaitility:awaitility:4.2.1'
androidTestImplementation libs.androidx.espresso.core
androidTestImplementation libs.androidx.espresso.contrib
androidTestImplementation libs.androidx.espresso.intents
androidTestImplementation libs.androidx.runner
androidTestImplementation libs.androidx.rules
androidTestImplementation libs.androidx.junit
androidTestImplementation libs.awaitility

// Non-free dependencies:

testImplementation "androidx.test:core:1.6.1"
testImplementation 'org.awaitility:awaitility:4.2.1'
testImplementation "junit:junit:4.13.2"
testImplementation 'org.mockito:mockito-inline:5.2.0'
testImplementation 'org.robolectric:robolectric:4.13'
testImplementation 'javax.inject:javax.inject:1'
testImplementation libs.androidx.core
testImplementation libs.awaitility
testImplementation libs.junit
testImplementation libs.mockito.inline
testImplementation libs.robolectric
testImplementation libs.javax.inject

playImplementation 'com.google.android.gms:play-services-base:18.5.0'
freeImplementation 'org.conscrypt:conscrypt-android:2.5.2'
playImplementation libs.play.services.base
freeImplementation libs.conscrypt.android

playApi 'androidx.mediarouter:mediarouter:1.7.0'
playApi libs.androidx.mediarouter
// playApi "com.google.android.support:wearable:2.9.0"
playApi 'com.google.android.gms:play-services-cast-framework:21.5.0'
playApi libs.play.services.cast.framework
}

apply plugin: "io.realm.kotlin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import ac.mdiq.podcini.storage.utils.EpisodeUtil
import ac.mdiq.podcini.storage.utils.EpisodeUtil.hasAlmostEnded
import ac.mdiq.podcini.ui.activity.starter.MainActivityStarter
import ac.mdiq.podcini.ui.activity.starter.VideoPlayerActivityStarter
import ac.mdiq.podcini.ui.fragment.AudioPlayerFragment.PlayerDetailsFragment.Companion.media3Controller
import ac.mdiq.podcini.ui.utils.NotificationUtils
import ac.mdiq.podcini.ui.widget.WidgetUpdater
import ac.mdiq.podcini.ui.widget.WidgetUpdater.WidgetState
Expand All @@ -66,7 +67,6 @@ import ac.mdiq.podcini.util.FlowEvent.PlayEvent.Action
import ac.mdiq.podcini.util.IntentUtils.sendLocalBroadcast
import ac.mdiq.podcini.util.Logd
import ac.mdiq.podcini.util.config.ClientConfig
import ac.mdiq.podcini.util.showStackTrace
import ac.mdiq.vista.extractor.MediaFormat
import ac.mdiq.vista.extractor.stream.AudioStream
import ac.mdiq.vista.extractor.stream.DeliveryMethod
Expand Down Expand Up @@ -165,7 +165,6 @@ class PlaybackService : MediaLibraryService() {
private var autoSkippedFeedMediaId: String? = null
internal var normalSpeed = 1.0f

// private val mBinder: IBinder = LocalBinder()
private var clickCount = 0
private val clickHandler = Handler(Looper.getMainLooper())

Expand Down Expand Up @@ -1169,6 +1168,7 @@ class PlaybackService : MediaLibraryService() {
var position = position
val duration_: Int
if (fromMediaPlayer) {
// position = (media3Controller?.currentPosition ?: 0).toInt() // testing the controller
position = curPosition
duration_ = this.curDuration
playable = curMedia
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@ import com.google.android.material.snackbar.Snackbar
import ac.mdiq.podcini.BuildConfig
import ac.mdiq.podcini.R
import ac.mdiq.podcini.databinding.PagerFragmentBinding
import ac.mdiq.podcini.databinding.SimpleIconListItemBinding
import ac.mdiq.podcini.ui.activity.PreferenceActivity
import ac.mdiq.podcini.ui.adapter.SimpleIconListAdapter
import ac.mdiq.podcini.util.IntentUtils.openInBrowser
import android.R.color
import android.content.DialogInterface
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ArrayAdapter
import android.widget.ListView
import android.widget.Toast
import androidx.fragment.app.Fragment
import androidx.fragment.app.ListFragment
import androidx.lifecycle.lifecycleScope
import androidx.viewpager2.adapter.FragmentStateAdapter
import coil.load
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
Expand Down Expand Up @@ -98,7 +100,7 @@ class AboutFragment : PreferenceFragmentCompat() {
"", lib.getNamedItem("website").textContent, lib.getNamedItem("licenseText").textContent))
}
withContext(Dispatchers.Main) {
listAdapter = SimpleIconListAdapter(requireContext(), licenses)
listAdapter = ContributorsPagerFragment.SimpleIconListAdapter(requireContext(), licenses)
}
}.invokeOnCompletion { throwable ->
if (throwable!= null) {
Expand All @@ -108,7 +110,7 @@ class AboutFragment : PreferenceFragmentCompat() {
}

private class LicenseItem(title: String, subtitle: String, imageUrl: String, val licenseUrl: String, val licenseTextFile: String)
: SimpleIconListAdapter.ListItem(title, subtitle, imageUrl)
: ContributorsPagerFragment.SimpleIconListAdapter.ListItem(title, subtitle, imageUrl)

override fun onListItemClick(l: ListView, v: View, position: Int, id: Long) {
super.onListItemClick(l, v, position, id)
Expand Down Expand Up @@ -263,6 +265,27 @@ class AboutFragment : PreferenceFragmentCompat() {
}
}

/**
* Displays a list of items that have a subtitle and an icon.
*/
class SimpleIconListAdapter<T : SimpleIconListAdapter.ListItem>(private val context: Context, private val listItems: List<T>)
: ArrayAdapter<T>(context, R.layout.simple_icon_list_item, listItems) {

override fun getView(position: Int, view: View?, parent: ViewGroup): View {
var view = view
if (view == null) view = View.inflate(context, R.layout.simple_icon_list_item, null)

val item: ListItem = listItems[position]
val binding = SimpleIconListItemBinding.bind(view!!)
binding.title.text = item.title
binding.subtitle.text = item.subtitle
binding.icon.load(item.imageUrl)
return view
}

open class ListItem(val title: String, val subtitle: String, val imageUrl: String)
}

companion object {
private const val POS_DEVELOPERS = 0
private const val POS_TRANSLATORS = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,13 @@ class EpisodeMultiSelectHandler(private val activity: MainActivity, private val
fun handleAction(items: List<Episode>) {
when (actionId) {
R.id.toggle_favorite_batch -> toggleFavorite(items)
// R.id.add_to_favorite_batch -> markFavorite(items, true)
// R.id.remove_favorite_batch -> markFavorite(items, false)
R.id.add_to_queue_batch -> queueChecked(items)
R.id.put_in_queue_batch -> PutToQueueDialog(activity, items).show()
R.id.remove_from_queue_batch -> removeFromQueueChecked(items)
R.id.toggle_played_batch -> {
setPlayState(Episode.PlayState.UNSPECIFIED.code, false, *items.toTypedArray())
// showMessage(R.plurals.marked_read_batch_label, items.size)
}
// R.id.mark_read_batch -> {
// setPlayState(Episode.PLAYED, false, *items.toTypedArray())
// showMessage(R.plurals.marked_read_batch_label, items.size)
// }
// R.id.mark_unread_batch -> {
// setPlayState(Episode.UNPLAYED, false, *items.toTypedArray())
// showMessage(R.plurals.marked_unread_batch_label, items.size)
// }
R.id.download_batch -> downloadChecked(items)
R.id.delete_batch -> deleteChecked(items)
else -> Log.e(TAG, "Unrecognized speed dial action item. Do nothing. id=$actionId")
Expand All @@ -64,18 +54,18 @@ class EpisodeMultiSelectHandler(private val activity: MainActivity, private val

private fun queueChecked(items: List<Episode>) {
// Check if an episode actually contains any media files before adding it to queue
val toQueue = mutableListOf<Long>()
for (episode in items) {
if (episode.media != null) toQueue.add(episode.id)
}
// val toQueue = mutableListOf<Long>()
// for (episode in items) {
// if (episode.media != null) toQueue.add(episode.id)
// }
Queues.addToQueue(true, *items.toTypedArray())
showMessage(R.plurals.added_to_queue_batch_label, toQueue.size)
showMessage(R.plurals.added_to_queue_batch_label, items.size)
}

private fun removeFromQueueChecked(items: List<Episode>) {
val checkedIds = getSelectedIds(items)
// val checkedIds = getSelectedIds(items)
removeFromQueue(*items.toTypedArray())
showMessage(R.plurals.removed_from_queue_batch_label, checkedIds.size)
showMessage(R.plurals.removed_from_queue_batch_label, items.size)
}

private fun toggleFavorite(items: List<Episode>) {
Expand Down Expand Up @@ -109,13 +99,13 @@ class EpisodeMultiSelectHandler(private val activity: MainActivity, private val
}
}

private fun getSelectedIds(items: List<Episode>): List<Long> {
val checkedIds = mutableListOf<Long>()
for (i in items.indices) {
checkedIds.add(items[i].id)
}
return checkedIds
}
// private fun getSelectedIds(items: List<Episode>): List<Long> {
// val checkedIds = mutableListOf<Long>()
// for (i in items.indices) {
// checkedIds.add(items[i].id)
// }
// return checkedIds
// }

class PutToQueueDialog(activity: Activity, val items: List<Episode>) {
private val activityRef: WeakReference<Activity> = WeakReference(activity)
Expand Down
Loading

0 comments on commit eb6ce74

Please sign in to comment.