mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-17 17:09:15 +01:00
* Implementing do not save chapter history preference * Refactor of labels * Changing incognito mode from Readers section to More * Fixing imports and removing unused strings
This commit is contained in:
parent
2df6a4dde8
commit
79ccfcd553
@ -179,6 +179,8 @@ object PreferenceKeys {
|
|||||||
|
|
||||||
const val defaultChapterDisplayByNameOrNumber = "default_chapter_display_by_name_or_number"
|
const val defaultChapterDisplayByNameOrNumber = "default_chapter_display_by_name_or_number"
|
||||||
|
|
||||||
|
const val incognitoMode = "incognito_mode"
|
||||||
|
|
||||||
fun trackUsername(syncId: Int) = "pref_mangasync_username_$syncId"
|
fun trackUsername(syncId: Int) = "pref_mangasync_username_$syncId"
|
||||||
|
|
||||||
fun trackPassword(syncId: Int) = "pref_mangasync_password_$syncId"
|
fun trackPassword(syncId: Int) = "pref_mangasync_password_$syncId"
|
||||||
|
@ -269,6 +269,8 @@ class PreferencesHelper(val context: Context) {
|
|||||||
|
|
||||||
fun sortChapterByAscendingOrDescending() = prefs.getInt(Keys.defaultChapterSortByAscendingOrDescending, Manga.SORT_DESC)
|
fun sortChapterByAscendingOrDescending() = prefs.getInt(Keys.defaultChapterSortByAscendingOrDescending, Manga.SORT_DESC)
|
||||||
|
|
||||||
|
fun incognitoMode() = prefs.getBoolean(Keys.incognitoMode, false)
|
||||||
|
|
||||||
fun setChapterSettingsDefault(manga: Manga) {
|
fun setChapterSettingsDefault(manga: Manga) {
|
||||||
prefs.edit {
|
prefs.edit {
|
||||||
putInt(Keys.defaultChapterFilterByRead, manga.readFilter)
|
putInt(Keys.defaultChapterFilterByRead, manga.readFilter)
|
||||||
|
@ -23,6 +23,7 @@ import eu.kanade.tachiyomi.util.preference.preferenceCategory
|
|||||||
import eu.kanade.tachiyomi.util.preference.summaryRes
|
import eu.kanade.tachiyomi.util.preference.summaryRes
|
||||||
import eu.kanade.tachiyomi.util.preference.switchPreference
|
import eu.kanade.tachiyomi.util.preference.switchPreference
|
||||||
import eu.kanade.tachiyomi.util.preference.titleRes
|
import eu.kanade.tachiyomi.util.preference.titleRes
|
||||||
|
import eu.kanade.tachiyomi.util.preference.defaultValue
|
||||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||||
import eu.kanade.tachiyomi.util.system.openInBrowser
|
import eu.kanade.tachiyomi.util.system.openInBrowser
|
||||||
import rx.android.schedulers.AndroidSchedulers
|
import rx.android.schedulers.AndroidSchedulers
|
||||||
@ -53,6 +54,15 @@ class MoreController :
|
|||||||
iconTint = tintColor
|
iconTint = tintColor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switchPreference {
|
||||||
|
key = Keys.incognitoMode
|
||||||
|
summaryRes = R.string.pref_incognito_mode_summary
|
||||||
|
titleRes = R.string.pref_incognito_mode
|
||||||
|
iconRes = R.drawable.ic_glasses_black_24dp
|
||||||
|
iconTint = tintColor
|
||||||
|
defaultValue = false
|
||||||
|
}
|
||||||
|
|
||||||
preferenceCategory {
|
preferenceCategory {
|
||||||
preference {
|
preference {
|
||||||
titleRes = R.string.label_download_queue
|
titleRes = R.string.label_download_queue
|
||||||
|
@ -409,12 +409,14 @@ class ReaderPresenter(
|
|||||||
* Saves this [chapter] last read history.
|
* Saves this [chapter] last read history.
|
||||||
*/
|
*/
|
||||||
private fun saveChapterHistory(chapter: ReaderChapter) {
|
private fun saveChapterHistory(chapter: ReaderChapter) {
|
||||||
|
if (!preferences.incognitoMode()) {
|
||||||
val history = History.create(chapter.chapter).apply { last_read = Date().time }
|
val history = History.create(chapter.chapter).apply { last_read = Date().time }
|
||||||
db.updateHistoryLastRead(history).asRxCompletable()
|
db.updateHistoryLastRead(history).asRxCompletable()
|
||||||
.onErrorComplete()
|
.onErrorComplete()
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.subscribe()
|
.subscribe()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called from the activity to preload the given [chapter].
|
* Called from the activity to preload the given [chapter].
|
||||||
|
@ -318,6 +318,8 @@
|
|||||||
<string name="webtoon_side_padding_15">15%</string>
|
<string name="webtoon_side_padding_15">15%</string>
|
||||||
<string name="webtoon_side_padding_20">20%</string>
|
<string name="webtoon_side_padding_20">20%</string>
|
||||||
<string name="webtoon_side_padding_25">25%</string>
|
<string name="webtoon_side_padding_25">25%</string>
|
||||||
|
<string name="pref_incognito_mode">Incognito mode</string>
|
||||||
|
<string name="pref_incognito_mode_summary">Disables recording history in History tab</string>
|
||||||
|
|
||||||
<!-- Downloads section -->
|
<!-- Downloads section -->
|
||||||
<string name="pref_download_directory">Download location</string>
|
<string name="pref_download_directory">Download location</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user