Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Open in browser option to long-press menu #6280

Merged
merged 2 commits into from
Jun 3, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add Open in browser option to long-press menu
Add Open in browser option to long-press menu when long pressing a stream and a subscription
AudricV committed Jun 3, 2021

Unverified

This user has not yet uploaded their public signing key.
commit b9aaafdb30324b7460e73170eedfbd20ebf4a167
Original file line number Diff line number Diff line change
@@ -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);
}
Original file line number Diff line number Diff line change
@@ -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)
}
}

Original file line number Diff line number Diff line change
@@ -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()));


///////////////