- 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,12 +234,16 @@ 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:
if (currentInfo != null) {
disposables.add(PlaylistDialog.createCorrespondingDialog(
getContext(),
getPlayQueue()
@ -248,6 +253,10 @@ public class PlaylistFragment extends BaseListInfoFragment<StreamInfoItem, Playl
.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>