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

Video player reorganization

parent 008a1f12
......@@ -5,17 +5,17 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="24" height="24" id="svg4682"
version="1.1" inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="ic_more_h_nomarge_player.svg"
version="1.1" inkscape:version="0.92.4 (33fec40, 2019-01-16)"
sodipodi:docname="ic_advanced_player.svg"
inkscape:export-filename="/home/corbax/Dev/android/Icons/Test 1/ic_play_normal.png"
inkscape:export-xdpi="90" inkscape:export-ydpi="90">
<defs id="defs4684" />
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0"
inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="11.2"
inkscape:cx="6.3072819" inkscape:cy="8.4561666" inkscape:document-units="px"
inkscape:current-layer="layer1" showgrid="true" inkscape:window-width="1600"
inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27"
inkscape:window-maximized="1">
inkscape:cx="19.075429" inkscape:cy="12.618746" inkscape:document-units="px"
inkscape:current-layer="layer1" showgrid="true" inkscape:window-width="1043"
inkscape:window-height="744" inkscape:window-x="2476" inkscape:window-y="204"
inkscape:window-maximized="0">
<inkscape:grid type="xygrid" id="grid3956" empspacing="4" visible="true" enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
......@@ -24,15 +24,15 @@
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1"
transform="translate(0,-1028.3622)">
<path
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;vector-effect:none;fill:#212121;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:markers fill stroke;enable-background:accumulate"
d="m 3,1037.3622 a 3,3 0 0 0 -3,3 3,3 0 0 0 3,3 3,3 0 0 0 3,-3 3,3 0 0 0 -3,-3 z m 9,0 a 3,3 0 0 0 -3,3 3,3 0 0 0 3,3 3,3 0 0 0 3,-3 3,3 0 0 0 -3,-3 z m 9,0 a 3,3 0 0 0 -3,3 3,3 0 0 0 3,3 3,3 0 0 0 3,-3 3,3 0 0 0 -3,-3 z"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;vector-effect:none;fill:#212121;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.125;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:markers fill stroke;enable-background:accumulate"
d="m 5.25,1038.1122 a 2.25,2.25 0 0 0 -2.25,2.25 2.25,2.25 0 0 0 2.25,2.25 2.25,2.25 0 0 0 2.25,-2.25 2.25,2.25 0 0 0 -2.25,-2.25 z m 6.75,0 a 2.25,2.25 0 0 0 -2.25,2.25 2.25,2.25 0 0 0 2.25,2.25 2.25,2.25 0 0 0 2.25,-2.25 2.25,2.25 0 0 0 -2.25,-2.25 z m 6.75,0 a 2.25,2.25 0 0 0 -2.25,2.25 2.25,2.25 0 0 0 2.25,2.25 2.25,2.25 0 0 0 2.25,-2.25 2.25,2.25 0 0 0 -2.25,-2.25 z"
id="path7861" inkscape:connector-curvature="0" />
</g>
</svg>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="28dp"
android:height="28dp"
android:width="36dp"
android:height="36dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillAlpha="1"
android:fillColor="?attr/player_icon_color"
android:fillType="nonZero"
android:pathData="m3,9a3,3 0,0 0,-3 3,3 3,0 0,0 3,3 3,3 0,0 0,3 -3,3 3,0 0,0 -3,-3zM12,9a3,3 0,0 0,-3 3,3 3,0 0,0 3,3 3,3 0,0 0,3 -3,3 3,0 0,0 -3,-3zM21,9a3,3 0,0 0,-3 3,3 3,0 0,0 3,3 3,3 0,0 0,3 -3,3 3,0 0,0 -3,-3z"
android:strokeWidth="1.5"
android:pathData="m5.25,9.75a2.25,2.25 0,0 0,-2.25 2.25,2.25 2.25,0 0,0 2.25,2.25 2.25,2.25 0,0 0,2.25 -2.25,2.25 2.25,0 0,0 -2.25,-2.25zM12,9.75a2.25,2.25 0,0 0,-2.25 2.25,2.25 2.25,0 0,0 2.25,2.25 2.25,2.25 0,0 0,2.25 -2.25,2.25 2.25,0 0,0 -2.25,-2.25zM18.75,9.75a2.25,2.25 0,0 0,-2.25 2.25,2.25 2.25,0 0,0 2.25,2.25 2.25,2.25 0,0 0,2.25 -2.25,2.25 2.25,0 0,0 -2.25,-2.25z"
android:strokeWidth="1.125"
android:strokeAlpha="1"
android:strokeColor="#00000000"
android:strokeLineCap="round"
......
......@@ -25,6 +25,7 @@
android:paddingTop="@dimen/overlay_padding_top"
android:paddingBottom="@dimen/overlay_padding_bottom"
android:visibility="invisible"
tools:theme="@style/Theme.VLC.TV"
tools:visibility="visible">
<TextView
......@@ -39,10 +40,23 @@
android:textAppearance="@style/TextAppearance.AppCompat.SearchResult.Title"
android:textSize="16sp"
tools:text="Game of Thrones S01-E01"
vlc:layout_constraintEnd_toStartOf="@+id/player_overlay_adv_function"
vlc:layout_constraintEnd_toStartOf="@+id/orientation_toggle"
vlc:layout_constraintStart_toStartOf="parent"
vlc:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/orientation_toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:visibility="gone"
tools:visibility="visible"
vlc:layout_constraintEnd_toStartOf="@+id/player_overlay_adv_function"
vlc:layout_constraintTop_toTopOf="parent"
vlc:srcCompat="@drawable/ic_rotate_player" />
<ImageView
android:id="@+id/player_overlay_adv_function"
android:layout_width="wrap_content"
......@@ -54,9 +68,9 @@
android:focusable="true"
android:onClick="@{(v) -> player.showAdvancedOptions()}"
android:scaleType="center"
vlc:layout_constraintBottom_toBottomOf="@+id/player_overlay_title"
tools:visibility="visible"
vlc:layout_constraintEnd_toEndOf="parent"
vlc:layout_constraintTop_toTopOf="@+id/player_overlay_title"
vlc:layout_constraintTop_toTopOf="parent"
vlc:srcCompat="@drawable/ic_advanced_player" />
<SeekBar
......@@ -64,6 +78,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/seek_margin_sides"
android:layout_marginTop="8dp"
android:layout_marginEnd="@dimen/seek_margin_sides"
android:focusable="true"
android:layoutDirection="ltr"
......@@ -88,6 +103,7 @@
android:layout_marginBottom="8dp"
vlc:layout_constraintBottom_toBottomOf="parent"
vlc:layout_constraintEnd_toStartOf="@+id/lock_overlay_button"
vlc:layout_constraintHorizontal_bias="0.5"
vlc:layout_constraintHorizontal_chainStyle="spread_inside"
vlc:layout_constraintStart_toStartOf="parent"
vlc:layout_constraintTop_toBottomOf="@+id/player_overlay_seekbar">
......@@ -117,32 +133,14 @@
android:onClick="@{(v) -> player.toggleLock()}"
android:padding="2dp"
android:scaleType="center"
tools:visibility="visible"
vlc:layout_constraintBottom_toBottomOf="parent"
vlc:layout_constraintEnd_toStartOf="@+id/player_overlay_tracks"
vlc:layout_constraintEnd_toStartOf="@+id/playlist_previous"
vlc:layout_constraintHorizontal_bias="0.5"
vlc:layout_constraintStart_toEndOf="@+id/player_overlay_time_container"
vlc:layout_constraintTop_toBottomOf="@+id/player_overlay_seekbar"
vlc:srcCompat="@drawable/ic_lock_player" />
<ImageView
android:id="@+id/player_overlay_tracks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/tracks"
android:focusable="true"
android:onClick="@{player::onAudioSubClick}"
android:padding="2dp"
android:scaleType="center"
vlc:layout_constraintBottom_toBottomOf="parent"
vlc:layout_constraintEnd_toStartOf="@+id/playlist_previous"
vlc:layout_constraintHorizontal_bias="0.5"
vlc:layout_constraintStart_toEndOf="@+id/lock_overlay_button"
vlc:layout_constraintTop_toBottomOf="@+id/player_overlay_seekbar"
vlc:srcCompat="@drawable/ic_audiotrack_player" />
<ImageView
android:id="@+id/playlist_previous"
android:layout_width="wrap_content"
......@@ -161,7 +159,7 @@
vlc:layout_constraintBottom_toBottomOf="parent"
vlc:layout_constraintEnd_toStartOf="@+id/player_overlay_rewind"
vlc:layout_constraintHorizontal_bias="0.5"
vlc:layout_constraintStart_toEndOf="@+id/player_overlay_tracks"
vlc:layout_constraintStart_toEndOf="@+id/lock_overlay_button"
vlc:layout_constraintTop_toBottomOf="@+id/player_overlay_seekbar"
vlc:srcCompat="@drawable/ic_previous_player" />
......@@ -199,6 +197,7 @@
android:onLongClick="@{player::toggleLoop}"
android:padding="2dp"
android:scaleType="fitCenter"
tools:visibility="visible"
vlc:layout_constraintBottom_toBottomOf="parent"
vlc:layout_constraintEnd_toStartOf="@+id/player_overlay_forward"
vlc:layout_constraintHorizontal_bias="0.5"
......@@ -243,47 +242,32 @@
android:visibility="gone"
tools:visibility="visible"
vlc:layout_constraintBottom_toBottomOf="parent"
vlc:layout_constraintEnd_toStartOf="@+id/orientation_toggle"
vlc:layout_constraintEnd_toStartOf="@+id/player_overlay_tracks"
vlc:layout_constraintHorizontal_bias="0.5"
vlc:layout_constraintStart_toEndOf="@+id/player_overlay_forward"
vlc:layout_constraintTop_toBottomOf="@+id/player_overlay_seekbar"
vlc:srcCompat="@drawable/ic_next_player" />
<ImageView
android:id="@+id/orientation_toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:padding="2dp"
android:visibility="gone"
tools:visibility="visible"
vlc:layout_constraintBottom_toBottomOf="parent"
vlc:layout_constraintEnd_toStartOf="@+id/player_overlay_size"
vlc:layout_constraintHorizontal_bias="0.5"
vlc:layout_constraintStart_toEndOf="@+id/playlist_next"
vlc:layout_constraintTop_toBottomOf="@+id/player_overlay_seekbar"
vlc:srcCompat="@drawable/ic_rotate_player" />
<ImageView
android:id="@+id/player_overlay_size"
android:id="@+id/player_overlay_tracks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/resize"
android:clickable="true"
android:contentDescription="@string/tracks"
android:focusable="true"
android:onClick="@{(v) -> player.resizeVideo()}"
android:onClick="@{player::onAudioSubClick}"
android:padding="2dp"
android:scaleType="center"
tools:visibility="visible"
vlc:layout_constraintBottom_toBottomOf="parent"
vlc:layout_constraintEnd_toStartOf="@+id/player_overlay_length_container"
vlc:layout_constraintHorizontal_bias="0.5"
vlc:layout_constraintStart_toEndOf="@+id/orientation_toggle"
vlc:layout_constraintStart_toEndOf="@+id/playlist_next"
vlc:layout_constraintTop_toBottomOf="@+id/player_overlay_seekbar"
vlc:srcCompat="@drawable/ic_crop_player" />
vlc:srcCompat="@drawable/ic_audiotrack_player" />
<FrameLayout
android:id="@+id/player_overlay_length_container"
......@@ -293,7 +277,8 @@
android:layout_marginBottom="8dp"
vlc:layout_constraintBottom_toBottomOf="parent"
vlc:layout_constraintEnd_toEndOf="parent"
vlc:layout_constraintStart_toEndOf="@+id/player_overlay_size"
vlc:layout_constraintHorizontal_bias="0.5"
vlc:layout_constraintStart_toEndOf="@+id/player_overlay_tracks"
vlc:layout_constraintTop_toBottomOf="@+id/player_overlay_seekbar">
<TextView
......
......@@ -3,14 +3,16 @@
android:id="@+id/options_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/options_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|end"
android:clipToPadding="false"
android:paddingBottom="@dimen/default_margin"
android:paddingTop="@dimen/default_margin"
android:background="?attr/rounded_bg" />
android:clickable="true"
android:focusable="false">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/options_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|end"
android:background="?attr/rounded_bg"
android:clipToPadding="false"
android:paddingTop="@dimen/default_margin"
android:paddingBottom="@dimen/default_margin" />
</FrameLayout>
......@@ -73,6 +73,7 @@
<attr name="ic_abrepeat_reset" format="reference" />
<attr name="ic_abrepeat_seta" format="reference" />
<attr name="ic_abrepeat_setb" format="reference" />
<attr name="ic_crop_player" format="reference" />
<attr name="ic_dial" format="reference" />
<attr name="player_icon_color" format="reference" />
......
......@@ -335,6 +335,7 @@
<item name="ic_abrepeat_setb">@drawable/ic_abrepeat_setb_w</item>
<item name="ic_abrepeat_reset">@drawable/ic_abrepeat_reset_w</item>
<item name="ic_dial">@drawable/ic_dial_w</item>
<item name="ic_crop_player">@drawable/ic_crop_player</item>
<item name="android:colorControlHighlight">@color/orange500</item>
<item name="colorControlHighlight">@color/orange500</item>
<item name="player_icon_color">@color/grey50</item>
......
......@@ -54,6 +54,7 @@ private const val ID_REPEAT = 10
private const val ID_SHUFFLE = 11
private const val ID_PASSTHROUGH = 12
private const val ID_ABREPEAT = 13
private const val ID_OVERLAY_SIZE = 14
@ObsoleteCoroutinesApi
@ExperimentalCoroutinesApi
......@@ -104,6 +105,8 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
options.add(PlayerOption(playerOptionType, ID_PLAY_AS_AUDIO, R.attr.ic_playasaudio_on, res.getString(R.string.play_as_audio)))
if (primary && AndroidDevices.pipAllowed && !AndroidDevices.isDex(activity))
options.add(PlayerOption(playerOptionType, ID_POPUP_VIDEO, R.attr.ic_popup_dim, res.getString(R.string.ctx_pip_title)))
if (primary)
options.add(PlayerOption(playerOptionType, ID_OVERLAY_SIZE, R.attr.ic_crop_player, res.getString(R.string.resize)))
options.add(PlayerOption(playerOptionType, ID_REPEAT, R.attr.ic_repeat, res.getString(R.string.repeat_title)))
if (service.canShuffle()) options.add(PlayerOption(playerOptionType, ID_SHUFFLE, R.attr.ic_shuffle, res.getString(R.string.shuffle_title)))
val chaptersCount = service.getChapters(-1)?.size ?: 0
......@@ -181,6 +184,9 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
(activity as VideoPlayerActivity).switchToPopup()
hide()
}
ID_OVERLAY_SIZE -> {
(activity as VideoPlayerActivity).resizeVideo()
}
ID_REPEAT -> setRepeatMode()
ID_SHUFFLE -> {
service.shuffle()
......
......@@ -1340,7 +1340,6 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
hudBinding.playerOverlayTime.isEnabled = false
hudBinding.playerOverlaySeekbar.isEnabled = false
hudBinding.playerOverlayLength.isEnabled = false
hudBinding.playerOverlaySize.isEnabled = false
hudBinding.playlistNext.isEnabled = false
hudBinding.playlistPrevious.isEnabled = false
}
......@@ -1361,7 +1360,6 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
hudBinding.playerOverlayTime.isEnabled = true
hudBinding.playerOverlaySeekbar.isEnabled = service?.isSeekable != false
hudBinding.playerOverlayLength.isEnabled = true
hudBinding.playerOverlaySize.isEnabled = true
hudBinding.playlistNext.isEnabled = true
hudBinding.playlistPrevious.isEnabled = true
}
......@@ -2141,7 +2139,6 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
hudBinding.playerOverlayRewind.visibility = if (show) View.VISIBLE else View.INVISIBLE
hudBinding.playerOverlayForward.visibility = if (show) View.VISIBLE else View.INVISIBLE
}
if (displayManager.isPrimary) hudBinding.playerOverlaySize.visibility = if (show) View.VISIBLE else View.INVISIBLE
hudBinding.playerOverlayTracks.visibility = if (show) View.VISIBLE else View.INVISIBLE
hudBinding.playerOverlayAdvFunction.visibility = if (show) View.VISIBLE else View.INVISIBLE
if (hasPlaylist) {
......@@ -2211,7 +2208,7 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
controlsConstraintSetPortrait.setMargin(R.id.player_overlay_length_container, ConstraintSet.END, resources.getDimensionPixelSize(R.dimen.time_margin_sides))
val chainIds = arrayOf(R.id.lock_overlay_button, R.id.player_overlay_tracks, R.id.playlist_previous, R.id.player_overlay_rewind, R.id.player_overlay_play, R.id.player_overlay_forward, R.id.playlist_next, R.id.orientation_toggle, R.id.player_overlay_size)
val chainIds = arrayOf(R.id.lock_overlay_button, R.id.playlist_previous, R.id.player_overlay_rewind, R.id.player_overlay_play, R.id.player_overlay_forward, R.id.playlist_next, R.id.player_overlay_tracks)
chainIds.forEach {
controlsConstraintSetPortrait.clear(it, ConstraintSet.START)
......@@ -2235,7 +2232,6 @@ open class VideoPlayerActivity : AppCompatActivity(), IPlaybackSettingsControlle
initPlaylistUi()
if (!displayManager.isPrimary) {
hudBinding.lockOverlayButton.setGone()
hudBinding.playerOverlaySize.setGone()
}
......
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