Added a option to toggle fast forward / Added NSFW extension toggle to extension settings (#48)
* Remove 18+ extension if Anilist 18+ is off ~requested by @arif * Translation filter for extension(WIP) * Added a option to toggle fast forward suggested by arif * Added NFSW toggle to extension settings now it will be more easy rather then going to anilist to toggle it ~suggested by arif * Forgot to undo this * changed icons in extension setting * get rid of companion object (todo) * get rid of companion object (todo) --------- Co-authored-by: rebelonion <87634197+rebelonion@users.noreply.github.com>
This commit is contained in:
parent
5543d29317
commit
736b06bdbe
23 changed files with 192 additions and 55 deletions
|
@ -50,6 +50,11 @@ class SettingsActivity : AppCompatActivity() {
|
|||
private val restartMainActivity = object : OnBackPressedCallback(false) {
|
||||
override fun handleOnBackPressed() = startMainActivity(this@SettingsActivity)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@Volatile
|
||||
var isNsfwEnabled: Boolean = loadData("NFSWExtension") ?: false
|
||||
}
|
||||
lateinit var binding: ActivitySettingsBinding
|
||||
private val extensionInstaller = Injekt.get<BasePreferences>().extensionInstaller()
|
||||
private val networkPreferences = Injekt.get<NetworkPreferences>()
|
||||
|
@ -167,6 +172,12 @@ OS Version: $CODENAME $RELEASE ($SDK_INT)
|
|||
binding.skipExtensionIcons.setOnCheckedChangeListener { _, isChecked ->
|
||||
saveData("skip_extension_icons", isChecked)
|
||||
}
|
||||
binding.NSFWExtension.isChecked = loadData("NFSWExtension") ?: false
|
||||
binding.NSFWExtension.setOnCheckedChangeListener { _, isChecked ->
|
||||
isNsfwEnabled = isChecked
|
||||
saveData("NFSWExtension", isChecked)
|
||||
|
||||
}
|
||||
|
||||
binding.userAgent.setText(networkPreferences.defaultUserAgent().get())
|
||||
binding.userAgent.setOnEditorActionListener { _, _, _ ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue