mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 06:17:57 +01:00 
			
		
		
		
	Move NSFW source setting into Browse settings
This commit is contained in:
		| @@ -65,12 +65,7 @@ class BackupNotifier(private val context: Context) { | ||||
|  | ||||
|         with(completeNotificationBuilder) { | ||||
|             setContentTitle(context.getString(R.string.backup_created)) | ||||
|  | ||||
|             if (unifile.filePath != null) { | ||||
|                 setContentText(unifile.filePath) | ||||
|             } else { | ||||
|                 setContentText(unifile.name) | ||||
|             } | ||||
|             setContentText(unifile.filePath ?: unifile.name) | ||||
|  | ||||
|             // Clear old actions if they exist | ||||
|             if (mActions.isNotEmpty()) { | ||||
|   | ||||
| @@ -2,8 +2,12 @@ package eu.kanade.tachiyomi.ui.setting | ||||
|  | ||||
| import androidx.preference.PreferenceScreen | ||||
| import eu.kanade.tachiyomi.R | ||||
| import eu.kanade.tachiyomi.data.preference.PreferenceValues | ||||
| import eu.kanade.tachiyomi.extension.ExtensionUpdateJob | ||||
| import eu.kanade.tachiyomi.util.preference.defaultValue | ||||
| import eu.kanade.tachiyomi.util.preference.entriesRes | ||||
| import eu.kanade.tachiyomi.util.preference.infoPreference | ||||
| import eu.kanade.tachiyomi.util.preference.listPreference | ||||
| import eu.kanade.tachiyomi.util.preference.onChange | ||||
| import eu.kanade.tachiyomi.util.preference.preferenceCategory | ||||
| import eu.kanade.tachiyomi.util.preference.switchPreference | ||||
| @@ -40,5 +44,28 @@ class SettingsBrowseController : SettingsController() { | ||||
|                 defaultValue = false | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         preferenceCategory { | ||||
|             titleRes = R.string.pref_category_nsfw_content | ||||
|  | ||||
|             listPreference { | ||||
|                 key = Keys.allowNsfwSource | ||||
|                 titleRes = R.string.pref_allow_nsfw_sources | ||||
|                 entriesRes = arrayOf( | ||||
|                     R.string.pref_allow_nsfw_sources_allowed, | ||||
|                     R.string.pref_allow_nsfw_sources_allowed_multisource, | ||||
|                     R.string.pref_allow_nsfw_sources_blocked | ||||
|                 ) | ||||
|                 entryValues = arrayOf( | ||||
|                     PreferenceValues.NsfwAllowance.ALLOWED.name, | ||||
|                     PreferenceValues.NsfwAllowance.PARTIAL.name, | ||||
|                     PreferenceValues.NsfwAllowance.BLOCKED.name | ||||
|                 ) | ||||
|                 defaultValue = PreferenceValues.NsfwAllowance.ALLOWED.name | ||||
|                 summary = "%s" | ||||
|             } | ||||
|  | ||||
|             infoPreference(R.string.parental_controls_info) | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -70,12 +70,6 @@ class SettingsMainController : SettingsController() { | ||||
|             titleRes = R.string.pref_category_security | ||||
|             onClick { navigateTo(SettingsSecurityController()) } | ||||
|         } | ||||
|         preference { | ||||
|             iconRes = R.drawable.ic_outline_people_alt_24dp | ||||
|             iconTint = tintColor | ||||
|             titleRes = R.string.pref_category_parental_controls | ||||
|             onClick { navigateTo(SettingsParentalControlsController()) } | ||||
|         } | ||||
|         preference { | ||||
|             iconRes = R.drawable.ic_code_24dp | ||||
|             iconTint = tintColor | ||||
|   | ||||
| @@ -1,40 +0,0 @@ | ||||
| package eu.kanade.tachiyomi.ui.setting | ||||
|  | ||||
| import androidx.preference.PreferenceScreen | ||||
| import eu.kanade.tachiyomi.R | ||||
| import eu.kanade.tachiyomi.util.preference.defaultValue | ||||
| import eu.kanade.tachiyomi.util.preference.entriesRes | ||||
| import eu.kanade.tachiyomi.util.preference.infoPreference | ||||
| import eu.kanade.tachiyomi.util.preference.listPreference | ||||
| import eu.kanade.tachiyomi.util.preference.preferenceCategory | ||||
| import eu.kanade.tachiyomi.util.preference.titleRes | ||||
| import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys | ||||
| import eu.kanade.tachiyomi.data.preference.PreferenceValues as Values | ||||
|  | ||||
| class SettingsParentalControlsController : SettingsController() { | ||||
|  | ||||
|     override fun setupPreferenceScreen(screen: PreferenceScreen) = screen.apply { | ||||
|         titleRes = R.string.pref_category_parental_controls | ||||
|  | ||||
|         listPreference { | ||||
|             key = Keys.allowNsfwSource | ||||
|             titleRes = R.string.pref_allow_nsfw_sources | ||||
|             entriesRes = arrayOf( | ||||
|                 R.string.pref_allow_nsfw_sources_allowed, | ||||
|                 R.string.pref_allow_nsfw_sources_allowed_multisource, | ||||
|                 R.string.pref_allow_nsfw_sources_blocked | ||||
|             ) | ||||
|             entryValues = arrayOf( | ||||
|                 Values.NsfwAllowance.ALLOWED.name, | ||||
|                 Values.NsfwAllowance.PARTIAL.name, | ||||
|                 Values.NsfwAllowance.BLOCKED.name | ||||
|             ) | ||||
|             defaultValue = Values.NsfwAllowance.ALLOWED.name | ||||
|             summary = "%s" | ||||
|         } | ||||
|  | ||||
|         preferenceCategory { | ||||
|             infoPreference(R.string.parental_controls_info) | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -14,7 +14,6 @@ import eu.kanade.tachiyomi.ui.setting.SettingsController | ||||
| import eu.kanade.tachiyomi.ui.setting.SettingsDownloadController | ||||
| import eu.kanade.tachiyomi.ui.setting.SettingsGeneralController | ||||
| import eu.kanade.tachiyomi.ui.setting.SettingsLibraryController | ||||
| import eu.kanade.tachiyomi.ui.setting.SettingsParentalControlsController | ||||
| import eu.kanade.tachiyomi.ui.setting.SettingsReaderController | ||||
| import eu.kanade.tachiyomi.ui.setting.SettingsSecurityController | ||||
| import eu.kanade.tachiyomi.ui.setting.SettingsTrackingController | ||||
| @@ -36,7 +35,6 @@ object SettingsSearchHelper { | ||||
|         SettingsDownloadController::class, | ||||
|         SettingsGeneralController::class, | ||||
|         SettingsLibraryController::class, | ||||
|         SettingsParentalControlsController::class, | ||||
|         SettingsReaderController::class, | ||||
|         SettingsSecurityController::class, | ||||
|         SettingsTrackingController::class | ||||
|   | ||||
		Reference in New Issue
	
	Block a user