kopia lustrzana https://github.com/TeamNewPipe/NewPipe
Move StreamDialogEntry.openChannelFragment to NavigationHelper
rodzic
277f21d5b2
commit
ee477b25e5
|
@ -1,7 +1,7 @@
|
|||
package org.schabi.newpipe.info_list.dialog;
|
||||
|
||||
import static org.schabi.newpipe.info_list.dialog.StreamDialogEntry.fetchItemInfoIfSparse;
|
||||
import static org.schabi.newpipe.info_list.dialog.StreamDialogEntry.openChannelFragment;
|
||||
import static org.schabi.newpipe.util.NavigationHelper.openChannelFragment;
|
||||
|
||||
import android.net.Uri;
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ import org.schabi.newpipe.extractor.stream.StreamType;
|
|||
import org.schabi.newpipe.local.history.HistoryRecordManager;
|
||||
import org.schabi.newpipe.player.playqueue.SinglePlayQueue;
|
||||
import org.schabi.newpipe.util.ExtractorHelper;
|
||||
import org.schabi.newpipe.util.NavigationHelper;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
@ -42,15 +41,6 @@ public class StreamDialogEntry {
|
|||
void onClick(Fragment fragment, StreamInfoItem infoItem);
|
||||
}
|
||||
|
||||
public static void openChannelFragment(@NonNull final Fragment fragment,
|
||||
@NonNull final StreamInfoItem item,
|
||||
final String uploaderUrl) {
|
||||
// For some reason `getParentFragmentManager()` doesn't work, but this does.
|
||||
NavigationHelper.openChannelFragment(
|
||||
fragment.requireActivity().getSupportFragmentManager(),
|
||||
item.getServiceId(), uploaderUrl, item.getUploaderName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches a {@link StreamInfoItem} if it is incomplete and executes the callback.
|
||||
* <br />
|
||||
|
|
|
@ -31,6 +31,7 @@ import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
|||
import org.schabi.newpipe.extractor.stream.AudioStream;
|
||||
import org.schabi.newpipe.extractor.stream.Stream;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfo;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||
import org.schabi.newpipe.extractor.stream.VideoStream;
|
||||
import org.schabi.newpipe.fragments.MainFragment;
|
||||
import org.schabi.newpipe.fragments.detail.VideoDetailFragment;
|
||||
|
@ -402,6 +403,15 @@ public final class NavigationHelper {
|
|||
.commit();
|
||||
}
|
||||
|
||||
public static void openChannelFragment(@NonNull final Fragment fragment,
|
||||
@NonNull final StreamInfoItem item,
|
||||
final String uploaderUrl) {
|
||||
// For some reason `getParentFragmentManager()` doesn't work, but this does.
|
||||
openChannelFragment(
|
||||
fragment.requireActivity().getSupportFragmentManager(),
|
||||
item.getServiceId(), uploaderUrl, item.getUploaderName());
|
||||
}
|
||||
|
||||
public static void openPlaylistFragment(final FragmentManager fragmentManager,
|
||||
final int serviceId, final String url,
|
||||
@NonNull final String name) {
|
||||
|
|
Ładowanie…
Reference in New Issue