Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ff689fd authored by Michael W's avatar Michael W
Browse files

Eleven: Fix menu for first item and properly show empty view

* Currently, the three dots on the first song in a playlist do nothing
  -> Remove the special case for position=0
* When the menu works and you use it to remove the last (first position)
  item from the playlist, the "empty view" won't get shown
  -> set visible explicitly, now it looks like when you first show
     an empty playlist

Change-Id: I2fa4a84cff27fe6fba1c8ea66b7381cc9457d434
parent 58920844
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -145,10 +145,6 @@ public class PlaylistDetailFragment extends DetailFragment implements
        mPopupMenuHelper = new SongPopupMenuHelper(getActivity(), getChildFragmentManager()) {
            @Override
            public Song getSong(int position) {
                if (position == 0) {
                    return null;
                }

                return mAdapter.getItem(position);
            }

@@ -275,6 +271,10 @@ public class PlaylistDetailFragment extends DetailFragment implements
        Handler handler = new Handler(requireActivity().getMainLooper());
        if (data.isEmpty()) {
            mLoadingEmptyContainer.showNoResults();
            // need to call this after showNoResults, otherwise removing any would
            // clear the whole list (not only visibly but it's gone even when re-entering the
            // playlist)
            mLoadingEmptyContainer.setVisibility(View.VISIBLE);

            // hide the header container
            mHeaderContainer.setVisibility(View.INVISIBLE);