Skip to content

Commit ee477b2

Browse files
committed
Move StreamDialogEntry.openChannelFragment to NavigationHelper
1 parent 277f21d commit ee477b2

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

app/src/main/java/org/schabi/newpipe/info_list/dialog/StreamDialogDefaultEntry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.schabi.newpipe.info_list.dialog;
22

33
import static org.schabi.newpipe.info_list.dialog.StreamDialogEntry.fetchItemInfoIfSparse;
4-
import static org.schabi.newpipe.info_list.dialog.StreamDialogEntry.openChannelFragment;
4+
import static org.schabi.newpipe.util.NavigationHelper.openChannelFragment;
55

66
import android.net.Uri;
77

app/src/main/java/org/schabi/newpipe/info_list/dialog/StreamDialogEntry.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.schabi.newpipe.local.history.HistoryRecordManager;
1515
import org.schabi.newpipe.player.playqueue.SinglePlayQueue;
1616
import org.schabi.newpipe.util.ExtractorHelper;
17-
import org.schabi.newpipe.util.NavigationHelper;
1817

1918
import java.util.function.Consumer;
2019

@@ -42,15 +41,6 @@ public interface StreamDialogEntryAction {
4241
void onClick(Fragment fragment, StreamInfoItem infoItem);
4342
}
4443

45-
public static void openChannelFragment(@NonNull final Fragment fragment,
46-
@NonNull final StreamInfoItem item,
47-
final String uploaderUrl) {
48-
// For some reason `getParentFragmentManager()` doesn't work, but this does.
49-
NavigationHelper.openChannelFragment(
50-
fragment.requireActivity().getSupportFragmentManager(),
51-
item.getServiceId(), uploaderUrl, item.getUploaderName());
52-
}
53-
5444
/**
5545
* Fetches a {@link StreamInfoItem} if it is incomplete and executes the callback.
5646
* <br />

app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.schabi.newpipe.extractor.stream.AudioStream;
3232
import org.schabi.newpipe.extractor.stream.Stream;
3333
import org.schabi.newpipe.extractor.stream.StreamInfo;
34+
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
3435
import org.schabi.newpipe.extractor.stream.VideoStream;
3536
import org.schabi.newpipe.fragments.MainFragment;
3637
import org.schabi.newpipe.fragments.detail.VideoDetailFragment;
@@ -402,6 +403,15 @@ public static void openChannelFragment(final FragmentManager fragmentManager,
402403
.commit();
403404
}
404405

406+
public static void openChannelFragment(@NonNull final Fragment fragment,
407+
@NonNull final StreamInfoItem item,
408+
final String uploaderUrl) {
409+
// For some reason `getParentFragmentManager()` doesn't work, but this does.
410+
openChannelFragment(
411+
fragment.requireActivity().getSupportFragmentManager(),
412+
item.getServiceId(), uploaderUrl, item.getUploaderName());
413+
}
414+
405415
public static void openPlaylistFragment(final FragmentManager fragmentManager,
406416
final int serviceId, final String url,
407417
@NonNull final String name) {

0 commit comments

Comments
 (0)