"Include list" switch changed (#153)
* "Include list" switch change * remember the toggle state of "Include list"
This commit is contained in:
parent
627bed2407
commit
563e4f2cbe
6 changed files with 28 additions and 7 deletions
|
@ -132,8 +132,15 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
|
|||
|
||||
binding.animeIncludeList.visibility =
|
||||
if (Anilist.userid != null) View.VISIBLE else View.GONE
|
||||
|
||||
binding.animeIncludeList.isChecked = currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
|
||||
?.getBoolean("popular_list", true) ?: true
|
||||
|
||||
binding.animeIncludeList.setOnCheckedChangeListener { _, isChecked ->
|
||||
onIncludeListClick.invoke(isChecked)
|
||||
|
||||
currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)?.edit()
|
||||
?.putBoolean("popular_list", isChecked)?.apply()
|
||||
}
|
||||
if (ready.value == false)
|
||||
ready.postValue(true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue