#95: Remember scroll positions in list views
This commit is contained in:
parent
81dea70ebe
commit
898d2b437b
|
@ -19,6 +19,10 @@ class AlbumsAdapter(
|
|||
private val listener: OnAlbumClickListener
|
||||
) : FFAAdapter<Album, AlbumsAdapter.ViewHolder>() {
|
||||
|
||||
init {
|
||||
this.stateRestorationPolicy = StateRestorationPolicy.PREVENT_WHEN_EMPTY
|
||||
}
|
||||
|
||||
interface OnAlbumClickListener {
|
||||
fun onClick(view: View?, album: Album)
|
||||
}
|
||||
|
|
|
@ -42,6 +42,8 @@ class ArtistsAdapter(
|
|||
super.onItemRangeInserted(positionStart, itemCount)
|
||||
}
|
||||
})
|
||||
|
||||
this.stateRestorationPolicy = StateRestorationPolicy.PREVENT_WHEN_EMPTY
|
||||
}
|
||||
|
||||
override fun getItemCount() = active.size
|
||||
|
|
|
@ -30,6 +30,10 @@ class FavoritesAdapter(
|
|||
val fromQueue: Boolean = false
|
||||
) : FFAAdapter<Track, FavoritesAdapter.ViewHolder>() {
|
||||
|
||||
init {
|
||||
this.stateRestorationPolicy = StateRestorationPolicy.PREVENT_WHEN_EMPTY
|
||||
}
|
||||
|
||||
interface OnFavoriteListener {
|
||||
fun onToggleFavorite(id: Int, state: Boolean)
|
||||
}
|
||||
|
|
|
@ -20,6 +20,10 @@ class PlaylistsAdapter(
|
|||
private val listener: OnPlaylistClickListener
|
||||
) : FFAAdapter<Playlist, PlaylistsAdapter.ViewHolder>() {
|
||||
|
||||
init {
|
||||
this.stateRestorationPolicy = StateRestorationPolicy.PREVENT_WHEN_EMPTY
|
||||
}
|
||||
|
||||
interface OnPlaylistClickListener {
|
||||
fun onClick(holder: View?, playlist: Playlist)
|
||||
}
|
||||
|
|
|
@ -27,6 +27,10 @@ class RadiosAdapter(
|
|||
private val listener: OnRadioClickListener
|
||||
) : FFAAdapter<Radio, RadiosAdapter.ViewHolder>() {
|
||||
|
||||
init {
|
||||
this.stateRestorationPolicy = StateRestorationPolicy.PREVENT_WHEN_EMPTY
|
||||
}
|
||||
|
||||
interface OnRadioClickListener {
|
||||
fun onClick(holder: RowRadioViewHolder, radio: Radio)
|
||||
}
|
||||
|
|
|
@ -35,6 +35,10 @@ class TracksAdapter(
|
|||
val fromQueue: Boolean = false
|
||||
) : FFAAdapter<Track, TracksAdapter.ViewHolder>() {
|
||||
|
||||
init {
|
||||
this.stateRestorationPolicy = StateRestorationPolicy.PREVENT_WHEN_EMPTY
|
||||
}
|
||||
|
||||
interface OnFavoriteListener {
|
||||
fun onToggleFavorite(id: Int, state: Boolean)
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Remember scroll positions in list views (Artists/Albums/...) (#95)
|
Loading…
Reference in New Issue