add episode list arrow

This commit is contained in:
Quickdesh 2023-05-31 16:59:07 +05:30
parent 9ec278bfab
commit cd7d8d1ecf
4 changed files with 50 additions and 16 deletions

View file

@ -474,11 +474,7 @@ class PlayerActivity :
width = height.also { height = width }
}
playerControls.binding.titleMainTxt.updateLayoutParams<ConstraintLayout.LayoutParams> {
rightToLeft = playerControls.binding.toggleAutoplay.id
rightToRight = ConstraintLayout.LayoutParams.UNSET
}
playerControls.binding.titleSecondaryTxt.updateLayoutParams<ConstraintLayout.LayoutParams> {
playerControls.binding.episodeListBtn.updateLayoutParams<ConstraintLayout.LayoutParams> {
rightToLeft = playerControls.binding.toggleAutoplay.id
rightToRight = ConstraintLayout.LayoutParams.UNSET
}
@ -488,24 +484,20 @@ class PlayerActivity :
}
playerControls.binding.toggleAutoplay.updateLayoutParams<ConstraintLayout.LayoutParams> {
leftToLeft = ConstraintLayout.LayoutParams.UNSET
leftToRight = playerControls.binding.titleMainTxt.id
leftToRight = playerControls.binding.episodeListBtn.id
}
} else {
if (width >= height) {
width = height.also { height = width }
}
playerControls.binding.titleMainTxt.updateLayoutParams<ConstraintLayout.LayoutParams> {
rightToLeft = ConstraintLayout.LayoutParams.UNSET
rightToRight = ConstraintLayout.LayoutParams.PARENT_ID
}
playerControls.binding.titleSecondaryTxt.updateLayoutParams<ConstraintLayout.LayoutParams> {
playerControls.binding.episodeListBtn.updateLayoutParams<ConstraintLayout.LayoutParams> {
rightToLeft = ConstraintLayout.LayoutParams.UNSET
rightToRight = ConstraintLayout.LayoutParams.PARENT_ID
}
playerControls.binding.playerOverflow.updateLayoutParams<ConstraintLayout.LayoutParams> {
topToTop = ConstraintLayout.LayoutParams.UNSET
topToBottom = playerControls.binding.backArrowBtn.id
topToBottom = playerControls.binding.episodeListBtn.id
}
playerControls.binding.toggleAutoplay.updateLayoutParams<ConstraintLayout.LayoutParams> {
leftToLeft = ConstraintLayout.LayoutParams.PARENT_ID

View file

@ -184,6 +184,18 @@ class PlayerControlsView @JvmOverloads constructor(context: Context, attrs: Attr
binding.toggleAutoplay.setOnCheckedChangeListener { _, isChecked ->
activity.toggleAutoplay(isChecked)
}
binding.titleMainTxt.setOnClickListener {
episodeListDialog()
}
binding.titleSecondaryTxt.setOnClickListener {
episodeListDialog()
}
binding.episodeListBtn.setOnClickListener {
episodeListDialog()
}
}
private val animationHandler = Handler(Looper.getMainLooper())
@ -455,4 +467,7 @@ class PlayerControlsView @JvmOverloads constructor(context: Context, attrs: Attr
show()
}
}
private fun episodeListDialog() {
}
}

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/black"
android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z" />
</vector>

View file

@ -68,23 +68,41 @@
android:textColor="?attr/colorOnPrimarySurface"
android:textSize="16sp"
android:textStyle="bold"
android:clickable="true"
android:focusable="true"
app:layout_constraintLeft_toRightOf="@id/backArrowBtn"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintRight_toLeftOf="@id/episodeListBtn"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/titleSecondaryTxt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:layout_marginLeft="10dp"
android:alpha="0.5"
android:text=""
android:textColor="?attr/colorOnPrimarySurface"
android:textSize="12sp"
android:clickable="true"
android:focusable="true"
app:layout_constraintLeft_toRightOf="@id/backArrowBtn"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintRight_toLeftOf="@id/episodeListBtn"
app:layout_constraintTop_toBottomOf="@id/titleMainTxt" />
<ImageButton
android:id="@+id/episodeListBtn"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="@android:color/transparent"
android:contentDescription="Episode list"
android:src="@drawable/ic_navigate_next_24dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toRightOf="@id/titleMainTxt"
app:layout_constraintRight_toRightOf="parent"
app:tint="?attr/colorOnPrimarySurface" />
<!-- Top Controls (Left)-->
<ImageButton
@ -99,7 +117,7 @@
android:src="@drawable/ic_overflow_24dp"
app:layout_constraintLeft_toRightOf="@id/qualityBtn"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/backArrowBtn"
app:layout_constraintTop_toBottomOf="@id/episodeListBtn"
app:tint="?attr/colorOnPrimarySurface" />
<ImageButton