add buttons to insert values to playlist
This commit is contained in:
parent
8f78d72a13
commit
99b79816f0
|
@ -75,6 +75,18 @@ class MainActivity : AppCompatActivity() {
|
|||
newPlayer.playStream("portrait", PlayMode.EMBEDDED_VIDEO)
|
||||
}
|
||||
|
||||
binding.add6502StreamButton.setOnClickListener {
|
||||
newPlayer.addToPlaylist("6502")
|
||||
}
|
||||
|
||||
binding.addImuStreamButton.setOnClickListener {
|
||||
newPlayer.addToPlaylist("imu")
|
||||
}
|
||||
|
||||
binding.addPortraitStreamButton.setOnClickListener {
|
||||
newPlayer.addToPlaylist("portrait")
|
||||
}
|
||||
|
||||
videoPlayerViewModel.newPlayer = newPlayer
|
||||
videoPlayerViewModel.contentFitMode = ContentScale.FIT_INSIDE
|
||||
|
||||
|
|
|
@ -62,8 +62,7 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
<ScrollView
|
||||
android:id="@+id/buttons_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -74,28 +73,58 @@
|
|||
app:layout_constraintStart_toEndOf="@id/embedded_player_layout"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/start_6502_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Start 6502 Stream" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/start_imu_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Start IMU Stream" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/start_portrait_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Start Landscape Stream" />
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<Button
|
||||
android:id="@+id/start_6502_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Start 6502 Stream" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/start_imu_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Start IMU Stream" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/start_portrait_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Start Portrait Stream" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_6502_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:backgroundTint="@color/material_dynamic_primary50"
|
||||
android:text="Append 6502 Stream" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_imu_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:backgroundTint="@color/material_dynamic_primary50"
|
||||
android:text="Append IMU Stream" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_portrait_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:backgroundTint="@color/material_dynamic_primary50"
|
||||
android:text="Append Portrait Stream" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,5 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- NewPlayer
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- NewPlayer
|
||||
|
||||
@author Christian Schabesberger
|
||||
|
||||
|
@ -33,8 +32,8 @@
|
|||
android:layout_height="match_parent"
|
||||
android:minHeight="50dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
@ -63,39 +62,70 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
<ScrollView
|
||||
android:id="@id/buttons_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/embedded_player_layout"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/embedded_player_layout"
|
||||
app:layout_constraintVertical_weight="1">
|
||||
|
||||
<Button
|
||||
android:id="@+id/start_6502_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Start 6502 Stream" />
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/start_imu_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Start IMU Stream" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/start_portrait_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Start Landscape Stream" />
|
||||
<Button
|
||||
android:id="@+id/start_6502_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Start 6502 Stream" />
|
||||
|
||||
</LinearLayout>
|
||||
<Button
|
||||
android:id="@+id/start_imu_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Start IMU Stream" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/start_portrait_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Start Portrait Stream" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_6502_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Append 6502 Stream"
|
||||
android:backgroundTint="@color/material_dynamic_primary50"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_imu_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Append IMU Stream"
|
||||
android:backgroundTint="@color/material_dynamic_primary50"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_portrait_stream_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="Append Portrait Stream"
|
||||
android:backgroundTint="@color/material_dynamic_primary50"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in New Issue