Skip to content

Commit

Permalink
Merge pull request #6280 from TiA4f8R/open-in-browser-long-press-menu
Browse files Browse the repository at this point in the history
Add Open in browser option to long-press menu
  • Loading branch information
TobiGr authored Jun 3, 2021
2 parents 71aa6c6 + b4d6015 commit f739ed7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,10 @@ protected void showStreamDialog(final StreamInfoItem item) {
StreamDialogEntry.share
));
}
entries.add(StreamDialogEntry.open_in_browser);
if (KoreUtil.shouldShowPlayWithKodi(context, item.getServiceId())) {
entries.add(StreamDialogEntry.play_with_kodi);
}

if (!isNullOrEmpty(item.getUploaderUrl())) {
entries.add(StreamDialogEntry.show_channel_details);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ protected void showStreamDialog(final StreamInfoItem item) {
StreamDialogEntry.share
));
}
entries.add(StreamDialogEntry.open_in_browser);
if (KoreUtil.shouldShowPlayWithKodi(context, item.getServiceId())) {
entries.add(StreamDialogEntry.play_with_kodi);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ private void showStreamDialog(final StreamStatisticsEntry item) {
StreamDialogEntry.share
));
}
entries.add(StreamDialogEntry.open_in_browser);
if (KoreUtil.shouldShowPlayWithKodi(context, infoItem.getServiceId())) {
entries.add(StreamDialogEntry.play_with_kodi);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,7 @@ protected void showStreamItemDialog(final PlaylistStreamEntry item) {
StreamDialogEntry.share
));
}
entries.add(StreamDialogEntry.open_in_browser);
if (KoreUtil.shouldShowPlayWithKodi(context, infoItem.getServiceId())) {
entries.add(StreamDialogEntry.play_with_kodi);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,14 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
}

private fun showLongTapDialog(selectedItem: ChannelInfoItem) {
val commands = arrayOf(getString(R.string.share), getString(R.string.unsubscribe))
val commands = arrayOf(getString(R.string.share), getString(R.string.open_in_browser),
getString(R.string.unsubscribe))

val actions = DialogInterface.OnClickListener { _, i ->
when (i) {
0 -> ShareUtils.shareText(requireContext(), selectedItem.name, selectedItem.url)
1 -> deleteChannel(selectedItem)
1 -> ShareUtils.openUrlInBrowser(requireContext(), selectedItem.url)
2 -> deleteChannel(selectedItem)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ public enum StreamDialogEntry {
}),

share(R.string.share, (fragment, item) ->
ShareUtils.shareText(fragment.getContext(), item.getName(), item.getUrl()));
ShareUtils.shareText(fragment.getContext(), item.getName(), item.getUrl())),

open_in_browser(R.string.open_in_browser, (fragment, item) ->
ShareUtils.openUrlInBrowser(fragment.getContext(), item.getUrl()));


///////////////
Expand Down

0 comments on commit f739ed7

Please sign in to comment.