Browse Source

Merge branch 'enhancement/95-remember-scroll-positions' into 'develop'

#95: Remember scroll positions in list views

Closes #95

See merge request funkwhale/funkwhale-android!103
housekeeping/mavenCentral
Ryan Harg 3 years ago
parent
commit
ea662af120
  1. 4
      app/src/main/java/audio/funkwhale/ffa/adapters/AlbumsAdapter.kt
  2. 2
      app/src/main/java/audio/funkwhale/ffa/adapters/ArtistsAdapter.kt
  3. 4
      app/src/main/java/audio/funkwhale/ffa/adapters/FavoritesAdapter.kt
  4. 4
      app/src/main/java/audio/funkwhale/ffa/adapters/PlaylistsAdapter.kt
  5. 4
      app/src/main/java/audio/funkwhale/ffa/adapters/RadiosAdapter.kt
  6. 4
      app/src/main/java/audio/funkwhale/ffa/adapters/TracksAdapter.kt
  7. 1
      changes/changelog.d/95.bugfix

4
app/src/main/java/audio/funkwhale/ffa/adapters/AlbumsAdapter.kt

@ -19,6 +19,10 @@ class AlbumsAdapter( @@ -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)
}

2
app/src/main/java/audio/funkwhale/ffa/adapters/ArtistsAdapter.kt

@ -42,6 +42,8 @@ class ArtistsAdapter( @@ -42,6 +42,8 @@ class ArtistsAdapter(
super.onItemRangeInserted(positionStart, itemCount)
}
})
this.stateRestorationPolicy = StateRestorationPolicy.PREVENT_WHEN_EMPTY
}
override fun getItemCount() = active.size

4
app/src/main/java/audio/funkwhale/ffa/adapters/FavoritesAdapter.kt

@ -30,6 +30,10 @@ class FavoritesAdapter( @@ -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)
}

4
app/src/main/java/audio/funkwhale/ffa/adapters/PlaylistsAdapter.kt

@ -20,6 +20,10 @@ class PlaylistsAdapter( @@ -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)
}

4
app/src/main/java/audio/funkwhale/ffa/adapters/RadiosAdapter.kt

@ -27,6 +27,10 @@ class RadiosAdapter( @@ -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)
}

4
app/src/main/java/audio/funkwhale/ffa/adapters/TracksAdapter.kt

@ -35,6 +35,10 @@ class TracksAdapter( @@ -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)
}

1
changes/changelog.d/95.bugfix

@ -0,0 +1 @@ @@ -0,0 +1 @@
Remember scroll positions in list views (Artists/Albums/...) (#95)
Loading…
Cancel
Save