Small delay to offline toggle (#171)
This commit is contained in:
parent
025d31102e
commit
c57c33c088
1 changed files with 5 additions and 1 deletions
|
@ -3,6 +3,8 @@ package ani.dantotsu.settings
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import java.util.*
|
||||||
|
import kotlin.concurrent.schedule
|
||||||
import android.util.TypedValue
|
import android.util.TypedValue
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
@ -101,6 +103,7 @@ class SettingsDialogFragment : BottomSheetDialogFragment() {
|
||||||
|
|
||||||
binding.settingsDownloads.isChecked = PrefManager.getVal(PrefName.OfflineMode)
|
binding.settingsDownloads.isChecked = PrefManager.getVal(PrefName.OfflineMode)
|
||||||
binding.settingsDownloads.setOnCheckedChangeListener { _, isChecked ->
|
binding.settingsDownloads.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
Timer().schedule(300){
|
||||||
when (pageType) {
|
when (pageType) {
|
||||||
PageType.MANGA -> {
|
PageType.MANGA -> {
|
||||||
val intent = Intent(activity, NoInternet::class.java)
|
val intent = Intent(activity, NoInternet::class.java)
|
||||||
|
@ -151,6 +154,7 @@ class SettingsDialogFragment : BottomSheetDialogFragment() {
|
||||||
dismiss()
|
dismiss()
|
||||||
PrefManager.setVal(PrefName.OfflineMode, isChecked)
|
PrefManager.setVal(PrefName.OfflineMode, isChecked)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
|
@ -171,4 +175,4 @@ class SettingsDialogFragment : BottomSheetDialogFragment() {
|
||||||
return fragment
|
return fragment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue