mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
style: new player layout and various UI improvements
This commit is contained in:
parent
9e415bbe23
commit
d00299bea7
@ -480,8 +480,6 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
|||||||
if (PlayerHelper.pipEnabled) {
|
if (PlayerHelper.pipEnabled) {
|
||||||
PictureInPictureCompat.setPictureInPictureParams(activity, pipParams)
|
PictureInPictureCompat.setPictureInPictureParams(activity, pipParams)
|
||||||
}
|
}
|
||||||
binding.relPlayerPip.isVisible = PictureInPictureCompat
|
|
||||||
.isPictureInPictureAvailable(activity)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onManualPlayerClose() {
|
private fun onManualPlayerClose() {
|
||||||
@ -630,10 +628,6 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.relPlayerPip.setOnClickListener {
|
|
||||||
PictureInPictureCompat.enterPictureInPictureMode(requireActivity(), pipParams)
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.playerChannel.setOnClickListener {
|
binding.playerChannel.setOnClickListener {
|
||||||
if (!this::streams.isInitialized) return@setOnClickListener
|
if (!this::streams.isInitialized) return@setOnClickListener
|
||||||
|
|
||||||
|
@ -35,7 +35,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="10dp"
|
android:layout_marginHorizontal="10dp"
|
||||||
android:layout_marginVertical="17dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
app:cardCornerRadius="27dp">
|
app:cardCornerRadius="27dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -60,12 +61,6 @@
|
|||||||
android:text="@string/download"
|
android:text="@string/download"
|
||||||
app:drawableTopCompat="@drawable/ic_download" />
|
app:drawableTopCompat="@drawable/ic_download" />
|
||||||
|
|
||||||
<com.github.libretube.ui.views.DrawableTextView
|
|
||||||
android:id="@+id/relPlayer_pip"
|
|
||||||
style="@style/PlayerActionsText"
|
|
||||||
android:text="@string/pop_up"
|
|
||||||
app:drawableTopCompat="@drawable/ic_open" />
|
|
||||||
|
|
||||||
<com.github.libretube.ui.views.DrawableTextView
|
<com.github.libretube.ui.views.DrawableTextView
|
||||||
android:id="@+id/relPlayer_background"
|
android:id="@+id/relPlayer_background"
|
||||||
style="@style/PlayerActionsText"
|
style="@style/PlayerActionsText"
|
||||||
|
@ -5,20 +5,21 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:paddingVertical="12dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/player_title_layout"
|
android:id="@+id/player_title_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginHorizontal="4dp"
|
android:orientation="vertical"
|
||||||
android:orientation="vertical">
|
android:paddingHorizontal="12dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginVertical="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -26,7 +27,6 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
@ -38,7 +38,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginHorizontal="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:src="@drawable/ic_arrow_down" />
|
android:src="@drawable/ic_arrow_down" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@ -46,7 +46,6 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="10dp"
|
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -55,13 +54,12 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
tools:text="10M views 2 days ago " />
|
tools:text="10M views - 2 days ago " />
|
||||||
|
|
||||||
<com.github.libretube.ui.views.DrawableTextView
|
<com.github.libretube.ui.views.DrawableTextView
|
||||||
android:id="@+id/textLike"
|
android:id="@+id/textLike"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="5dp"
|
|
||||||
android:drawablePadding="5dp"
|
android:drawablePadding="5dp"
|
||||||
app:drawableStartCompat="@drawable/ic_like"
|
app:drawableStartCompat="@drawable/ic_like"
|
||||||
app:drawableStartDimen="12dp"
|
app:drawableStartDimen="12dp"
|
||||||
@ -71,7 +69,7 @@
|
|||||||
android:id="@+id/textDislike"
|
android:id="@+id/textDislike"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:drawablePadding="5dp"
|
android:drawablePadding="5dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:drawableStartCompat="@drawable/ic_dislike"
|
app:drawableStartCompat="@drawable/ic_dislike"
|
||||||
|
@ -28,64 +28,53 @@
|
|||||||
android:id="@+id/descriptionLayout"
|
android:id="@+id/descriptionLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:animateLayoutChanges="true"/>
|
android:animateLayoutChanges="true" />
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<HorizontalScrollView
|
||||||
style="@style/Widget.Material3.CardView.Elevated"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="10dp"
|
android:paddingBottom="10dp"
|
||||||
android:layout_marginVertical="17dp"
|
android:scrollbars="none">
|
||||||
app:cardCornerRadius="27dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/optionsLL"
|
android:id="@+id/optionsLL"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:paddingHorizontal="2dp"
|
||||||
android:layout_marginHorizontal="8dp"
|
|
||||||
android:layout_marginVertical="18dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.github.libretube.ui.views.DrawableTextView
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/relPlayer_share"
|
android:id="@+id/relPlayer_share"
|
||||||
style="@style/PlayerActionsText"
|
style="@style/PlayerActionsButton"
|
||||||
android:text="@string/share"
|
android:text="@string/share"
|
||||||
app:drawableTopCompat="@drawable/ic_share" />
|
app:icon="@drawable/ic_share" />
|
||||||
|
|
||||||
<com.github.libretube.ui.views.DrawableTextView
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/relPlayer_download"
|
android:id="@+id/relPlayer_download"
|
||||||
style="@style/PlayerActionsText"
|
style="@style/PlayerActionsButton"
|
||||||
android:text="@string/download"
|
android:text="@string/download"
|
||||||
app:drawableTopCompat="@drawable/ic_download" />
|
app:icon="@drawable/ic_download" />
|
||||||
|
|
||||||
<com.github.libretube.ui.views.DrawableTextView
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/relPlayer_pip"
|
|
||||||
style="@style/PlayerActionsText"
|
|
||||||
android:text="@string/pop_up"
|
|
||||||
app:drawableTopCompat="@drawable/ic_open" />
|
|
||||||
|
|
||||||
<com.github.libretube.ui.views.DrawableTextView
|
|
||||||
android:id="@+id/relPlayer_background"
|
|
||||||
style="@style/PlayerActionsText"
|
|
||||||
android:text="@string/audio"
|
|
||||||
app:drawableTopCompat="@drawable/ic_headphones" />
|
|
||||||
|
|
||||||
<com.github.libretube.ui.views.DrawableTextView
|
|
||||||
android:id="@+id/relPlayer_save"
|
android:id="@+id/relPlayer_save"
|
||||||
style="@style/PlayerActionsText"
|
style="@style/PlayerActionsButton"
|
||||||
android:text="@string/save"
|
android:text="@string/save"
|
||||||
app:drawableTopCompat="@drawable/ic_save" />
|
app:icon="@drawable/ic_save" />
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/relPlayer_background"
|
||||||
|
style="@style/PlayerActionsButton"
|
||||||
|
android:text="@string/audio"
|
||||||
|
app:icon="@drawable/ic_headphones" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</HorizontalScrollView>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/player_channel"
|
android:id="@+id/player_channel"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="8dp"
|
android:layout_marginHorizontal="2dp"
|
||||||
android:layout_marginVertical="10dp"
|
android:layout_marginVertical="10dp"
|
||||||
android:background="@drawable/rounded_ripple"
|
android:background="@drawable/rounded_ripple"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
@ -130,14 +119,11 @@
|
|||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/player_subscribe"
|
android:id="@+id/player_subscribe"
|
||||||
style="@style/Widget.Material3.Button.ElevatedButton"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:text="@string/subscribe"
|
android:text="@string/subscribe"
|
||||||
android:textColor="?colorControlNormal"
|
android:textSize="12sp" />
|
||||||
android:textSize="12sp"
|
|
||||||
app:cornerRadius="16dp" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<com.google.android.material.card.MaterialCardView
|
||||||
@ -145,15 +131,15 @@
|
|||||||
style="@style/Widget.Material3.CardView.Elevated"
|
style="@style/Widget.Material3.CardView.Elevated"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="12dp"
|
android:layout_marginHorizontal="6dp"
|
||||||
android:layout_marginVertical="16dp"
|
android:layout_marginVertical="16dp"
|
||||||
app:cardCornerRadius="18dp">
|
app:cardCornerRadius="20dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="8dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:paddingHorizontal="8dp"
|
android:layout_marginVertical="10dp"
|
||||||
android:text="@string/comments"
|
android:text="@string/comments"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
app:drawableEndCompat="@drawable/ic_arrow_up_down" />
|
app:drawableEndCompat="@drawable/ic_arrow_up_down" />
|
||||||
@ -163,8 +149,7 @@
|
|||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/related_rec_view"
|
android:id="@+id/related_rec_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content" />
|
||||||
android:layout_marginHorizontal="12dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -242,13 +227,13 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/close_imageView"
|
android:id="@+id/close_imageView"
|
||||||
android:tooltipText="@string/tooltip_close"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:alpha="0"
|
android:alpha="0"
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
android:src="@drawable/ic_close"
|
android:src="@drawable/ic_close"
|
||||||
|
android:tooltipText="@string/tooltip_close"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/main_container"
|
app:layout_constraintBottom_toBottomOf="@id/main_container"
|
||||||
app:layout_constraintEnd_toEndOf="@id/main_container"
|
app:layout_constraintEnd_toEndOf="@id/main_container"
|
||||||
@ -256,13 +241,13 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/play_imageView"
|
android:id="@+id/play_imageView"
|
||||||
android:tooltipText="@string/tooltip_play"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:alpha="0"
|
android:alpha="0"
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
android:src="@drawable/ic_play"
|
android:src="@drawable/ic_play"
|
||||||
|
android:tooltipText="@string/tooltip_play"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/close_imageView"
|
app:layout_constraintBottom_toBottomOf="@+id/close_imageView"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/close_imageView"
|
app:layout_constraintEnd_toStartOf="@+id/close_imageView"
|
||||||
|
@ -82,6 +82,16 @@
|
|||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="PlayerActionsButton" parent="@style/Widget.Material3.Button.ElevatedButton">
|
||||||
|
|
||||||
|
<item name="android:layout_width">wrap_content</item>
|
||||||
|
<item name="android:layout_height">wrap_content</item>
|
||||||
|
<item name="android:layout_marginStart">4dp</item>
|
||||||
|
<item name="android:layout_marginEnd">4dp</item>
|
||||||
|
<item name="iconGravity">textStart</item>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="PlayerControlBottom">
|
<style name="PlayerControlBottom">
|
||||||
|
|
||||||
<item name="android:padding">9dp</item>
|
<item name="android:padding">9dp</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user