properly show the Empty Playlist views whenever appropriate

This commit is contained in:
tibbi 2018-02-07 19:42:58 +01:00
parent 55fb80693b
commit 2c287b4fbd
2 changed files with 5 additions and 3 deletions

View file

@ -227,7 +227,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
override fun onMenuItemActionCollapse(item: MenuItem?): Boolean {
songs_playlist_empty.text = getString(R.string.playlist_empty)
songs_playlist_empty_add_folder.beVisibleIf(songs.isEmpty())
art_holder.beVisible()
art_holder.beVisibleIf(songs.isNotEmpty())
if (isSearchOpen) {
searchQueryChanged("")
}
@ -446,6 +446,9 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
(songs_list.layoutManager as MyLinearLayoutManager).onRestoreInstanceState(state)
}
markCurrentSong()
songs_list.beVisibleIf(songs.isNotEmpty())
art_holder.beVisibleIf(songs_list.isVisible())
songs_playlist_empty.beVisibleIf(songs.isEmpty())
songs_playlist_empty_add_folder.beVisibleIf(songs.isEmpty())
}

View file

@ -62,12 +62,11 @@
android:id="@+id/songs_playlist_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/art_holder"
android:layout_centerHorizontal="true"
android:gravity="center"
android:paddingLeft="@dimen/big_margin"
android:paddingRight="@dimen/big_margin"
android:paddingTop="@dimen/medium_margin"
android:paddingTop="@dimen/big_margin"
android:text="@string/playlist_empty"
android:textSize="@dimen/bigger_text_size"/>