|
13 | 13 | import android.view.MenuItem; |
14 | 14 | import android.view.View; |
15 | 15 | import android.view.ViewGroup; |
| 16 | +import android.widget.Toast; |
16 | 17 |
|
17 | 18 | import androidx.annotation.NonNull; |
18 | 19 | import androidx.annotation.Nullable; |
@@ -233,21 +234,29 @@ public boolean onOptionsItemSelected(final MenuItem item) { |
233 | 234 | if (currentInfo != null) { |
234 | 235 | ShareUtils.shareText(requireContext(), name, url, |
235 | 236 | currentInfo.getThumbnailUrl()); |
| 237 | + } else { |
| 238 | + Toast.makeText(getContext(), getString(R.string.playlist_loading_message), |
| 239 | + Toast.LENGTH_SHORT).show(); |
236 | 240 | } |
237 | 241 | break; |
238 | 242 | case R.id.menu_item_bookmark: |
239 | 243 | onBookmarkClicked(); |
240 | 244 | break; |
241 | 245 | case R.id.menu_item_append_playlist: |
242 | | - disposables.add(PlaylistDialog.createCorrespondingDialog( |
243 | | - getContext(), |
244 | | - getPlayQueue() |
245 | | - .getStreams() |
246 | | - .stream() |
247 | | - .map(StreamEntity::new) |
248 | | - .collect(Collectors.toList()), |
249 | | - dialog -> dialog.show(getFM(), TAG) |
250 | | - )); |
| 246 | + if (currentInfo != null) { |
| 247 | + disposables.add(PlaylistDialog.createCorrespondingDialog( |
| 248 | + getContext(), |
| 249 | + getPlayQueue() |
| 250 | + .getStreams() |
| 251 | + .stream() |
| 252 | + .map(StreamEntity::new) |
| 253 | + .collect(Collectors.toList()), |
| 254 | + dialog -> dialog.show(getFM(), TAG) |
| 255 | + )); |
| 256 | + } else { |
| 257 | + Toast.makeText(getContext(), getString(R.string.playlist_loading_message), |
| 258 | + Toast.LENGTH_SHORT).show(); |
| 259 | + } |
251 | 260 | break; |
252 | 261 | default: |
253 | 262 | return super.onOptionsItemSelected(item); |
|
0 commit comments