Refactoring Chapters

This commit is contained in:
Jay 2020-03-22 04:22:11 -04:00
parent b331e12fde
commit 30925053ab
13 changed files with 136 additions and 222 deletions

View File

@ -1,4 +1,4 @@
package eu.kanade.tachiyomi.ui.manga.info package eu.kanade.tachiyomi.ui.manga
import android.app.Dialog import android.app.Dialog
import android.net.Uri import android.net.Uri
@ -15,7 +15,6 @@ import eu.kanade.tachiyomi.data.database.models.MangaImpl
import eu.kanade.tachiyomi.data.glide.GlideApp import eu.kanade.tachiyomi.data.glide.GlideApp
import eu.kanade.tachiyomi.source.LocalSource import eu.kanade.tachiyomi.source.LocalSource
import eu.kanade.tachiyomi.ui.base.controller.DialogController import eu.kanade.tachiyomi.ui.base.controller.DialogController
import eu.kanade.tachiyomi.ui.manga.MangaDetailsController
import kotlinx.android.synthetic.main.edit_manga_dialog.view.* import kotlinx.android.synthetic.main.edit_manga_dialog.view.*
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get

View File

@ -1,4 +1,4 @@
package eu.kanade.tachiyomi.ui.manga.chapter package eu.kanade.tachiyomi.ui.manga
import android.content.Context import android.content.Context
import android.view.View import android.view.View
@ -8,15 +8,14 @@ import eu.davidea.flexibleadapter.FlexibleAdapter
import eu.davidea.flexibleadapter.items.IFlexible import eu.davidea.flexibleadapter.items.IFlexible
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.ui.manga.MangaDetailsController import eu.kanade.tachiyomi.ui.manga.chapter.ChapterItem
import eu.kanade.tachiyomi.ui.manga.MangaDetailsPresenter
import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate
import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.system.getResourceColor
import java.text.DecimalFormat import java.text.DecimalFormat
import java.text.DecimalFormatSymbols import java.text.DecimalFormatSymbols
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
class ChaptersAdapter( class MangaDetailsAdapter(
val controller: MangaDetailsController, val controller: MangaDetailsController,
context: Context context: Context
) : FlexibleAdapter<IFlexible<*>>(null, controller, true) { ) : FlexibleAdapter<IFlexible<*>>(null, controller, true) {

View File

@ -80,11 +80,11 @@ import eu.kanade.tachiyomi.ui.library.ChangeMangaCategoriesDialog
import eu.kanade.tachiyomi.ui.library.LibraryController import eu.kanade.tachiyomi.ui.library.LibraryController
import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.ui.main.MainActivity
import eu.kanade.tachiyomi.ui.main.SearchActivity import eu.kanade.tachiyomi.ui.main.SearchActivity
import eu.kanade.tachiyomi.ui.manga.chapter.ChapterHolder
import eu.kanade.tachiyomi.ui.manga.chapter.ChapterItem import eu.kanade.tachiyomi.ui.manga.chapter.ChapterItem
import eu.kanade.tachiyomi.ui.manga.chapter.ChapterMatHolder import eu.kanade.tachiyomi.ui.manga.chapter.ChaptersSortBottomSheet
import eu.kanade.tachiyomi.ui.manga.chapter.ChaptersAdapter
import eu.kanade.tachiyomi.ui.manga.info.EditMangaDialog
import eu.kanade.tachiyomi.ui.manga.track.TrackItem import eu.kanade.tachiyomi.ui.manga.track.TrackItem
import eu.kanade.tachiyomi.ui.manga.track.TrackingBottomSheet
import eu.kanade.tachiyomi.ui.reader.ReaderActivity import eu.kanade.tachiyomi.ui.reader.ReaderActivity
import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate
import eu.kanade.tachiyomi.ui.webview.WebViewActivity import eu.kanade.tachiyomi.ui.webview.WebViewActivity
@ -115,7 +115,7 @@ class MangaDetailsController : BaseController,
FlexibleAdapter.OnItemClickListener, FlexibleAdapter.OnItemClickListener,
FlexibleAdapter.OnItemLongClickListener, FlexibleAdapter.OnItemLongClickListener,
ActionMode.Callback, ActionMode.Callback,
ChaptersAdapter.MangaHeaderInterface, MangaDetailsAdapter.MangaHeaderInterface,
FlexibleAdapter.OnItemMoveListener, FlexibleAdapter.OnItemMoveListener,
ChangeMangaCategoriesDialog.Listener { ChangeMangaCategoriesDialog.Listener {
@ -170,7 +170,7 @@ class MangaDetailsController : BaseController,
/** /**
* Adapter containing a list of chapters. * Adapter containing a list of chapters.
*/ */
private var adapter: ChaptersAdapter? = null private var adapter: MangaDetailsAdapter? = null
/** /**
* Action mode for selections. * Action mode for selections.
@ -195,7 +195,8 @@ class MangaDetailsController : BaseController,
coverColor = null coverColor = null
// Init RecyclerView and adapter // Init RecyclerView and adapter
adapter = ChaptersAdapter(this, view.context) adapter =
MangaDetailsAdapter(this, view.context)
recycler.adapter = adapter recycler.adapter = adapter
adapter?.isSwipeEnabled = true adapter?.isSwipeEnabled = true
@ -340,8 +341,8 @@ class MangaDetailsController : BaseController,
download.progress) download.progress)
} }
private fun getHolder(chapter: Chapter): ChapterMatHolder? { private fun getHolder(chapter: Chapter): ChapterHolder? {
return recycler?.findViewHolderForItemId(chapter.id!!) as? ChapterMatHolder return recycler?.findViewHolderForItemId(chapter.id!!) as? ChapterHolder
} }
override fun onChangeStarted(handler: ControllerChangeHandler, type: ControllerChangeType) { override fun onChangeStarted(handler: ControllerChangeHandler, type: ControllerChangeType) {
@ -434,7 +435,7 @@ class MangaDetailsController : BaseController,
adapter?.addSelection(position) adapter?.addSelection(position)
(recycler.findViewHolderForAdapterPosition(position) as? BaseFlexibleViewHolder) (recycler.findViewHolderForAdapterPosition(position) as? BaseFlexibleViewHolder)
?.toggleActivation() ?.toggleActivation()
(recycler.findViewHolderForAdapterPosition(position) as? ChapterMatHolder) (recycler.findViewHolderForAdapterPosition(position) as? ChapterHolder)
?.notifyStatus(Download.CHECKED, false, 0) ?.notifyStatus(Download.CHECKED, false, 0)
startingDLChapterPos = position startingDLChapterPos = position
actionMode?.invalidate() actionMode?.invalidate()
@ -589,7 +590,11 @@ class MangaDetailsController : BaseController,
when (item.itemId) { when (item.itemId) {
R.id.action_edit -> { R.id.action_edit -> {
if (manga?.source == LocalSource.ID) { if (manga?.source == LocalSource.ID) {
editMangaDialog = EditMangaDialog(this, presenter.manga) editMangaDialog =
EditMangaDialog(
this,
presenter.manga
)
editMangaDialog?.showDialog(router) editMangaDialog?.showDialog(router)
} else { } else {
if (manga?.hasCustomCover() == true) { if (manga?.hasCustomCover() == true) {
@ -1015,7 +1020,8 @@ class MangaDetailsController : BaseController,
} }
override fun showTrackingSheet() { override fun showTrackingSheet() {
trackingBottomSheet = TrackingBottomSheet(this) trackingBottomSheet =
TrackingBottomSheet(this)
trackingBottomSheet?.show() trackingBottomSheet?.show()
} }
@ -1083,7 +1089,7 @@ class MangaDetailsController : BaseController,
setStatusBarAndToolbar() setStatusBarAndToolbar()
if (startingDLChapterPos != null) { if (startingDLChapterPos != null) {
val item = adapter?.getItem(startingDLChapterPos!!) as? ChapterItem val item = adapter?.getItem(startingDLChapterPos!!) as? ChapterItem
(recycler.findViewHolderForAdapterPosition(startingDLChapterPos!!) as? ChapterMatHolder)?.notifyStatus( (recycler.findViewHolderForAdapterPosition(startingDLChapterPos!!) as? ChapterHolder)?.notifyStatus(
item?.status ?: Download.NOT_DOWNLOADED, false, 0 item?.status ?: Download.NOT_DOWNLOADED, false, 0
) )
} }

View File

@ -18,18 +18,17 @@ import eu.kanade.tachiyomi.data.glide.GlideApp
import eu.kanade.tachiyomi.source.LocalSource import eu.kanade.tachiyomi.source.LocalSource
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
import eu.kanade.tachiyomi.ui.manga.chapter.ChaptersAdapter
import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.system.getResourceColor
import eu.kanade.tachiyomi.util.view.gone import eu.kanade.tachiyomi.util.view.gone
import eu.kanade.tachiyomi.util.view.updateLayoutParams import eu.kanade.tachiyomi.util.view.updateLayoutParams
import eu.kanade.tachiyomi.util.view.visible import eu.kanade.tachiyomi.util.view.visible
import eu.kanade.tachiyomi.util.view.visibleIf import eu.kanade.tachiyomi.util.view.visibleIf
import java.util.Locale
import kotlinx.android.synthetic.main.manga_header_item.* import kotlinx.android.synthetic.main.manga_header_item.*
import java.util.Locale
class MangaHeaderHolder( class MangaHeaderHolder(
private val view: View, private val view: View,
private val adapter: ChaptersAdapter, private val adapter: MangaDetailsAdapter,
startExpanded: Boolean startExpanded: Boolean
) : BaseFlexibleViewHolder(view, adapter) { ) : BaseFlexibleViewHolder(view, adapter) {

View File

@ -7,7 +7,6 @@ import eu.davidea.flexibleadapter.items.AbstractFlexibleItem
import eu.davidea.flexibleadapter.items.IFlexible import eu.davidea.flexibleadapter.items.IFlexible
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.ui.manga.chapter.ChaptersAdapter
class MangaHeaderItem(val manga: Manga, private val startExpanded: Boolean) : class MangaHeaderItem(val manga: Manga, private val startExpanded: Boolean) :
AbstractFlexibleItem<MangaHeaderHolder>() { AbstractFlexibleItem<MangaHeaderHolder>() {
@ -27,7 +26,7 @@ class MangaHeaderItem(val manga: Manga, private val startExpanded: Boolean) :
} }
override fun createViewHolder(view: View, adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>): MangaHeaderHolder { override fun createViewHolder(view: View, adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>): MangaHeaderHolder {
return MangaHeaderHolder(view, adapter as ChaptersAdapter, startExpanded) return MangaHeaderHolder(view, adapter as MangaDetailsAdapter, startExpanded)
} }
override fun bindViewHolder( override fun bindViewHolder(

View File

@ -10,15 +10,16 @@ import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.data.download.model.Download
import eu.kanade.tachiyomi.source.LocalSource import eu.kanade.tachiyomi.source.LocalSource
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
import eu.kanade.tachiyomi.ui.manga.MangaDetailsAdapter
import eu.kanade.tachiyomi.util.view.gone import eu.kanade.tachiyomi.util.view.gone
import eu.kanade.tachiyomi.util.view.visibleIf import eu.kanade.tachiyomi.util.view.visibleIf
import kotlinx.android.synthetic.main.chapters_mat_item.*
import kotlinx.android.synthetic.main.download_button.*
import java.util.Date import java.util.Date
import kotlinx.android.synthetic.main.chapters_item.*
import kotlinx.android.synthetic.main.download_button.*
class ChapterMatHolder( class ChapterHolder(
private val view: View, private val view: View,
private val adapter: ChaptersAdapter private val adapter: MangaDetailsAdapter
) : BaseFlexibleViewHolder(view, adapter) { ) : BaseFlexibleViewHolder(view, adapter) {
private var localSource = false private var localSource = false
@ -151,7 +152,7 @@ class ChapterMatHolder(
val anim = front_view.animate().translationX(0f).setDuration(250) val anim = front_view.animate().translationX(0f).setDuration(250)
anim.setListener(object : Animator.AnimatorListener { anim.setListener(object : Animator.AnimatorListener {
override fun onAnimationEnd(animation: Animator?) { override fun onAnimationEnd(animation: Animator?) {
adapter.itemTouchHelper.startSwipe(this@ChapterMatHolder) adapter.itemTouchHelper.startSwipe(this@ChapterHolder)
adapter.notifyItemChanged(adapterPosition) adapter.notifyItemChanged(adapterPosition)
} }

View File

@ -10,9 +10,10 @@ import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.data.download.model.Download
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.ui.manga.MangaDetailsAdapter
class ChapterItem(val chapter: Chapter, val manga: Manga) : class ChapterItem(val chapter: Chapter, val manga: Manga) :
AbstractFlexibleItem<ChapterMatHolder>(), AbstractFlexibleItem<ChapterHolder>(),
Chapter by chapter { Chapter by chapter {
private var _status: Int = 0 private var _status: Int = 0
@ -34,7 +35,7 @@ class ChapterItem(val chapter: Chapter, val manga: Manga) :
get() = status == Download.DOWNLOADED get() = status == Download.DOWNLOADED
override fun getLayoutRes(): Int { override fun getLayoutRes(): Int {
return R.layout.chapters_mat_item return R.layout.chapters_item
} }
override fun isSelectable(): Boolean { override fun isSelectable(): Boolean {
@ -45,13 +46,13 @@ class ChapterItem(val chapter: Chapter, val manga: Manga) :
return !isLocked return !isLocked
} }
override fun createViewHolder(view: View, adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>): ChapterMatHolder { override fun createViewHolder(view: View, adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>): ChapterHolder {
return ChapterMatHolder(view, adapter as ChaptersAdapter) return ChapterHolder(view, adapter as MangaDetailsAdapter)
} }
override fun bindViewHolder( override fun bindViewHolder(
adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>, adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>,
holder: ChapterMatHolder, holder: ChapterHolder,
position: Int, position: Int,
payloads: MutableList<Any?>? payloads: MutableList<Any?>?
) { ) {

View File

@ -1,4 +1,4 @@
package eu.kanade.tachiyomi.ui.manga package eu.kanade.tachiyomi.ui.manga.chapter
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
@ -8,6 +8,7 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialog
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.ui.manga.MangaDetailsController
import eu.kanade.tachiyomi.util.system.dpToPx import eu.kanade.tachiyomi.util.system.dpToPx
import eu.kanade.tachiyomi.util.view.setBottomEdge import eu.kanade.tachiyomi.util.view.setBottomEdge
import eu.kanade.tachiyomi.util.view.setEdgeToEdge import eu.kanade.tachiyomi.util.view.setEdgeToEdge

View File

@ -16,7 +16,6 @@ import eu.kanade.tachiyomi.data.track.TrackService
import eu.kanade.tachiyomi.data.track.model.TrackSearch import eu.kanade.tachiyomi.data.track.model.TrackSearch
import eu.kanade.tachiyomi.ui.base.controller.DialogController import eu.kanade.tachiyomi.ui.base.controller.DialogController
import eu.kanade.tachiyomi.ui.manga.MangaDetailsPresenter import eu.kanade.tachiyomi.ui.manga.MangaDetailsPresenter
import eu.kanade.tachiyomi.ui.manga.TrackingBottomSheet
import eu.kanade.tachiyomi.util.lang.plusAssign import eu.kanade.tachiyomi.util.lang.plusAssign
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import kotlinx.android.synthetic.main.track_search_dialog.view.* import kotlinx.android.synthetic.main.track_search_dialog.view.*

View File

@ -1,4 +1,4 @@
package eu.kanade.tachiyomi.ui.manga package eu.kanade.tachiyomi.ui.manga.track
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
@ -11,13 +11,7 @@ import com.google.android.material.bottomsheet.BottomSheetDialog
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.track.TrackService import eu.kanade.tachiyomi.data.track.TrackService
import eu.kanade.tachiyomi.data.track.model.TrackSearch import eu.kanade.tachiyomi.data.track.model.TrackSearch
import eu.kanade.tachiyomi.ui.manga.track.SetTrackChaptersDialog import eu.kanade.tachiyomi.ui.manga.MangaDetailsController
import eu.kanade.tachiyomi.ui.manga.track.SetTrackScoreDialog
import eu.kanade.tachiyomi.ui.manga.track.SetTrackStatusDialog
import eu.kanade.tachiyomi.ui.manga.track.TrackAdapter
import eu.kanade.tachiyomi.ui.manga.track.TrackHolder
import eu.kanade.tachiyomi.ui.manga.track.TrackItem
import eu.kanade.tachiyomi.ui.manga.track.TrackSearchDialog
import eu.kanade.tachiyomi.util.system.dpToPx import eu.kanade.tachiyomi.util.system.dpToPx
import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.system.toast
import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener
@ -126,7 +120,9 @@ class TrackingBottomSheet(private val controller: MangaDetailsController) : Bott
override fun onSetClick(position: Int) { override fun onSetClick(position: Int) {
val item = adapter?.getItem(position) ?: return val item = adapter?.getItem(position) ?: return
TrackSearchDialog(this, item.service, item.track != null).showDialog( TrackSearchDialog(this, item.service, item.track != null).showDialog(
controller.router, TAG_SEARCH_CONTROLLER) controller.router,
TAG_SEARCH_CONTROLLER
)
} }
override fun onStatusClick(position: Int) { override fun onStatusClick(position: Int) {

View File

@ -1,86 +1,103 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/chapter_layout"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight" android:layout_height="wrap_content"
android:background="?attr/selectable_list_drawable"> android:background="?android:attr/colorBackground">
<FrameLayout
android:id="@+id/right_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:background="@color/material_green_800"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/read"
android:layout_width="24dp"
android:layout_height="24dp"
android:tint="@color/md_white_1000"
android:layout_gravity="end|center"
android:layout_marginEnd="21dp"
android:src="@drawable/ic_read_24dp" />
</FrameLayout>
<FrameLayout
android:id="@+id/left_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:background="@color/colorAccent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/bookmark"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="start|center"
android:layout_marginStart="21dp"
android:tint="@color/md_white_1000"
android:src="@drawable/ic_bookmark_white_24dp" />
</FrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/front_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
android:background="?attr/selectable_list_drawable"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView <TextView
android:id="@+id/chapter_title" android:id="@+id/chapter_title"
style="@style/TextAppearance.Regular.Body1" style="@style/TextAppearance.MaterialComponents.Body2"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="2"
tools:text="Title" app:layout_constraintBottom_toTopOf="@id/chapter_scanlator"
app:layout_constraintEnd_toStartOf="@id/download_button"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="@+id/chapter_menu" tools:text="Chapter 123 - The Real One" />
android:layout_marginTop="12dp"
android:layout_marginStart="16dp"/>
<TextView <TextView
android:id="@+id/chapter_scanlator" android:id="@+id/chapter_scanlator"
style="@style/TextAppearance.Regular.Caption.Hint" style="@style/TextAppearance.MaterialComponents.Caption"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:text="Scanlator" android:layout_marginStart="16dp"
android:layout_marginBottom="12dp"
android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/download_button"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/chapter_title" app:layout_constraintTop_toBottomOf="@+id/chapter_title"
app:layout_constraintBottom_toTopOf="@+id/chapter_date" tools:text="3 days ago • On page 45 • Scanlator" />
app:layout_constraintEnd_toStartOf="@+id/chapter_menu"
android:layout_marginStart="16dp"/>
<TextView <include
android:id="@+id/chapter_date" layout="@layout/download_button"
style="@style/TextAppearance.Regular.Caption" android:layout_width="50dp"
android:layout_width="wrap_content" android:layout_height="0dp"
android:layout_height="wrap_content"
tools:text="22/02/2016"
android:ellipsize="marquee"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="16dp"
android:singleLine="true" />
<TextView
android:id="@+id/chapter_pages"
style="@style/TextAppearance.Regular.Caption.Hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="Pages: 45"
android:ellipsize="marquee"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:singleLine="true" />
<ImageView
android:id="@+id/chapter_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_more_vert_black_24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:paddingStart="24dp"
android:paddingEnd="16dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:paddingBottom="24dp"
android:paddingTop="12dp"
android:contentDescription="@string/description_cover"/>
<TextView
android:id="@+id/download_text"
style="@style/TextAppearance.Regular.Caption.Hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="DOWNLOADED"
android:textAllCaps="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginEnd="16dp"/> app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@ -1,103 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/chapter_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?android:attr/colorBackground">
<FrameLayout
android:id="@+id/right_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:background="@color/material_green_800"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/read"
android:layout_width="24dp"
android:layout_height="24dp"
android:tint="@color/md_white_1000"
android:layout_gravity="end|center"
android:layout_marginEnd="21dp"
android:src="@drawable/ic_read_24dp" />
</FrameLayout>
<FrameLayout
android:id="@+id/left_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:background="@color/colorAccent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/bookmark"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="start|center"
android:layout_marginStart="21dp"
android:tint="@color/md_white_1000"
android:src="@drawable/ic_bookmark_white_24dp" />
</FrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/front_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
android:background="?attr/selectable_list_drawable"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/chapter_title"
style="@style/TextAppearance.MaterialComponents.Body2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:ellipsize="end"
android:maxLines="2"
app:layout_constraintBottom_toTopOf="@id/chapter_scanlator"
app:layout_constraintEnd_toStartOf="@id/download_button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Chapter 123 - The Real One" />
<TextView
android:id="@+id/chapter_scanlator"
style="@style/TextAppearance.MaterialComponents.Caption"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginBottom="12dp"
android:ellipsize="end"
android:maxLines="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/download_button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/chapter_title"
tools:text="3 days ago • On page 45 • Scanlator" />
<include
layout="@layout/download_button"
android:layout_width="50dp"
android:layout_height="0dp"
android:layout_marginEnd="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@ -24,7 +24,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/chapters_title" app:layout_constraintTop_toBottomOf="@id/chapters_title"
tools:listitem="@layout/chapters_mat_item"/> tools:listitem="@layout/chapters_item"/>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<eu.davidea.fastscroller.FastScroller <eu.davidea.fastscroller.FastScroller
android:id="@+id/fast_scroller" android:id="@+id/fast_scroller"