feat(social): like button fix

This commit is contained in:
aayush262 2024-04-26 19:57:55 +05:30
parent 856deb7755
commit da456d3067
19 changed files with 223 additions and 172 deletions

View file

@ -36,18 +36,18 @@ class UserInterfaceSettingsActivity : AppCompatActivity() {
}
binding.uiSettingsHomeLayout.setOnClickListener {
val set = PrefManager.getVal<List<Boolean>>(PrefName.HomeLayoutShow).toMutableList()
val set = PrefManager.getVal<List<Boolean>>(PrefName.HomeLayout).toMutableList()
val views = resources.getStringArray(R.array.home_layouts)
val dialog = AlertDialog.Builder(this, R.style.MyPopup)
.setTitle(getString(R.string.home_layout_show)).apply {
setMultiChoiceItems(
views,
PrefManager.getVal<List<Boolean>>(PrefName.HomeLayoutShow).toBooleanArray()
PrefManager.getVal<List<Boolean>>(PrefName.HomeLayout).toBooleanArray()
) { _, i, value ->
set[i] = value
}
setPositiveButton("Done") { _, _ ->
PrefManager.setVal(PrefName.HomeLayoutShow, set)
PrefManager.setVal(PrefName.HomeLayout, set)
restartApp()
}
}.show()

View file

@ -63,11 +63,11 @@ enum class PrefName(val data: Pref) { //TODO: Split this into multiple files
ImmersiveMode(Pref(Location.UI, Boolean::class, false)),
SmallView(Pref(Location.UI, Boolean::class, true)),
DefaultStartUpTab(Pref(Location.UI, Int::class, 1)),
HomeLayoutShow(
HomeLayout(
Pref(
Location.UI,
List::class,
listOf(true, false, false, true, false, false, true)
listOf(true, false, false, true, false, false, true, true)
)
),
BannerAnimations(Pref(Location.UI, Boolean::class, true)),