Add Ko-Fi credits to settings

This commit is contained in:
Billy Laws 2022-10-23 21:04:10 +01:00
parent 128ea33073
commit 160c2f3457
2 changed files with 15 additions and 0 deletions

View File

@ -12,6 +12,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.preference.CheckBoxPreference
import androidx.preference.Preference
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat
import emu.skyline.databinding.SettingsActivityBinding
import emu.skyline.preference.IntegerListPreference
@ -96,6 +97,13 @@ class SettingsActivity : AppCompatActivity() {
@Suppress("SENSELESS_COMPARISON")
if (BuildConfig.BUILD_TYPE != "release")
findPreference<Preference>("category_debug")?.isVisible = true
resources.getStringArray(R.array.credits_entries).asIterable().shuffled().forEach {
findPreference<PreferenceCategory>("category_credits")?.addPreference(Preference(context!!).apply {
title = it
})
}
}
override fun onDisplayPreferenceDialog(preference : Preference) {

View File

@ -90,4 +90,11 @@
<item>0</item>
<item>8</item>
</integer-array>
<string-array name="credits_entries">
<item>j0hnnybrav0</item>
<item>Ell Jensen</item>
<item>Pete y los Androides</item>
<item>ArkSource</item>
<item>程家小将</item>
</string-array>
</resources>