- Crash fix on clicking on add to playlist.
- Added toast when clicked on share button for better UI.
This commit is contained in:
pratyaksh1610 2022-12-09 14:09:40 +05:30
parent 4a27d371e0
commit c537776826
2 changed files with 19 additions and 9 deletions

View File

@ -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);

View File

@ -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>