mirror of https://github.com/TeamNewPipe/NewPipe
XPipe:- Open in youtube popup menu option.
This commit is contained in:
parent
a2188d1bcc
commit
c53ce80228
|
@ -231,6 +231,11 @@ public class ChannelFragment extends BaseStateFragment<ChannelInfo>
|
|||
ShareUtils.openUrlInBrowser(requireContext(), currentInfo.getOriginalUrl());
|
||||
}
|
||||
break;
|
||||
case R.id.menu_item_openInYoutube:
|
||||
if (currentInfo != null) {
|
||||
ShareUtils.openUrlInYoutube(requireContext(), currentInfo.getOriginalUrl());
|
||||
}
|
||||
break;
|
||||
case R.id.menu_item_share:
|
||||
if (currentInfo != null) {
|
||||
ShareUtils.shareText(requireContext(), name, currentInfo.getOriginalUrl(),
|
||||
|
|
|
@ -232,6 +232,9 @@ public class PlaylistFragment extends BaseListInfoFragment<StreamInfoItem, Playl
|
|||
case R.id.menu_item_openInBrowser:
|
||||
ShareUtils.openUrlInBrowser(requireContext(), url);
|
||||
break;
|
||||
case R.id.menu_item_openInYoutube:
|
||||
ShareUtils.openUrlInYoutube(requireContext(), url);
|
||||
break;
|
||||
case R.id.menu_item_share:
|
||||
ShareUtils.shareText(requireContext(), name, url,
|
||||
currentInfo == null ? null : currentInfo.getThumbnailUrl());
|
||||
|
|
|
@ -325,6 +325,7 @@ public final class InfoItemDialog {
|
|||
StreamDialogDefaultEntry.DOWNLOAD,
|
||||
StreamDialogDefaultEntry.APPEND_PLAYLIST,
|
||||
StreamDialogDefaultEntry.SHARE,
|
||||
StreamDialogDefaultEntry.OPEN_IN_YOUTUBE,
|
||||
StreamDialogDefaultEntry.OPEN_IN_BROWSER
|
||||
);
|
||||
addPlayWithKodiEntryIfNeeded();
|
||||
|
|
|
@ -122,6 +122,9 @@ public enum StreamDialogDefaultEntry {
|
|||
})
|
||||
),
|
||||
|
||||
OPEN_IN_YOUTUBE(R.string.open_in_youtube, (fragment, item) ->
|
||||
ShareUtils.openUrlInYoutube(fragment.requireContext(), item.getUrl())),
|
||||
|
||||
OPEN_IN_BROWSER(R.string.open_in_browser, (fragment, item) ->
|
||||
ShareUtils.openUrlInBrowser(fragment.requireContext(), item.getUrl())),
|
||||
|
||||
|
|
|
@ -283,6 +283,7 @@ public final class MainPlayerUi extends VideoPlayerUi implements View.OnLayoutCh
|
|||
R.drawable.ic_expand_more));
|
||||
binding.share.setVisibility(View.VISIBLE);
|
||||
binding.openInBrowser.setVisibility(View.VISIBLE);
|
||||
binding.openInYoutube.setVisibility(View.VISIBLE);
|
||||
binding.switchMute.setVisibility(View.VISIBLE);
|
||||
binding.playerCloseButton.setVisibility(isFullscreen ? View.GONE : View.VISIBLE);
|
||||
// Top controls have a large minHeight which is allows to drag the player
|
||||
|
|
|
@ -168,6 +168,7 @@ public final class PopupPlayerUi extends VideoPlayerUi {
|
|||
binding.share.setVisibility(View.GONE);
|
||||
binding.playWithKodi.setVisibility(View.GONE);
|
||||
binding.openInBrowser.setVisibility(View.GONE);
|
||||
binding.openInYoutube.setVisibility(View.GONE);
|
||||
binding.switchMute.setVisibility(View.GONE);
|
||||
binding.playerCloseButton.setVisibility(View.GONE);
|
||||
binding.topControls.bringToFront();
|
||||
|
|
|
@ -236,6 +236,7 @@ public abstract class VideoPlayerUi extends PlayerUi implements SeekBar.OnSeekBa
|
|||
}));
|
||||
binding.playWithKodi.setOnClickListener(makeOnClickListener(this::onPlayWithKodiClicked));
|
||||
binding.openInBrowser.setOnClickListener(makeOnClickListener(this::onOpenInBrowserClicked));
|
||||
binding.openInYoutube.setOnClickListener(makeOnClickListener(this::onOpenInYoutubeClicked));
|
||||
binding.playerCloseButton.setOnClickListener(makeOnClickListener(() ->
|
||||
// set package to this app's package to prevent the intent from being seen outside
|
||||
context.sendBroadcast(new Intent(VideoDetailFragment.ACTION_HIDE_MAIN_PLAYER)
|
||||
|
@ -300,6 +301,7 @@ public abstract class VideoPlayerUi extends PlayerUi implements SeekBar.OnSeekBa
|
|||
binding.screenRotationButton.setOnClickListener(null);
|
||||
binding.playWithKodi.setOnClickListener(null);
|
||||
binding.openInBrowser.setOnClickListener(null);
|
||||
binding.openInYoutube.setOnClickListener(null);
|
||||
binding.playerCloseButton.setOnClickListener(null);
|
||||
binding.switchMute.setOnClickListener(null);
|
||||
|
||||
|
@ -1500,6 +1502,11 @@ public abstract class VideoPlayerUi extends PlayerUi implements SeekBar.OnSeekBa
|
|||
player.getCurrentStreamInfo().ifPresent(streamInfo ->
|
||||
ShareUtils.openUrlInBrowser(player.getContext(), streamInfo.getOriginalUrl()));
|
||||
}
|
||||
|
||||
private void onOpenInYoutubeClicked() {
|
||||
player.getCurrentStreamInfo().ifPresent(streamInfo ->
|
||||
ShareUtils.openUrlInYoutube(player.getContext(), streamInfo.getOriginalUrl()));
|
||||
}
|
||||
//endregion
|
||||
|
||||
|
||||
|
|
|
@ -517,6 +517,22 @@
|
|||
android:text="@string/share"
|
||||
android:textSize="@dimen/detail_control_text_size" />
|
||||
|
||||
<org.schabi.newpipe.views.NewPipeTextView
|
||||
android:id="@+id/detail_controls_open_in_youtube"
|
||||
android:layout_width="@dimen/detail_control_width"
|
||||
android:layout_height="@dimen/detail_control_height"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/open_in_youtube"
|
||||
android:drawableTop="@drawable/ic_language"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:paddingVertical="@dimen/detail_control_padding"
|
||||
android:text="@string/open_in_youtube"
|
||||
android:textSize="@dimen/detail_control_text_size" />
|
||||
|
||||
<org.schabi.newpipe.views.NewPipeTextView
|
||||
android:id="@+id/detail_controls_open_in_browser"
|
||||
android:layout_width="@dimen/detail_control_width"
|
||||
|
|
|
@ -314,6 +314,21 @@
|
|||
app:tint="@color/white"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/openInYoutube"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/open_in_youtube"
|
||||
android:focusable="true"
|
||||
android:padding="@dimen/player_main_buttons_padding"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_smart_display"
|
||||
app:tint="@color/white"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/openInBrowser"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -33,8 +33,14 @@
|
|||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_item_openInBrowser"
|
||||
android:id="@+id/menu_item_openInYoutube"
|
||||
android:orderInCategory="3"
|
||||
android:title="@string/open_in_youtube"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_item_openInBrowser"
|
||||
android:orderInCategory="4"
|
||||
android:title="@string/open_in_browser"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
||||
|
|
|
@ -24,14 +24,20 @@
|
|||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_item_openInBrowser"
|
||||
android:id="@+id/menu_item_openInYoutube"
|
||||
android:orderInCategory="2"
|
||||
android:title="@string/open_in_youtube"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_item_openInBrowser"
|
||||
android:orderInCategory="3"
|
||||
android:title="@string/open_in_browser"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_item_append_playlist"
|
||||
android:orderInCategory="3"
|
||||
android:orderInCategory="4"
|
||||
android:title="@string/add_to_playlist"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
||||
|
|
|
@ -59,8 +59,8 @@
|
|||
<color name="video_overlay_color">#64000000</color>
|
||||
|
||||
<color name="subscribe_text_color">#fff</color>
|
||||
<color name="subscribed_background_color">#d6d6d6</color>
|
||||
<color name="subscribed_text_color">#717171</color>
|
||||
<color name="subscribed_background_color">#c8E53935</color>
|
||||
<color name="subscribed_text_color">#fff</color>
|
||||
|
||||
<color name="transparent_background_color">#00000000</color>
|
||||
<color name="selected_background_color">#96717171</color>
|
||||
|
|
Loading…
Reference in New Issue