mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 08:30:44 +00:00
Added Toast Notification "Hold to enqueue" (#9196)
* Added Toast Notification "Hold to enqueue" * Check if enqueue tips are enabled * created function showHoldToAppendTipIfNeeded() for toast message
This commit is contained in:
parent
40815086ad
commit
0d73d193ad
@ -22,6 +22,7 @@ import android.widget.Toast;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import androidx.preference.PreferenceManager;
|
||||||
import androidx.recyclerview.widget.ItemTouchHelper;
|
import androidx.recyclerview.widget.ItemTouchHelper;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import androidx.viewbinding.ViewBinding;
|
import androidx.viewbinding.ViewBinding;
|
||||||
@ -503,13 +504,18 @@ public class LocalPlaylistFragment extends BaseLocalListFragment<List<PlaylistSt
|
|||||||
}
|
}
|
||||||
setVideoCount(itemListAdapter.getItemsList().size());
|
setVideoCount(itemListAdapter.getItemsList().size());
|
||||||
|
|
||||||
playlistControlBinding.playlistCtrlPlayAllButton.setOnClickListener(view ->
|
playlistControlBinding.playlistCtrlPlayAllButton.setOnClickListener(view -> {
|
||||||
NavigationHelper.playOnMainPlayer(activity, getPlayQueue()));
|
NavigationHelper.playOnMainPlayer(activity, getPlayQueue());
|
||||||
playlistControlBinding.playlistCtrlPlayPopupButton.setOnClickListener(view ->
|
showHoldToAppendTipIfNeeded();
|
||||||
NavigationHelper.playOnPopupPlayer(activity, getPlayQueue(), false));
|
});
|
||||||
playlistControlBinding.playlistCtrlPlayBgButton.setOnClickListener(view ->
|
playlistControlBinding.playlistCtrlPlayPopupButton.setOnClickListener(view -> {
|
||||||
NavigationHelper.playOnBackgroundPlayer(activity, getPlayQueue(), false));
|
NavigationHelper.playOnPopupPlayer(activity, getPlayQueue(), false);
|
||||||
|
showHoldToAppendTipIfNeeded();
|
||||||
|
});
|
||||||
|
playlistControlBinding.playlistCtrlPlayBgButton.setOnClickListener(view -> {
|
||||||
|
NavigationHelper.playOnBackgroundPlayer(activity, getPlayQueue(), false);
|
||||||
|
showHoldToAppendTipIfNeeded();
|
||||||
|
});
|
||||||
playlistControlBinding.playlistCtrlPlayPopupButton.setOnLongClickListener(view -> {
|
playlistControlBinding.playlistCtrlPlayPopupButton.setOnLongClickListener(view -> {
|
||||||
NavigationHelper.enqueueOnPlayer(activity, getPlayQueue(), PlayerType.POPUP);
|
NavigationHelper.enqueueOnPlayer(activity, getPlayQueue(), PlayerType.POPUP);
|
||||||
return true;
|
return true;
|
||||||
@ -523,6 +529,13 @@ public class LocalPlaylistFragment extends BaseLocalListFragment<List<PlaylistSt
|
|||||||
hideLoading();
|
hideLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void showHoldToAppendTipIfNeeded() {
|
||||||
|
if (PreferenceManager.getDefaultSharedPreferences(activity)
|
||||||
|
.getBoolean(getString(R.string.show_hold_to_append_key), true)) {
|
||||||
|
Toast.makeText(activity, R.string.hold_to_append, Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// Fragment Error Handling
|
// Fragment Error Handling
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user