adding buttons to the videoplayer for going to next/prev file

This commit is contained in:
tibbi 2019-01-08 10:55:50 +01:00
parent 346fe5e444
commit 25131bd75b
10 changed files with 25 additions and 1 deletions

View file

@ -161,6 +161,8 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
video_curr_time.setOnClickListener { skip(false) } video_curr_time.setOnClickListener { skip(false) }
video_duration.setOnClickListener { skip(true) } video_duration.setOnClickListener { skip(true) }
video_toggle_play_pause.setOnClickListener { togglePlayPause() } video_toggle_play_pause.setOnClickListener { togglePlayPause() }
video_next_file.setOnClickListener { }
video_prev_file.setOnClickListener { }
video_player_holder.setOnTouchListener { view, event -> video_player_holder.setOnTouchListener { view, event ->
handleEvent(event) handleEvent(event)
@ -419,7 +421,7 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
} }
val newAlpha = if (isFullScreen) 0f else 1f val newAlpha = if (isFullScreen) 0f else 1f
arrayOf(video_toggle_play_pause, video_curr_time, video_seekbar, video_duration, top_shadow, video_bottom_gradient).forEach { arrayOf(video_prev_file, video_toggle_play_pause, video_next_file, video_curr_time, video_seekbar, video_duration, top_shadow, video_bottom_gradient).forEach {
it.animate().alpha(newAlpha).start() it.animate().alpha(newAlpha).start()
} }
video_seekbar.setOnSeekBarChangeListener(if (mIsFullscreen) null else this) video_seekbar.setOnSeekBarChangeListener(if (mIsFullscreen) null else this)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View file

@ -7,6 +7,17 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"> android:layout_alignParentBottom="true">
<ImageView
android:id="@+id/video_prev_file"
android:layout_width="@dimen/video_player_play_pause_size"
android:layout_height="@dimen/video_player_play_pause_size"
android:layout_alignParentStart="true"
android:layout_marginStart="@dimen/small_margin"
android:layout_marginTop="@dimen/activity_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/normal_margin"
android:src="@drawable/ic_prev_outline"/>
<ImageView <ImageView
android:id="@+id/video_toggle_play_pause" android:id="@+id/video_toggle_play_pause"
android:layout_width="@dimen/video_player_play_pause_size" android:layout_width="@dimen/video_player_play_pause_size"
@ -18,6 +29,17 @@
android:src="@drawable/ic_pause_outline" android:src="@drawable/ic_pause_outline"
android:visibility="invisible"/> android:visibility="invisible"/>
<ImageView
android:id="@+id/video_next_file"
android:layout_width="@dimen/video_player_play_pause_size"
android:layout_height="@dimen/video_player_play_pause_size"
android:layout_alignParentEnd="true"
android:layout_marginTop="@dimen/activity_margin"
android:layout_marginEnd="@dimen/small_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/normal_margin"
android:src="@drawable/ic_next_outline"/>
<TextView <TextView
android:id="@+id/video_curr_time" android:id="@+id/video_curr_time"
android:layout_width="wrap_content" android:layout_width="wrap_content"