Skip to content

Commit

Permalink
notes share and faster episode open
Browse files Browse the repository at this point in the history
  • Loading branch information
XilinJia committed Mar 20, 2024
1 parent b4badaf commit d5b5734
Show file tree
Hide file tree
Showing 19 changed files with 530 additions and 286 deletions.
10 changes: 4 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ android {
// Version code schema (not used):
// "1.2.3-beta4" -> 1020304
// "1.2.3" -> 1020395
versionCode 3020109
versionName "4.2.6"
versionCode 3020110
versionName "4.2.7"

def commit = ""
try {
Expand All @@ -168,10 +168,9 @@ android {
buildConfigField "String", "PODCASTINDEX_API_KEY", '"' + podcastindexApiKey + '"'
buildConfigField "String", "PODCASTINDEX_API_SECRET", '"' + podcastindexApiSecret + '"'
} else {
buildConfigField "String", "PODCASTINDEX_API_KEY", '"XTMMQGA2YZ4WJUBYY4HK"'
buildConfigField "String", "PODCASTINDEX_API_SECRET", '"XAaAhk4^2YBsTE33vdbwbZNj82ZRLABDDqFdKe7x"'
buildConfigField "String", "PODCASTINDEX_API_KEY", '"QT2RYHSUZ3UC9GDJ5MFY"'
buildConfigField "String", "PODCASTINDEX_API_SECRET", '"Zw2NL74ht5aCtx5zFL$#MY$##qdVCX7x37jq95Sz"'
}

}
signingConfigs {
releaseConfig {
Expand Down Expand Up @@ -295,7 +294,6 @@ dependencies {
testImplementation "org.robolectric:robolectric:4.11.1"
testImplementation 'javax.inject:javax.inject:1'


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

Expand Down
255 changes: 134 additions & 121 deletions app/src/main/java/ac/mdiq/podcini/ui/activity/VideoplayerActivity.kt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ac.mdiq.podcini.ui.fragment.ItemPagerFragment
import ac.mdiq.podcini.ui.menuhandler.FeedItemMenuHandler
import ac.mdiq.podcini.storage.model.feed.FeedItem
import ac.mdiq.podcini.ui.common.ThemeUtils
import ac.mdiq.podcini.ui.fragment.ItemPageFragment
import ac.mdiq.podcini.ui.view.viewholder.EpisodeItemViewHolder
import android.R.color
import android.app.Activity
Expand Down Expand Up @@ -83,7 +84,7 @@ open class EpisodeItemListAdapter(mainActivity: MainActivity) :
if (!inActionMode()) {
val ids: LongArray = FeedItemUtil.getIds(episodes)
val position = ArrayUtils.indexOf(ids, item.id)
activity?.loadChildFragment(ItemPagerFragment.newInstance(ids, position))
activity?.loadChildFragment(ItemPageFragment.newInstance(ids, position))
} else {
toggleSelection(holder.bindingAdapterPosition)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import ac.mdiq.podcini.util.FeedItemUtil
import ac.mdiq.podcini.ui.fragment.ItemPagerFragment
import ac.mdiq.podcini.ui.menuhandler.FeedItemMenuHandler
import ac.mdiq.podcini.storage.model.feed.FeedItem
import ac.mdiq.podcini.ui.fragment.ItemPageFragment
import ac.mdiq.podcini.ui.view.viewholder.HorizontalItemViewHolder
import org.apache.commons.lang3.ArrayUtils
import java.lang.ref.WeakReference
Expand Down Expand Up @@ -65,7 +66,7 @@ open class HorizontalItemListAdapter(mainActivity: MainActivity) : RecyclerView.
if (activity != null) {
val ids: LongArray = FeedItemUtil.getIds(data)
val clickPosition = ArrayUtils.indexOf(ids, item.id)
activity.loadChildFragment(ItemPagerFragment.newInstance(ids, clickPosition))
activity.loadChildFragment(ItemPageFragment.newInstance(ids, clickPosition))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,23 @@ open class QueueRecyclerAdapter(mainActivity: MainActivity, private val swipeAct

@UnstableApi @SuppressLint("ClickableViewAccessibility")
override fun afterBindViewHolder(holder: EpisodeItemViewHolder, pos: Int) {
if (!dragDropEnabled) {
if (inActionMode() || !dragDropEnabled) {
holder.dragHandle.setVisibility(View.GONE)
holder.dragHandle.setOnTouchListener(null)
// holder.coverHolder.setOnTouchListener(null)
} else {
holder.dragHandle.setVisibility(View.VISIBLE)
holder.dragHandle.setOnTouchListener { _: View?, event: MotionEvent ->
if (event.actionMasked == MotionEvent.ACTION_DOWN) {
Log.d(TAG, "startDrag()")
swipeActions.startDrag(holder)
}
false
}
holder.coverHolder.setOnTouchListener { v1, event ->
if (event.actionMasked == MotionEvent.ACTION_DOWN) {
if (!inActionMode() && event.actionMasked == MotionEvent.ACTION_DOWN) {
val isLtr = holder.itemView.getLayoutDirection() == View.LAYOUT_DIRECTION_LTR
val factor = (if (isLtr) 1 else -1).toFloat()
if (factor * event.x < factor * 0.5 * v1.width) {
Log.d(TAG, "startDrag()")
swipeActions.startDrag(holder)
} else {
Log.d(TAG, "Ignoring drag in right half of the image")
Expand Down
39 changes: 19 additions & 20 deletions app/src/main/java/ac/mdiq/podcini/ui/fragment/FeedInfoFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,18 @@ class FeedInfoFragment : Fragment(), Toolbar.OnMenuItemClickListener {

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
): View {
val viewBinding = FeedinfoBinding.inflate(inflater)
// val root: View = inflater.inflate(R.layout.feedinfo, null)
val binding = FeedinfoBinding.inflate(inflater)

Log.d(TAG, "fragment onCreateView")
toolbar = viewBinding.toolbar
toolbar = binding.toolbar
toolbar.title = ""
toolbar.inflateMenu(R.menu.feedinfo)
toolbar.setNavigationOnClickListener { parentFragmentManager.popBackStack() }
toolbar.setOnMenuItemClickListener(this)
refreshToolbarState()

val appBar: AppBarLayout = viewBinding.appBar
val collapsingToolbar: CollapsingToolbarLayout = viewBinding.collapsingToolbar
val appBar: AppBarLayout = binding.appBar
val collapsingToolbar: CollapsingToolbarLayout = binding.collapsingToolbar
val iconTintManager: ToolbarIconTintManager =
object : ToolbarIconTintManager(requireContext(), toolbar, collapsingToolbar) {
override fun doTint(themedContext: Context) {
Expand All @@ -115,22 +114,22 @@ class FeedInfoFragment : Fragment(), Toolbar.OnMenuItemClickListener {
iconTintManager.updateTint()
appBar.addOnOffsetChangedListener(iconTintManager)

imgvCover = viewBinding.header.imgvCover
txtvTitle = viewBinding.header.txtvTitle
txtvAuthorHeader = viewBinding.header.txtvAuthor
imgvBackground = viewBinding.imgvBackground
header = viewBinding.header.root
infoContainer = viewBinding.infoContainer
// viewBinding.header.butShowInfo.visibility = View.INVISIBLE
viewBinding.header.butShowSettings.visibility = View.INVISIBLE
viewBinding.header.butFilter.visibility = View.INVISIBLE
imgvCover = binding.header.imgvCover
txtvTitle = binding.header.txtvTitle
txtvAuthorHeader = binding.header.txtvAuthor
imgvBackground = binding.imgvBackground
header = binding.header.root
infoContainer = binding.infoContainer
// binding.header.butShowInfo.visibility = View.INVISIBLE
binding.header.butShowSettings.visibility = View.INVISIBLE
binding.header.butFilter.visibility = View.INVISIBLE
// https://github.com/bumptech/glide/issues/529
imgvBackground.colorFilter = LightingColorFilter(-0x7d7d7e, 0x000000)

txtvDescription = viewBinding.txtvDescription
txtvUrl = viewBinding.txtvUrl
lblSupport = viewBinding.lblSupport
txtvFundingUrl = viewBinding.txtvFundingUrl
txtvDescription = binding.txtvDescription
txtvUrl = binding.txtvUrl
lblSupport = binding.lblSupport
txtvFundingUrl = binding.txtvFundingUrl

txtvUrl.setOnClickListener(copyUrlToClipboard)

Expand All @@ -139,12 +138,12 @@ class FeedInfoFragment : Fragment(), Toolbar.OnMenuItemClickListener {
FeedStatisticsFragment.newInstance(feedId, false), "feed_statistics_fragment")
.commitAllowingStateLoss()

viewBinding.btnvOpenStatistics.setOnClickListener {
binding.btnvOpenStatistics.setOnClickListener {
val fragment = StatisticsFragment()
(activity as MainActivity).loadChildFragment(fragment, TransitionEffect.SLIDE)
}

return viewBinding.root
return binding.root
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
Expand Down
Loading

0 comments on commit d5b5734

Please sign in to comment.