Skip to content

Commit

Permalink
Merge pull request #6309 from mhmdanas/fix-channel-details-long-press…
Browse files Browse the repository at this point in the history
…-menu-on-feeds

Add "Show channel details" option in remote (non-local) playlists
  • Loading branch information
TobiGr authored Jun 3, 2021
2 parents f98d263 + b2b9938 commit 71aa6c6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import io.reactivex.rxjava3.disposables.CompositeDisposable;
import io.reactivex.rxjava3.disposables.Disposable;

import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
import static org.schabi.newpipe.ktx.ViewUtils.animate;
import static org.schabi.newpipe.ktx.ViewUtils.animateHideRecyclerViewAllowingScrolling;

Expand Down Expand Up @@ -163,6 +164,11 @@ protected void showStreamDialog(final StreamInfoItem item) {
if (KoreUtil.shouldShowPlayWithKodi(context, item.getServiceId())) {
entries.add(StreamDialogEntry.play_with_kodi);
}

if (!isNullOrEmpty(item.getUploaderUrl())) {
entries.add(StreamDialogEntry.show_channel_details);
}

StreamDialogEntry.setEnabledEntries(entries);

StreamDialogEntry.start_here_on_background.setCustomAction((fragment, infoItem) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
import io.reactivex.rxjava3.disposables.CompositeDisposable;
import io.reactivex.rxjava3.disposables.Disposable;

import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;

public class StatisticsPlaylistFragment
extends BaseLocalListFragment<List<StreamStatisticsEntry>, Void> {
private final CompositeDisposable disposables = new CompositeDisposable();
Expand Down Expand Up @@ -359,6 +361,11 @@ private void showStreamDialog(final StreamStatisticsEntry item) {
if (KoreUtil.shouldShowPlayWithKodi(context, infoItem.getServiceId())) {
entries.add(StreamDialogEntry.play_with_kodi);
}

if (!isNullOrEmpty(infoItem.getUploaderUrl())) {
entries.add(StreamDialogEntry.show_channel_details);
}

StreamDialogEntry.setEnabledEntries(entries);

StreamDialogEntry.start_here_on_background.setCustomAction((fragment, infoItemDuplicate) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import io.reactivex.rxjava3.schedulers.Schedulers;
import io.reactivex.rxjava3.subjects.PublishSubject;

import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
import static org.schabi.newpipe.ktx.ViewUtils.animate;

public class LocalPlaylistFragment extends BaseLocalListFragment<List<PlaylistStreamEntry>, Void> {
Expand Down Expand Up @@ -771,6 +772,11 @@ protected void showStreamItemDialog(final PlaylistStreamEntry item) {
if (KoreUtil.shouldShowPlayWithKodi(context, infoItem.getServiceId())) {
entries.add(StreamDialogEntry.play_with_kodi);
}

if (!isNullOrEmpty(infoItem.getUploaderUrl())) {
entries.add(StreamDialogEntry.show_channel_details);
}

StreamDialogEntry.setEnabledEntries(entries);

StreamDialogEntry.start_here_on_background.setCustomAction((fragment, infoItemDuplicate) ->
Expand Down

0 comments on commit 71aa6c6

Please sign in to comment.