mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-21 11:55:31 -04:00
universal7885: FMRadio: Don't update fav every time
This commit is contained in:
parent
13e6667cfd
commit
77d3b837f0
1 changed files with 4 additions and 5 deletions
|
|
@ -56,13 +56,12 @@ class ListViewAdapter(private val mContext: Context) : BaseAdapter() {
|
|||
)
|
||||
val mIndex = mListChannel[id]
|
||||
val mSharedPref = PreferenceManager.getDefaultSharedPreferences(mContext)
|
||||
val mBefore = mSharedPref.getBoolean("fav_$mIndex", false)
|
||||
if (mBefore) {
|
||||
it.setImageDrawable(mStar)
|
||||
} else {
|
||||
val mFav = mSharedPref.getBoolean("fav_$mIndex", false)
|
||||
if (mFav) {
|
||||
it.setImageDrawable(mStarFilled)
|
||||
} else {
|
||||
it.setImageDrawable(mStar)
|
||||
}
|
||||
mSharedPref.edit().putBoolean("fav_$mIndex", !mBefore).apply()
|
||||
}
|
||||
if (mFMInterface.mDefaultCtl.getValue(GetType.GET_TYPE_FM_FREQ) == mListChannel[id]) {
|
||||
setCurrentFMChannel(id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue