mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2024-11-25 04:22:30 +01:00
Fixes #9518
- Crash fix on clicking on add to playlist. - Added toast when clicked on share button for better UI.
This commit is contained in:
parent
4a27d371e0
commit
c537776826
@ -13,6 +13,7 @@ import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@ -233,21 +234,29 @@ public class PlaylistFragment extends BaseListInfoFragment<StreamInfoItem, Playl
|
||||
if (currentInfo != null) {
|
||||
ShareUtils.shareText(requireContext(), name, url,
|
||||
currentInfo.getThumbnailUrl());
|
||||
} else {
|
||||
Toast.makeText(getContext(), getString(R.string.playlist_loading_message),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
case R.id.menu_item_bookmark:
|
||||
onBookmarkClicked();
|
||||
break;
|
||||
case R.id.menu_item_append_playlist:
|
||||
disposables.add(PlaylistDialog.createCorrespondingDialog(
|
||||
getContext(),
|
||||
getPlayQueue()
|
||||
.getStreams()
|
||||
.stream()
|
||||
.map(StreamEntity::new)
|
||||
.collect(Collectors.toList()),
|
||||
dialog -> dialog.show(getFM(), TAG)
|
||||
));
|
||||
if (currentInfo != null) {
|
||||
disposables.add(PlaylistDialog.createCorrespondingDialog(
|
||||
getContext(),
|
||||
getPlayQueue()
|
||||
.getStreams()
|
||||
.stream()
|
||||
.map(StreamEntity::new)
|
||||
.collect(Collectors.toList()),
|
||||
dialog -> dialog.show(getFM(), TAG)
|
||||
));
|
||||
} else {
|
||||
Toast.makeText(getContext(), getString(R.string.playlist_loading_message),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
|
@ -241,6 +241,7 @@
|
||||
<string name="restore_defaults">Restore defaults</string>
|
||||
<string name="restore_defaults_confirmation">Do you want to restore defaults?</string>
|
||||
<string name="permission_display_over_apps">Give permission to display over other apps</string>
|
||||
<string name="playlist_loading_message">Playlist loading…</string>
|
||||
<!-- error activity -->
|
||||
<string name="error_report_notification_title">NewPipe encountered an error, tap to report</string>
|
||||
<string name="error_report_notification_toast">An error occurred, see the notification</string>
|
||||
|
Loading…
Reference in New Issue
Block a user