Commit ea5ebcf6 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Geoffrey Métais

Close button for video player playlist

parent e0718570
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#ffffff"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/player_root"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
......@@ -95,7 +96,30 @@
android:background="@color/playerbackground"
android:id="@+id/video_playlist_container"
android:visibility="gone"
android:layout_height="match_parent">
android:layout_height="match_parent"
tools:visibility="visible">
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:id="@+id/view"
android:background="@color/playerbackground"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/video_playlist"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_close_small"
android:background="?attr/selectableItemBackgroundBorderless"
android:id="@+id/close_button"
android:padding="8dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="8dp"
app:layout_constraintBottom_toBottomOf="@+id/view"/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/playlist_search_text"
......@@ -103,13 +127,12 @@
android:layout_height="wrap_content"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:background="@color/playerbackground"
android:paddingTop="4dp"
android:paddingBottom="2dp">
android:paddingTop="0dp"
app:layout_constraintStart_toEndOf="@+id/close_button"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
>
<EditText
android:layout_width="match_parent"
......
......@@ -125,6 +125,7 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
private var videoUri: Uri? = null
private var askResume = true
private lateinit var closeButton: View
private lateinit var playlistContainer: View
private lateinit var playlist: RecyclerView
private lateinit var playlistSearchText: TextInputLayout
......@@ -428,6 +429,7 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
playlist = findViewById(R.id.video_playlist)
playlistSearchText = findViewById(R.id.playlist_search_text)
playlistContainer = findViewById(R.id.video_playlist_container)
closeButton = findViewById(R.id.close_button)
playlistSearchText.editText?.addTextChangedListener(this)
......@@ -826,6 +828,7 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
hudBinding.playlistNext.setVisible()
}
hudRightBinding.playlistToggle.setOnClickListener(this@VideoPlayerActivity)
closeButton.setOnClickListener { togglePlaylist() }
val callback = SwipeDragItemTouchHelperCallback(playlistAdapter)
val touchHelper = ItemTouchHelper(callback)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment