Remove TAG parameter, refactor method calls

This commit is contained in:
ktprograms 2021-08-25 17:04:15 +08:00
parent a1cb3e59d6
commit a4503eb609
3 changed files with 8 additions and 22 deletions

View file

@ -23,8 +23,7 @@ public final class QueueItemMenuUtil {
final View view,
final boolean hideDetails,
final FragmentManager fragmentManager,
final Context context,
final String tag) {
final Context context) {
final ContextThemeWrapper themeWrapper =
new ContextThemeWrapper(context, R.style.DarkPopupMenu);
@ -52,9 +51,9 @@ public final class QueueItemMenuUtil {
Collections.singletonList(item)
);
PlaylistAppendDialog.onPlaylistFound(context,
() -> d.show(fragmentManager, tag),
() -> d.show(fragmentManager, "QueueItemMenuUtil@append_playlist"),
() -> PlaylistCreationDialog.newInstance(d)
.show(fragmentManager, tag));
.show(fragmentManager, "QueueItemMenuUtil@append_playlist"));
return true;
case R.id.menu_item_share:
shareText(context, item.getTitle(), item.getUrl(),

View file

@ -276,11 +276,6 @@ public final class PlayQueueActivity extends AppCompatActivity
queueControlBinding.controlShuffle.setOnClickListener(this);
}
private void buildItemPopupMenu(final PlayQueueItem item, final View view) {
openPopupMenu(player.getPlayQueue(), item, view, false,
getSupportFragmentManager(), this, TAG);
}
////////////////////////////////////////////////////////////////////////////
// Component Helpers
////////////////////////////////////////////////////////////////////////////
@ -328,13 +323,9 @@ public final class PlayQueueActivity extends AppCompatActivity
@Override
public void held(final PlayQueueItem item, final View view) {
if (player == null) {
return;
}
final int index = player.getPlayQueue().indexOf(item);
if (index != -1) {
buildItemPopupMenu(item, view);
if (player != null && player.getPlayQueue().indexOf(item) != -1) {
openPopupMenu(player.getPlayQueue(), item, view, false,
getSupportFragmentManager(), PlayQueueActivity.this);
}
}

View file

@ -3033,11 +3033,6 @@ public final class Player implements
playQueue.setIndex(index);
}
private void heldQueueItem(final PlayQueueItem item, final View view) {
openPopupMenu(playQueue, item, view, true,
getParentActivity().getSupportFragmentManager(), context, TAG);
}
@Override
public void onPlayQueueEdited() {
notifyPlaybackUpdateToListeners();
@ -3205,7 +3200,8 @@ public final class Player implements
@Override
public void held(final PlayQueueItem item, final View view) {
if (playQueue.indexOf(item) != -1) {
heldQueueItem(item, view);
openPopupMenu(playQueue, item, view, true,
getParentActivity().getSupportFragmentManager(), context);
}
}