Skip to content

Commit

Permalink
Small delay to offline toggle (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sadwhy authored Feb 2, 2024
1 parent 025d311 commit c57c33c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package ani.dantotsu.settings
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import java.util.*
import kotlin.concurrent.schedule
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
Expand Down Expand Up @@ -101,6 +103,7 @@ class SettingsDialogFragment : BottomSheetDialogFragment() {

binding.settingsDownloads.isChecked = PrefManager.getVal(PrefName.OfflineMode)
binding.settingsDownloads.setOnCheckedChangeListener { _, isChecked ->
Timer().schedule(300){
when (pageType) {
PageType.MANGA -> {
val intent = Intent(activity, NoInternet::class.java)
Expand Down Expand Up @@ -151,6 +154,7 @@ class SettingsDialogFragment : BottomSheetDialogFragment() {
dismiss()
PrefManager.setVal(PrefName.OfflineMode, isChecked)
}
}
}

override fun onDestroyView() {
Expand All @@ -171,4 +175,4 @@ class SettingsDialogFragment : BottomSheetDialogFragment() {
return fragment
}
}
}
}

0 comments on commit c57c33c

Please sign in to comment.