Add continue reading button, some resources gotten from J2k
This commit is contained in:
parent
f60b29c763
commit
2f98dd2046
5
app/src/debug/res/drawable/ic_start_reading_24dp.xml
Normal file
5
app/src/debug/res/drawable/ic_start_reading_24dp.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||||
|
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="#FF000000" android:pathData="M21,5c-1.11,-0.35 -2.33,-0.5 -3.5,-0.5 -1.95,0 -4.05,0.4 -5.5,1.5 -1.45,-1.1 -3.55,-1.5 -5.5,-1.5S2.45,4.9 1,6v14.65c0,0.25 0.25,0.5 0.5,0.5 0.1,0 0.15,-0.05 0.25,-0.05C3.1,20.45 5.05,20 6.5,20c1.95,0 4.05,0.4 5.5,1.5 1.35,-0.85 3.8,-1.5 5.5,-1.5 1.65,0 3.35,0.3 4.75,1.05 0.1,0.05 0.15,0.05 0.25,0.05 0.25,0 0.5,-0.25 0.5,-0.5L23,6c-0.6,-0.45 -1.25,-0.75 -2,-1zM21,18.5c-1.1,-0.35 -2.3,-0.5 -3.5,-0.5 -1.7,0 -4.15,0.65 -5.5,1.5L12,8c1.35,-0.85 3.8,-1.5 5.5,-1.5 1.2,0 2.4,0.15 3.5,0.5v11.5z"/>
|
||||||
|
</vector>
|
24
app/src/debug/res/drawable/round_play_background.xml
Normal file
24
app/src/debug/res/drawable/round_play_background.xml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:background="#FFFF00"
|
||||||
|
android:color="?android:attr/colorAccent">
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="?android:attr/colorAccent" />
|
||||||
|
<corners android:radius="13dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item android:id="@android:id/background">
|
||||||
|
<shape
|
||||||
|
android:shape="rectangle">
|
||||||
|
<corners android:radius="16dp"/>
|
||||||
|
<size
|
||||||
|
android:height="32dp"
|
||||||
|
android:width="32dp" />
|
||||||
|
<solid android:color="#AD212121"/>
|
||||||
|
<stroke android:width="0.1dp" android:color="#EDEDED" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
@ -278,4 +278,6 @@ object PreferenceKeys {
|
|||||||
const val enhancedEHentaiView = "enhanced_e_hentai_view"
|
const val enhancedEHentaiView = "enhanced_e_hentai_view"
|
||||||
|
|
||||||
const val webtoonEnableZoomOut = "webtoon_enable_zoom_out"
|
const val webtoonEnableZoomOut = "webtoon_enable_zoom_out"
|
||||||
|
|
||||||
|
const val startReadingButton = "start_reading_button"
|
||||||
}
|
}
|
||||||
|
@ -382,4 +382,6 @@ class PreferencesHelper(val context: Context) {
|
|||||||
fun enhancedEHentaiView() = flowPrefs.getBoolean(Keys.enhancedEHentaiView, true)
|
fun enhancedEHentaiView() = flowPrefs.getBoolean(Keys.enhancedEHentaiView, true)
|
||||||
|
|
||||||
fun webtoonEnableZoomOut() = flowPrefs.getBoolean(Keys.webtoonEnableZoomOut, false)
|
fun webtoonEnableZoomOut() = flowPrefs.getBoolean(Keys.webtoonEnableZoomOut, false)
|
||||||
|
|
||||||
|
fun startReadingButton() = flowPrefs.getBoolean(Keys.startReadingButton, true)
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ import uy.kohesive.injekt.injectLazy
|
|||||||
*
|
*
|
||||||
* @param view the fragment containing this adapter.
|
* @param view the fragment containing this adapter.
|
||||||
*/
|
*/
|
||||||
class LibraryCategoryAdapter(view: LibraryCategoryView) :
|
class LibraryCategoryAdapter(view: LibraryCategoryView, val controller: LibraryController) :
|
||||||
FlexibleAdapter<LibraryItem>(null, view, true) {
|
FlexibleAdapter<LibraryItem>(null, view, true) {
|
||||||
// EXH -->
|
// EXH -->
|
||||||
private val db: DatabaseHelper by injectLazy()
|
private val db: DatabaseHelper by injectLazy()
|
||||||
@ -61,6 +61,8 @@ class LibraryCategoryAdapter(view: LibraryCategoryView) :
|
|||||||
*/
|
*/
|
||||||
private var mangas: List<LibraryItem> = emptyList()
|
private var mangas: List<LibraryItem> = emptyList()
|
||||||
|
|
||||||
|
val libraryListener: LibraryListener = controller
|
||||||
|
|
||||||
// SY -->
|
// SY -->
|
||||||
val onItemReleaseListener: CategoryAdapter.OnItemReleaseListener = view
|
val onItemReleaseListener: CategoryAdapter.OnItemReleaseListener = view
|
||||||
// SY <--
|
// SY <--
|
||||||
@ -226,5 +228,9 @@ class LibraryCategoryAdapter(view: LibraryCategoryView) :
|
|||||||
return@any false
|
return@any false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface LibraryListener {
|
||||||
|
fun startReading(manga: Manga, adapter: LibraryCategoryAdapter)
|
||||||
|
}
|
||||||
// EXH <--
|
// EXH <--
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter = LibraryCategoryAdapter(this)
|
adapter = LibraryCategoryAdapter(this, controller)
|
||||||
|
|
||||||
recycler.setHasFixedSize(true)
|
recycler.setHasFixedSize(true)
|
||||||
recycler.adapter = adapter
|
recycler.adapter = adapter
|
||||||
|
@ -13,9 +13,13 @@ import kotlinx.android.synthetic.main.source_comfortable_grid_item.badges
|
|||||||
import kotlinx.android.synthetic.main.source_comfortable_grid_item.card
|
import kotlinx.android.synthetic.main.source_comfortable_grid_item.card
|
||||||
import kotlinx.android.synthetic.main.source_comfortable_grid_item.download_text
|
import kotlinx.android.synthetic.main.source_comfortable_grid_item.download_text
|
||||||
import kotlinx.android.synthetic.main.source_comfortable_grid_item.local_text
|
import kotlinx.android.synthetic.main.source_comfortable_grid_item.local_text
|
||||||
|
import kotlinx.android.synthetic.main.source_comfortable_grid_item.play_layout
|
||||||
import kotlinx.android.synthetic.main.source_comfortable_grid_item.thumbnail
|
import kotlinx.android.synthetic.main.source_comfortable_grid_item.thumbnail
|
||||||
import kotlinx.android.synthetic.main.source_comfortable_grid_item.title
|
import kotlinx.android.synthetic.main.source_comfortable_grid_item.title
|
||||||
import kotlinx.android.synthetic.main.source_comfortable_grid_item.unread_text
|
import kotlinx.android.synthetic.main.source_comfortable_grid_item.unread_text
|
||||||
|
import kotlinx.coroutines.flow.launchIn
|
||||||
|
import kotlinx.coroutines.flow.onEach
|
||||||
|
import reactivecircus.flowbinding.android.view.clicks
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class used to hold the displayed data of a manga in the library, like the cover or the title.
|
* Class used to hold the displayed data of a manga in the library, like the cover or the title.
|
||||||
@ -31,6 +35,16 @@ class LibraryComfortableGridHolder(
|
|||||||
adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>
|
adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>
|
||||||
) : LibraryCompactGridHolder(view, adapter) {
|
) : LibraryCompactGridHolder(view, adapter) {
|
||||||
|
|
||||||
|
// SY -->
|
||||||
|
init {
|
||||||
|
play_layout.clicks()
|
||||||
|
.onEach {
|
||||||
|
playButtonClicked()
|
||||||
|
}
|
||||||
|
.launchIn((adapter as LibraryCategoryAdapter).controller.scope)
|
||||||
|
}
|
||||||
|
// SY <--
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method called from [LibraryCategoryAdapter.onBindViewHolder]. It updates the data for this
|
* Method called from [LibraryCategoryAdapter.onBindViewHolder]. It updates the data for this
|
||||||
* holder with the given manga.
|
* holder with the given manga.
|
||||||
@ -38,6 +52,9 @@ class LibraryComfortableGridHolder(
|
|||||||
* @param item the manga item to bind.
|
* @param item the manga item to bind.
|
||||||
*/
|
*/
|
||||||
override fun onSetValues(item: LibraryItem) {
|
override fun onSetValues(item: LibraryItem) {
|
||||||
|
// SY -->
|
||||||
|
manga = item.manga
|
||||||
|
// SY <--
|
||||||
// Update the title of the manga.
|
// Update the title of the manga.
|
||||||
title.text = item.manga.title
|
title.text = item.manga.title
|
||||||
|
|
||||||
@ -57,6 +74,10 @@ class LibraryComfortableGridHolder(
|
|||||||
// set local visibility if its local manga
|
// set local visibility if its local manga
|
||||||
local_text.isVisible = item.manga.isLocal()
|
local_text.isVisible = item.manga.isLocal()
|
||||||
|
|
||||||
|
// SY -->
|
||||||
|
play_layout.isVisible = (item.manga.unread > 0 && item.startReadingButton)
|
||||||
|
// SY <--
|
||||||
|
|
||||||
// For rounded corners
|
// For rounded corners
|
||||||
card.clipToOutline = true
|
card.clipToOutline = true
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import androidx.recyclerview.widget.RecyclerView
|
|||||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||||
import eu.davidea.flexibleadapter.FlexibleAdapter
|
import eu.davidea.flexibleadapter.FlexibleAdapter
|
||||||
import eu.davidea.flexibleadapter.items.IFlexible
|
import eu.davidea.flexibleadapter.items.IFlexible
|
||||||
|
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||||
import eu.kanade.tachiyomi.data.glide.GlideApp
|
import eu.kanade.tachiyomi.data.glide.GlideApp
|
||||||
import eu.kanade.tachiyomi.data.glide.toMangaThumbnail
|
import eu.kanade.tachiyomi.data.glide.toMangaThumbnail
|
||||||
import eu.kanade.tachiyomi.util.isLocal
|
import eu.kanade.tachiyomi.util.isLocal
|
||||||
@ -13,9 +14,13 @@ import kotlinx.android.synthetic.main.source_compact_grid_item.badges
|
|||||||
import kotlinx.android.synthetic.main.source_compact_grid_item.card
|
import kotlinx.android.synthetic.main.source_compact_grid_item.card
|
||||||
import kotlinx.android.synthetic.main.source_compact_grid_item.download_text
|
import kotlinx.android.synthetic.main.source_compact_grid_item.download_text
|
||||||
import kotlinx.android.synthetic.main.source_compact_grid_item.local_text
|
import kotlinx.android.synthetic.main.source_compact_grid_item.local_text
|
||||||
|
import kotlinx.android.synthetic.main.source_compact_grid_item.play_layout
|
||||||
import kotlinx.android.synthetic.main.source_compact_grid_item.thumbnail
|
import kotlinx.android.synthetic.main.source_compact_grid_item.thumbnail
|
||||||
import kotlinx.android.synthetic.main.source_compact_grid_item.title
|
import kotlinx.android.synthetic.main.source_compact_grid_item.title
|
||||||
import kotlinx.android.synthetic.main.source_compact_grid_item.unread_text
|
import kotlinx.android.synthetic.main.source_compact_grid_item.unread_text
|
||||||
|
import kotlinx.coroutines.flow.launchIn
|
||||||
|
import kotlinx.coroutines.flow.onEach
|
||||||
|
import reactivecircus.flowbinding.android.view.clicks
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class used to hold the displayed data of a manga in the library, like the cover or the title.
|
* Class used to hold the displayed data of a manga in the library, like the cover or the title.
|
||||||
@ -33,6 +38,18 @@ open class LibraryCompactGridHolder(
|
|||||||
// SY <--
|
// SY <--
|
||||||
) : LibraryHolder(view, adapter) {
|
) : LibraryHolder(view, adapter) {
|
||||||
|
|
||||||
|
var manga: Manga? = null
|
||||||
|
|
||||||
|
// SY -->
|
||||||
|
init {
|
||||||
|
play_layout.clicks()
|
||||||
|
.onEach {
|
||||||
|
playButtonClicked()
|
||||||
|
}
|
||||||
|
.launchIn((adapter as LibraryCategoryAdapter).controller.scope)
|
||||||
|
}
|
||||||
|
// SY <--
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method called from [LibraryCategoryAdapter.onBindViewHolder]. It updates the data for this
|
* Method called from [LibraryCategoryAdapter.onBindViewHolder]. It updates the data for this
|
||||||
* holder with the given manga.
|
* holder with the given manga.
|
||||||
@ -40,6 +57,9 @@ open class LibraryCompactGridHolder(
|
|||||||
* @param item the manga item to bind.
|
* @param item the manga item to bind.
|
||||||
*/
|
*/
|
||||||
override fun onSetValues(item: LibraryItem) {
|
override fun onSetValues(item: LibraryItem) {
|
||||||
|
// SY -->
|
||||||
|
manga = item.manga
|
||||||
|
// SY <--
|
||||||
// Update the title of the manga.
|
// Update the title of the manga.
|
||||||
title.text = item.manga.title
|
title.text = item.manga.title
|
||||||
|
|
||||||
@ -59,6 +79,10 @@ open class LibraryCompactGridHolder(
|
|||||||
// set local visibility if its local manga
|
// set local visibility if its local manga
|
||||||
local_text.isVisible = item.manga.isLocal()
|
local_text.isVisible = item.manga.isLocal()
|
||||||
|
|
||||||
|
// SY -->
|
||||||
|
play_layout.isVisible = (item.manga.unread > 0 && item.startReadingButton)
|
||||||
|
// SY <--
|
||||||
|
|
||||||
// For rounded corners
|
// For rounded corners
|
||||||
card.clipToOutline = true
|
card.clipToOutline = true
|
||||||
|
|
||||||
@ -71,4 +95,10 @@ open class LibraryCompactGridHolder(
|
|||||||
.dontAnimate()
|
.dontAnimate()
|
||||||
.into(thumbnail)
|
.into(thumbnail)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SY -->
|
||||||
|
fun playButtonClicked() {
|
||||||
|
manga?.let { (adapter as LibraryCategoryAdapter).controller.startReading(it, (adapter as LibraryCategoryAdapter)) }
|
||||||
|
}
|
||||||
|
// SY <--
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ import com.google.android.material.tabs.TabLayout
|
|||||||
import com.jakewharton.rxrelay.BehaviorRelay
|
import com.jakewharton.rxrelay.BehaviorRelay
|
||||||
import com.jakewharton.rxrelay.PublishRelay
|
import com.jakewharton.rxrelay.PublishRelay
|
||||||
import com.tfcporciuncula.flow.Preference
|
import com.tfcporciuncula.flow.Preference
|
||||||
|
import eu.davidea.flexibleadapter.SelectableAdapter
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
import eu.kanade.tachiyomi.data.database.models.Category
|
import eu.kanade.tachiyomi.data.database.models.Category
|
||||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||||
@ -39,6 +40,7 @@ import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchController
|
|||||||
import eu.kanade.tachiyomi.ui.main.MainActivity
|
import eu.kanade.tachiyomi.ui.main.MainActivity
|
||||||
import eu.kanade.tachiyomi.ui.main.offsetAppbarHeight
|
import eu.kanade.tachiyomi.ui.main.offsetAppbarHeight
|
||||||
import eu.kanade.tachiyomi.ui.manga.MangaController
|
import eu.kanade.tachiyomi.ui.manga.MangaController
|
||||||
|
import eu.kanade.tachiyomi.ui.reader.ReaderActivity
|
||||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||||
import eu.kanade.tachiyomi.util.system.toast
|
import eu.kanade.tachiyomi.util.system.toast
|
||||||
import exh.EH_SOURCE_ID
|
import exh.EH_SOURCE_ID
|
||||||
@ -69,7 +71,8 @@ class LibraryController(
|
|||||||
TabbedController,
|
TabbedController,
|
||||||
ActionMode.Callback,
|
ActionMode.Callback,
|
||||||
ChangeMangaCategoriesDialog.Listener,
|
ChangeMangaCategoriesDialog.Listener,
|
||||||
DeleteLibraryMangasDialog.Listener {
|
DeleteLibraryMangasDialog.Listener,
|
||||||
|
LibraryCategoryAdapter.LibraryListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Position of the active category.
|
* Position of the active category.
|
||||||
@ -792,5 +795,17 @@ class LibraryController(
|
|||||||
}
|
}
|
||||||
oldSyncStatus = status
|
oldSyncStatus = status
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun startReading(manga: Manga, adapter: LibraryCategoryAdapter) {
|
||||||
|
if (adapter.mode == SelectableAdapter.Mode.MULTI) {
|
||||||
|
toggleSelection(manga)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val activity = activity ?: return
|
||||||
|
val chapter = presenter.getFirstUnread(manga) ?: return
|
||||||
|
val intent = ReaderActivity.newIntent(activity, manga, chapter)
|
||||||
|
destroyActionModeIfNeeded()
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
// <-- EXH
|
// <-- EXH
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,10 @@ class LibraryItem(val manga: LibraryManga, private val libraryDisplayMode: Prefe
|
|||||||
var downloadCount = -1
|
var downloadCount = -1
|
||||||
var unreadCount = -1
|
var unreadCount = -1
|
||||||
|
|
||||||
|
// SY -->
|
||||||
|
var startReadingButton = false
|
||||||
|
// SY <--
|
||||||
|
|
||||||
override fun getLayoutRes(): Int {
|
override fun getLayoutRes(): Int {
|
||||||
return when (libraryDisplayMode.get()) {
|
return when (libraryDisplayMode.get()) {
|
||||||
DisplayMode.COMPACT_GRID -> R.layout.source_compact_grid_item
|
DisplayMode.COMPACT_GRID -> R.layout.source_compact_grid_item
|
||||||
|
@ -5,6 +5,7 @@ import com.jakewharton.rxrelay.BehaviorRelay
|
|||||||
import eu.kanade.tachiyomi.data.cache.CoverCache
|
import eu.kanade.tachiyomi.data.cache.CoverCache
|
||||||
import eu.kanade.tachiyomi.data.database.DatabaseHelper
|
import eu.kanade.tachiyomi.data.database.DatabaseHelper
|
||||||
import eu.kanade.tachiyomi.data.database.models.Category
|
import eu.kanade.tachiyomi.data.database.models.Category
|
||||||
|
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.database.models.MangaCategory
|
import eu.kanade.tachiyomi.data.database.models.MangaCategory
|
||||||
import eu.kanade.tachiyomi.data.download.DownloadManager
|
import eu.kanade.tachiyomi.data.download.DownloadManager
|
||||||
@ -181,6 +182,7 @@ class LibraryPresenter(
|
|||||||
private fun setBadges(map: LibraryMap) {
|
private fun setBadges(map: LibraryMap) {
|
||||||
val showDownloadBadges = preferences.downloadBadge().get()
|
val showDownloadBadges = preferences.downloadBadge().get()
|
||||||
val showUnreadBadges = preferences.unreadBadge().get()
|
val showUnreadBadges = preferences.unreadBadge().get()
|
||||||
|
val startReadingButton = preferences.startReadingButton().get()
|
||||||
|
|
||||||
for ((_, itemList) in map) {
|
for ((_, itemList) in map) {
|
||||||
for (item in itemList) {
|
for (item in itemList) {
|
||||||
@ -197,6 +199,10 @@ class LibraryPresenter(
|
|||||||
// Unset unread count if not enabled
|
// Unset unread count if not enabled
|
||||||
-1
|
-1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SY -->
|
||||||
|
item.startReadingButton = startReadingButton
|
||||||
|
// SY <--
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -443,4 +449,17 @@ class LibraryPresenter(
|
|||||||
|
|
||||||
db.setMangaCategories(mc, mangas)
|
db.setMangaCategories(mc, mangas)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SY -->
|
||||||
|
/** Returns first unread chapter of a manga */
|
||||||
|
fun getFirstUnread(manga: Manga): Chapter? {
|
||||||
|
val chapters = db.getChapters(manga).executeAsBlocking()
|
||||||
|
return if (manga.source == EH_SOURCE_ID || manga.source == EXH_SOURCE_ID) {
|
||||||
|
val chapter = chapters.sortedBy { it.source_order }.getOrNull(0)
|
||||||
|
if (chapter?.read == false) chapter else null
|
||||||
|
} else {
|
||||||
|
chapters.sortedByDescending { it.source_order }.find { !it.read }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// SY <--
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,7 @@ class LibrarySettingsSheet(
|
|||||||
Settings(context, attrs) {
|
Settings(context, attrs) {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
setGroups(listOf(DisplayGroup(), BadgeGroup(), TabsGroup()))
|
setGroups(listOf(DisplayGroup(), BadgeGroup(), /* SY --> */ ButtonsGroup(), /* SY <-- */ TabsGroup()))
|
||||||
}
|
}
|
||||||
|
|
||||||
inner class DisplayGroup : Group {
|
inner class DisplayGroup : Group {
|
||||||
@ -300,6 +300,29 @@ class LibrarySettingsSheet(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SY -->
|
||||||
|
inner class ButtonsGroup : Group {
|
||||||
|
private val startReadingButton = Item.CheckboxGroup(R.string.action_start_reading_button, this)
|
||||||
|
|
||||||
|
override val header = Item.Header(R.string.buttons_header)
|
||||||
|
override val items = listOf(startReadingButton)
|
||||||
|
override val footer = null
|
||||||
|
|
||||||
|
override fun initModels() {
|
||||||
|
startReadingButton.checked = preferences.startReadingButton().get()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onItemClicked(item: Item) {
|
||||||
|
item as Item.CheckboxGroup
|
||||||
|
item.checked = !item.checked
|
||||||
|
when (item) {
|
||||||
|
startReadingButton -> preferences.startReadingButton().set((item.checked))
|
||||||
|
}
|
||||||
|
adapter.notifyItemChanged(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// SY <--
|
||||||
|
|
||||||
inner class TabsGroup : Group {
|
inner class TabsGroup : Group {
|
||||||
private val showTabs = Item.CheckboxGroup(R.string.action_display_show_tabs, this)
|
private val showTabs = Item.CheckboxGroup(R.string.action_display_show_tabs, this)
|
||||||
|
|
||||||
|
@ -28,6 +28,32 @@
|
|||||||
tools:ignore="ContentDescription"
|
tools:ignore="ContentDescription"
|
||||||
tools:src="@mipmap/ic_launcher" />
|
tools:src="@mipmap/ic_launcher" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/play_layout"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/play_button"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:layout_marginEnd="6dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:layout_marginBottom="6dp"
|
||||||
|
android:background="@drawable/round_play_background"
|
||||||
|
android:contentDescription="@string/start_reading"
|
||||||
|
android:padding="6dp"
|
||||||
|
android:src="@drawable/ic_start_reading_24dp"
|
||||||
|
android:tint="@android:color/white" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/badges"
|
android:id="@+id/badges"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -28,6 +28,32 @@
|
|||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:background="@drawable/gradient_shape" />
|
android:background="@drawable/gradient_shape" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/play_layout"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/play_button"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:layout_marginEnd="6dp"
|
||||||
|
android:layout_marginStart="6dp"
|
||||||
|
android:layout_marginBottom="6dp"
|
||||||
|
android:background="@drawable/round_play_background"
|
||||||
|
android:contentDescription="@string/start_reading"
|
||||||
|
android:padding="6dp"
|
||||||
|
android:src="@drawable/ic_start_reading_24dp"
|
||||||
|
android:tint="@android:color/white" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/badges"
|
android:id="@+id/badges"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -14,6 +14,10 @@
|
|||||||
<string name="action_migrate_now">Migrate now</string>
|
<string name="action_migrate_now">Migrate now</string>
|
||||||
<string name="action_copy_now">Copy now</string>
|
<string name="action_copy_now">Copy now</string>
|
||||||
<string name="clean_titles">Clean titles</string>
|
<string name="clean_titles">Clean titles</string>
|
||||||
|
<string name="action_start_reading_button">Start reading button</string>
|
||||||
|
|
||||||
|
<!-- Library fragment -->
|
||||||
|
<string name="buttons_header">Buttons</string>
|
||||||
|
|
||||||
<!-- Manga Type -->
|
<!-- Manga Type -->
|
||||||
<string name="manhwa">Manhwa</string>
|
<string name="manhwa">Manhwa</string>
|
||||||
@ -437,6 +441,7 @@
|
|||||||
<string name="rating_view">%1$s (%2$s, %3$d)</string>
|
<string name="rating_view">%1$s (%2$s, %3$d)</string>
|
||||||
<string name="rating_view_no_count">%1$s (%2$s)</string>
|
<string name="rating_view_no_count">%1$s (%2$s)</string>
|
||||||
<string name="language_translated">%1$s TR</string>
|
<string name="language_translated">%1$s TR</string>
|
||||||
|
<string name="start_reading">Start reading</string>
|
||||||
|
|
||||||
<!-- Enhanced E/ExHentai Browse View -->
|
<!-- Enhanced E/ExHentai Browse View -->
|
||||||
<plurals name="browse_language_and_pages">
|
<plurals name="browse_language_and_pages">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user