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 button to MainPlayer to go to Detail view #2430

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
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
10 changes: 10 additions & 0 deletions app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ private class VideoPlayerImpl extends VideoPlayer {

private TextView titleTextView;
private TextView channelTextView;
private ImageButton showDetailButton;
private RelativeLayout volumeRelativeLayout;
private ProgressBar volumeProgressBar;
private ImageView volumeImageView;
Expand Down Expand Up @@ -430,6 +431,7 @@ public void initViews(View rootView) {
super.initViews(rootView);
this.titleTextView = rootView.findViewById(R.id.titleTextView);
this.channelTextView = rootView.findViewById(R.id.channelTextView);
this.showDetailButton = rootView.findViewById(R.id.showDetailButton);
this.volumeRelativeLayout = rootView.findViewById(R.id.volumeRelativeLayout);
this.volumeProgressBar = rootView.findViewById(R.id.volumeProgressBar);
this.volumeImageView = rootView.findViewById(R.id.volumeImageView);
Expand Down Expand Up @@ -492,6 +494,7 @@ public void initListeners() {
playPreviousButton.setOnClickListener(this);
playNextButton.setOnClickListener(this);
closeButton.setOnClickListener(this);
showDetailButton.setOnClickListener(this);

moreOptionsButton.setOnClickListener(this);
shareButton.setOnClickListener(this);
Expand Down Expand Up @@ -564,6 +567,10 @@ public void onPlaybackShutdown() {
finish();
}

public void onShowDetailClicked() {
NavigationHelper.openVideoDetail(context, playQueue.getItem().getServiceId(), playQueue.getItem().getUrl());
}

/*//////////////////////////////////////////////////////////////////////////
// Player Overrides
//////////////////////////////////////////////////////////////////////////*/
Expand Down Expand Up @@ -641,6 +648,9 @@ public void onClick(View v) {
} else if (v.getId() == repeatButton.getId()) {
onRepeatClicked();
return;
} else if (v.getId() == showDetailButton.getId()) {
onShowDetailClicked();
return;
} else if (v.getId() == shuffleButton.getId()) {
onShuffleClicked();
return;
Expand Down
87 changes: 52 additions & 35 deletions app/src/main/res/layout/activity_main_player.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,49 +151,66 @@
tools:ignore="RtlHardcoded">

<LinearLayout
android:id="@+id/metadataView"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/qualityTextView"
android:gravity="top"
android:orientation="vertical"
android:paddingLeft="8dp"
android:paddingRight="8dp"
tools:ignore="RtlHardcoded">

<TextView
android:id="@+id/titleTextView"
android:layout_width="match_parent"
android:layout_toLeftOf="@+id/qualityTextView">

<ImageButton
android:id="@+id/showDetailButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="15sp"
android:textStyle="bold"
android:layout_marginTop="5dp"
android:background="@drawable/ic_arrow_back_white_24dp"
android:padding="10dp"
android:clickable="true"
android:focusable="true"
tools:ignore="RtlHardcoded"
tools:text="The Video Title LONG very LONG"/>
android:scaleType="fitXY"
android:tint="?attr/colorAccent"/>

<TextView
android:id="@+id/channelTextView"
android:layout_width="match_parent"
<LinearLayout
android:id="@+id/metadataView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="12sp"
android:clickable="true"
android:focusable="true"
tools:text="The Video Artist LONG very LONG very Long"/>
android:gravity="top"
android:orientation="vertical"
android:paddingLeft="8dp"
android:paddingRight="8dp"
tools:ignore="RtlHardcoded">

<TextView
android:id="@+id/titleTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="15sp"
android:textStyle="bold"
android:clickable="true"
android:focusable="true"
tools:ignore="RtlHardcoded"
tools:text="The Video Title LONG very LONG"/>
csicar marked this conversation as resolved.
Show resolved Hide resolved

<TextView
android:id="@+id/channelTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="12sp"
android:clickable="true"
android:focusable="true"
tools:text="The Video Artist LONG very LONG very Long"/>
</LinearLayout>
</LinearLayout>

<TextView
Expand Down