Browse Source

We failed to remove bold typeface for non-currently playing tracks when recycling views. This is fixed.

housekeeping/remove-warnings
Antoine POPINEAU 5 years ago
parent
commit
98b7812a47
No known key found for this signature in database
GPG Key ID: A78AC64694F84063
  1. 7
      app/src/main/java/com/github/apognu/otter/adapters/FavoritesAdapter.kt
  2. 2
      app/src/main/java/com/github/apognu/otter/adapters/PlaylistTracksAdapter.kt
  3. 4
      app/src/main/java/com/github/apognu/otter/adapters/TracksAdapter.kt

7
app/src/main/java/com/github/apognu/otter/adapters/FavoritesAdapter.kt

@ -59,12 +59,11 @@ class FavoritesAdapter(private val context: Context?, private val favoriteListen @@ -59,12 +59,11 @@ class FavoritesAdapter(private val context: Context?, private val favoriteListen
holder.artist.setTypeface(holder.artist.typeface, Typeface.DEFAULT.weight)
},
{
holder.title.setTypeface(holder.title.typeface, Typeface.NORMAL)
holder.artist.setTypeface(holder.artist.typeface, Typeface.NORMAL)
holder.title.typeface = Typeface.create(holder.title.typeface, Typeface.NORMAL)
holder.artist.typeface = Typeface.create(holder.artist.typeface, Typeface.NORMAL)
})
if (favorite == currentTrack || favorite.current) {
if (favorite.id == currentTrack?.id) {
holder.title.setTypeface(holder.title.typeface, Typeface.BOLD)
holder.artist.setTypeface(holder.artist.typeface, Typeface.BOLD)
}

2
app/src/main/java/com/github/apognu/otter/adapters/PlaylistTracksAdapter.kt

@ -76,7 +76,7 @@ class PlaylistTracksAdapter(private val context: Context?, private val favoriteL @@ -76,7 +76,7 @@ class PlaylistTracksAdapter(private val context: Context?, private val favoriteL
})
if (track.track == currentTrack || track.track.current) {
if (track.track == currentTrack) {
holder.title.setTypeface(holder.title.typeface, Typeface.BOLD)
holder.artist.setTypeface(holder.artist.typeface, Typeface.BOLD)
}

4
app/src/main/java/com/github/apognu/otter/adapters/TracksAdapter.kt

@ -70,8 +70,8 @@ class TracksAdapter(private val context: Context?, private val favoriteListener: @@ -70,8 +70,8 @@ class TracksAdapter(private val context: Context?, private val favoriteListener:
holder.artist.setTypeface(holder.artist.typeface, Typeface.DEFAULT.weight)
},
{
holder.title.setTypeface(holder.title.typeface, Typeface.NORMAL)
holder.artist.setTypeface(holder.artist.typeface, Typeface.NORMAL)
holder.title.typeface = Typeface.create(holder.title.typeface, Typeface.NORMAL)
holder.artist.typeface = Typeface.create(holder.artist.typeface, Typeface.NORMAL)
})

Loading…
Cancel
Save