|
|
@ -243,7 +243,7 @@ class MangaDetailsController : BaseController,
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
val color =
|
|
|
|
val color =
|
|
|
|
coverColor ?: activity!!.getResourceColor(android.R.attr.colorPrimary)
|
|
|
|
coverColor ?: activity!!.getResourceColor(R.attr.colorPrimaryVariant)
|
|
|
|
val colorFrom =
|
|
|
|
val colorFrom =
|
|
|
|
if (colorAnimator?.isRunning == true) activity?.window?.statusBarColor
|
|
|
|
if (colorAnimator?.isRunning == true) activity?.window?.statusBarColor
|
|
|
|
?: color
|
|
|
|
?: color
|
|
|
@ -360,14 +360,14 @@ class MangaDetailsController : BaseController,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
colorAnimator?.cancel()
|
|
|
|
colorAnimator?.cancel()
|
|
|
|
|
|
|
|
|
|
|
|
val colorOnPrimary = activity?.getResourceColor(
|
|
|
|
val colorSecondary = activity?.getResourceColor(
|
|
|
|
R.attr.colorOnPrimary
|
|
|
|
R.attr.colorSecondary
|
|
|
|
) ?: Color.BLACK
|
|
|
|
) ?: Color.BLACK
|
|
|
|
(activity as MainActivity).appbar.setBackgroundColor(colorOnPrimary)
|
|
|
|
(activity as MainActivity).appbar.setBackgroundColor(colorSecondary)
|
|
|
|
(activity as MainActivity).toolbar.setBackgroundColor(colorOnPrimary)
|
|
|
|
(activity as MainActivity).toolbar.setBackgroundColor(colorSecondary)
|
|
|
|
|
|
|
|
|
|
|
|
activity?.window?.statusBarColor = activity?.getResourceColor(android.R.attr
|
|
|
|
activity?.window?.statusBarColor = activity?.getResourceColor(android.R.attr
|
|
|
|
.statusBarColor) ?: colorOnPrimary
|
|
|
|
.statusBarColor) ?: colorSecondary
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -517,22 +517,22 @@ class MangaDetailsController : BaseController,
|
|
|
|
|
|
|
|
|
|
|
|
fun toggleReadChapter(position: Int) {
|
|
|
|
fun toggleReadChapter(position: Int) {
|
|
|
|
val item = adapter?.getItem(position) as? ChapterItem ?: return
|
|
|
|
val item = adapter?.getItem(position) as? ChapterItem ?: return
|
|
|
|
if (!item.read) markAsRead(listOf(item), false)
|
|
|
|
if (!item.read) markAsRead(listOf(item))
|
|
|
|
else markAsUnread(listOf(item), false)
|
|
|
|
else markAsUnread(listOf(item))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun bookmarkChapters(chapters: List<ChapterItem>, bookmarked: Boolean) {
|
|
|
|
private fun bookmarkChapters(chapters: List<ChapterItem>, bookmarked: Boolean) {
|
|
|
|
presenter.bookmarkChapters(chapters, bookmarked)
|
|
|
|
presenter.bookmarkChapters(chapters, bookmarked)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun markAsRead(chapters: List<ChapterItem>, refresh: Boolean = true) {
|
|
|
|
private fun markAsRead(chapters: List<ChapterItem>) {
|
|
|
|
presenter.markChaptersRead(chapters, read = true)
|
|
|
|
presenter.markChaptersRead(chapters, read = true)
|
|
|
|
if (presenter.preferences.removeAfterMarkedAsRead()) {
|
|
|
|
if (presenter.preferences.removeAfterMarkedAsRead()) {
|
|
|
|
presenter.deleteChapters(chapters)
|
|
|
|
presenter.deleteChapters(chapters)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun markAsUnread(chapters: List<ChapterItem>, refresh: Boolean = true) {
|
|
|
|
private fun markAsUnread(chapters: List<ChapterItem>) {
|
|
|
|
presenter.markChaptersRead(chapters, read = false)
|
|
|
|
presenter.markChaptersRead(chapters, read = false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1248,25 +1248,25 @@ class MangaDetailsController : BaseController,
|
|
|
|
expandedImageView.setOnClickListener {
|
|
|
|
expandedImageView.setOnClickListener {
|
|
|
|
currentAnimator?.cancel()
|
|
|
|
currentAnimator?.cancel()
|
|
|
|
|
|
|
|
|
|
|
|
val rect = Rect()
|
|
|
|
val rect2 = Rect()
|
|
|
|
thumbView.getGlobalVisibleRect(rect)
|
|
|
|
thumbView.getGlobalVisibleRect(rect2)
|
|
|
|
expandedImageView.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
|
|
|
expandedImageView.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
|
|
|
height = thumbView.height
|
|
|
|
height = thumbView.height
|
|
|
|
width = thumbView.width
|
|
|
|
width = thumbView.width
|
|
|
|
topMargin = rect.top
|
|
|
|
topMargin = rect2.top
|
|
|
|
leftMargin = rect.left
|
|
|
|
leftMargin = rect2.left
|
|
|
|
rightMargin = rect.right
|
|
|
|
rightMargin = rect2.right
|
|
|
|
bottomMargin = rect.bottom
|
|
|
|
bottomMargin = rect2.bottom
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Zoom out back to tc thumbnail
|
|
|
|
// Zoom out back to tc thumbnail
|
|
|
|
val transitionSet = TransitionSet()
|
|
|
|
val transitionSet2 = TransitionSet()
|
|
|
|
val bound = ChangeBounds()
|
|
|
|
val bound2 = ChangeBounds()
|
|
|
|
transitionSet.addTransition(bound)
|
|
|
|
transitionSet2.addTransition(bound2)
|
|
|
|
val changeImageTransform = ChangeImageTransform()
|
|
|
|
val changeImageTransform2 = ChangeImageTransform()
|
|
|
|
transitionSet.addTransition(changeImageTransform)
|
|
|
|
transitionSet2.addTransition(changeImageTransform2)
|
|
|
|
transitionSet.duration = shortAnimationDuration.toLong()
|
|
|
|
transitionSet2.duration = shortAnimationDuration.toLong()
|
|
|
|
TransitionManager.beginDelayedTransition(frame_layout, transitionSet)
|
|
|
|
TransitionManager.beginDelayedTransition(frame_layout, transitionSet2)
|
|
|
|
|
|
|
|
|
|
|
|
// Animation to remove backdrop and hide the full cover
|
|
|
|
// Animation to remove backdrop and hide the full cover
|
|
|
|
currentAnimator = AnimatorSet().apply {
|
|
|
|
currentAnimator = AnimatorSet().apply {
|
|
|
|