backend preference wrapper
This commit is contained in:
parent
eb5b83564f
commit
8020b32541
66 changed files with 482 additions and 458 deletions
|
@ -11,6 +11,8 @@ import ani.dantotsu.R
|
|||
import ani.dantotsu.databinding.FragmentOfflineBinding
|
||||
import ani.dantotsu.isOnline
|
||||
import ani.dantotsu.navBarHeight
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.settings.saving.PrefWrapper
|
||||
import ani.dantotsu.startMainActivity
|
||||
import ani.dantotsu.statusBarHeight
|
||||
|
||||
|
@ -26,8 +28,7 @@ class OfflineFragment : Fragment() {
|
|||
topMargin = statusBarHeight
|
||||
bottomMargin = navBarHeight
|
||||
}
|
||||
offline = requireContext().getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
|
||||
?.getBoolean("offlineMode", false) ?: false
|
||||
offline = PrefWrapper.getVal(PrefName.OfflineMode, false)
|
||||
binding.noInternet.text =
|
||||
if (offline) "Offline Mode" else getString(R.string.no_internet)
|
||||
binding.refreshButton.visibility = if (offline) View.GONE else View.VISIBLE
|
||||
|
@ -41,7 +42,6 @@ class OfflineFragment : Fragment() {
|
|||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
offline = requireContext().getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
|
||||
?.getBoolean("offlineMode", false) ?: false
|
||||
offline = PrefWrapper.getVal(PrefName.OfflineMode, false)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue