Skip to content

Commit

Permalink
tweak PIP player for certain aspect ratios
Browse files Browse the repository at this point in the history
  • Loading branch information
akinwale committed Jun 1, 2020
1 parent f49a357 commit f03d58d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions app/src/main/java/io/lbry/browser/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -837,10 +837,11 @@ private void renderPictureInPictureMode() {
listener.onEnterPIPMode();
}

View pipPlayerContainer = findViewById(R.id.pip_player_container);
PlayerView pipPlayer = findViewById(R.id.pip_player);
pipPlayer.setVisibility(View.VISIBLE);
pipPlayer.setPlayer(appPlayer);
pipPlayer.setUseController(false);
pipPlayerContainer.setVisibility(View.VISIBLE);
playerReassigned = true;
}
private void renderFullMode() {
Expand Down Expand Up @@ -871,9 +872,10 @@ private void renderFullMode() {
listener.onExitPIPMode();
}

View pipPlayerContainer = findViewById(R.id.pip_player_container);
PlayerView pipPlayer = findViewById(R.id.pip_player);
pipPlayer.setVisibility(View.INVISIBLE);
pipPlayer.setPlayer(null);
pipPlayerContainer.setVisibility(View.INVISIBLE);
playerReassigned = true;
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/container_comment_form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/post_as"
android:text="@string/comment_as"
android:fontFamily="@font/inter"
android:textSize="14sp"
android:textFontWeight="300" />
Expand Down
14 changes: 10 additions & 4 deletions app/src/main/res/layout/content_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,18 @@
</RelativeLayout>
</androidx.cardview.widget.CardView>

<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/pip_player"
<RelativeLayout
android:id="@+id/pip_player_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
android:visibility="invisible"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="invisible" />
app:layout_constraintTop_toTopOf="parent">
<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/pip_player"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<string name="content_deleted">The content was successfully deleted from the blockchain.</string>
<string name="content_failed_delete">The content could not be deleted at this time. Please try again later.</string>
<string name="comment">Comment</string>
<string name="post_as">Post as</string>
<string name="comment_as">Comment as</string>
<string name="please_enter_comment">Please enter a comment to post.</string>
<string name="please_select_channel">Please select a channel to post your comment as.</string>
<string name="post_comment">Post comment with tip?</string>
Expand Down

0 comments on commit f03d58d

Please sign in to comment.