Commit 68d1a1fc authored by Nicolas Pomepuy's avatar Nicolas Pomepuy

Fix audio player button alignment

parent 8afbde01
......@@ -11,176 +11,178 @@
name="showCover"
type="boolean" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/content_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/background_default_darker"
android:clickable="true"
android:keyboardNavigationCluster="true"
tools:targetApi="o"
android:focusable="true">
android:id="@+id/content_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/background_default_darker"
android:clickable="true"
android:keyboardNavigationCluster="true"
tools:targetApi="o"
android:focusable="true">
<ImageView
android:id="@+id/backgroundView"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="?attr/background_default_darker"
android:scaleType="centerCrop" />
android:id="@+id/backgroundView"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="?attr/background_default_darker"
android:scaleType="centerCrop"/>
<ProgressBar
android:id="@+id/progressBar"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layoutDirection="ltr"
android:focusable="false"
android:indeterminate="false"
android:maxHeight="1dip"
android:minHeight="1dip"
android:paddingLeft="0px"
android:paddingRight="0px"
android:progressDrawable="?attr/progress_mini_player" />
android:id="@+id/progressBar"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layoutDirection="ltr"
android:focusable="false"
android:indeterminate="false"
android:maxHeight="1dip"
android:minHeight="1dip"
android:paddingLeft="0px"
android:paddingRight="0px"
android:progressDrawable="?attr/progress_mini_player"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/header"
android:layout_width="0dp"
android:layout_height="60dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressBar"
android:fitsSystemWindows="true"
android:background="?attr/background_default_darker" >
android:id="@+id/header"
android:layout_width="0dp"
android:layout_height="60dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressBar"
android:fitsSystemWindows="true"
android:background="?attr/background_default_darker">
<ImageView
android:id="@+id/playlist_playasaudio_off"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginStart="@dimen/default_margin"
android:contentDescription="@string/play_as_audio"
android:focusable="true"
android:onClick="@{fragment::onResumeToVideoClick}"
android:scaleType="fitXY"
android:src="?attr/ic_playasaudio_off"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:visibility="visible" />
android:id="@+id/playlist_playasaudio_off"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginStart="@dimen/default_margin"
android:contentDescription="@string/play_as_audio"
android:focusable="true"
android:onClick="@{fragment::onResumeToVideoClick}"
android:scaleType="fitXY"
android:src="?attr/ic_playasaudio_off"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:visibility="visible"/>
<org.videolan.vlc.gui.view.HeaderMediaSwitcher
android:id="@+id/audio_media_switcher"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@+id/playlist_playasaudio_off"
app:layout_constraintEnd_toStartOf="@+id/barrier"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="#00000000" />
android:id="@+id/audio_media_switcher"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@+id/playlist_playasaudio_off"
app:layout_constraintEnd_toStartOf="@+id/barrier"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="#00000000"/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/playlist_search_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="8dp"
android:focusable="true"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@+id/header_play_pause"
app:layout_constraintStart_toEndOf="@+id/playlist_playasaudio_off"
app:layout_constraintTop_toTopOf="parent">
android:id="@+id/playlist_search_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="8dp"
android:focusable="true"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="@+id/header_play_pause"
app:layout_constraintStart_toEndOf="@+id/playlist_playasaudio_off"
app:layout_constraintTop_toTopOf="parent">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/search_hint"
android:imeOptions="actionSearch"
android:inputType="textFilter" />
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/search_hint"
android:imeOptions="actionSearch"
android:inputType="textFilter"/>
</com.google.android.material.textfield.TextInputLayout>
<ImageView
android:id="@+id/playlist_search"
android:layout_width="32dp"
android:layout_height="32dp"
app:layout_constraintEnd_toStartOf="@+id/playlist_switch"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginEnd="8dp"
android:focusable="true"
android:scaleType="fitXY"
android:onClick="@{fragment::onSearchClick}"
android:contentDescription="@string/search"
android:src="?attr/ic_menu_search" />
android:id="@+id/playlist_search"
android:layout_width="32dp"
android:layout_height="32dp"
app:layout_constraintEnd_toStartOf="@+id/playlist_switch"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginEnd="8dp"
android:focusable="true"
android:scaleType="fitXY"
android:onClick="@{fragment::onSearchClick}"
android:contentDescription="@string/search"
android:src="?attr/ic_menu_search"/>
<ImageView
android:id="@+id/playlist_switch"
android:layout_width="32dp"
android:layout_height="32dp"
app:layout_constraintEnd_toStartOf="@+id/adv_function"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:focusable="true"
android:scaleType="fitXY"
android:onClick="@{fragment::onPlaylistSwitchClick}"
android:contentDescription="@string/show_playlist"
android:src="?attr/ic_playlist_on" />
android:id="@+id/playlist_switch"
android:layout_width="32dp"
android:layout_height="32dp"
app:layout_constraintEnd_toStartOf="@+id/adv_function"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:focusable="true"
android:scaleType="fitXY"
android:onClick="@{fragment::onPlaylistSwitchClick}"
android:contentDescription="@string/show_playlist"
android:src="?attr/ic_playlist_on"/>
<ImageView
android:id="@+id/adv_function"
android:layout_width="40dp"
android:layout_height="40dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:focusable="true"
android:onClick="@{fragment::showAdvancedOptions}"
android:contentDescription="@string/advanced"
android:src="?attr/ic_audio_player_more" />
android:id="@+id/adv_function"
android:layout_width="40dp"
android:layout_height="40dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:focusable="true"
android:onClick="@{fragment::showAdvancedOptions}"
android:contentDescription="@string/advanced"
android:src="?attr/ic_audio_player_more"/>
<TextView
android:id="@+id/header_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toStartOf="@+id/header_play_pause"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginLeft="@dimen/default_margin"
android:layout_marginRight="@dimen/default_margin"
android:clickable="true"
android:onClick="@{fragment::onTimeLabelClick}"
android:text="@string/time_0"
android:textColor="?attr/audio_player_header_time"
android:textSize="18sp" />
android:id="@+id/header_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toStartOf="@+id/header_play_pause"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginLeft="@dimen/default_margin"
android:layout_marginRight="@dimen/default_margin"
android:clickable="true"
android:onClick="@{fragment::onTimeLabelClick}"
android:text="@string/time_0"
android:textColor="?attr/audio_player_header_time"
android:textSize="18sp"/>
<ImageView
android:id="@+id/header_play_pause"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginEnd="@dimen/default_margin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:contentDescription="@string/play"
android:focusable="true"
android:scaleType="fitXY"
android:onClick="@{fragment::onPlayPauseClick}"
android:onLongClick="@{fragment::onStopClick}" />
android:id="@+id/header_play_pause"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginEnd="@dimen/default_margin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:contentDescription="@string/play"
android:focusable="true"
android:scaleType="fitXY"
android:onClick="@{fragment::onPlayPauseClick}"
android:onLongClick="@{fragment::onStopClick}"/>
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:barrierDirection="start"
app:constraint_referenced_ids="header_time, playlist_search"/>
android:id="@+id/barrier"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:barrierDirection="start"
app:constraint_referenced_ids="header_time, playlist_search"/>
</androidx.constraintlayout.widget.ConstraintLayout>
......@@ -201,24 +203,25 @@
app:layout_constraintBottom_toTopOf="@+id/bottom_bar"/>
<org.videolan.vlc.gui.view.CoverMediaSwitcher
android:id="@+id/cover_media_switcher"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/header"
app:layout_constraintBottom_toTopOf="@+id/play_pause"
android:layout_margin="@dimen/audio_player_cover_margin"
android:visibility="@{showCover ? View.VISIBLE : View.GONE}"
tools:layout_constraintLeft_creator="1" />
android:id="@+id/cover_media_switcher"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/header"
app:layout_constraintBottom_toTopOf="@+id/play_pause"
android:layout_margin="@dimen/audio_player_cover_margin"
android:visibility="@{showCover ? View.VISIBLE : View.GONE}"
tools:layout_constraintLeft_creator="1"/>
<include layout="@layout/shadow_top"
android:layout_width="0dp"
android:layout_height="6dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/header" />
<include
layout="@layout/shadow_top"
android:layout_width="0dp"
android:layout_height="6dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/header"/>
<View
......@@ -282,34 +285,36 @@
/>
<ImageView
android:id="@+id/shuffle"
android:layout_width="40dp"
android:layout_height="40dp"
app:layout_constraintLeft_toLeftOf="@+id/time"
app:layout_constraintRight_toLeftOf="@+id/previous"
app:layout_constraintBottom_toBottomOf="@+id/play_pause"
app:layout_constraintTop_toTopOf="@+id/play_pause"
app:layout_constraintHorizontal_chainStyle="spread_inside"
android:contentDescription="@string/shuffle_title"
android:focusable="true"
android:scaleType="fitXY"
app:srcCompat="@drawable/ic_shuffle"
android:onClick="@{fragment::onShuffleClick}"/>
android:id="@+id/shuffle"
android:layout_width="40dp"
android:layout_height="40dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/play_pause"
app:layout_constraintTop_toTopOf="@+id/play_pause"
app:layout_constraintHorizontal_chainStyle="spread_inside"
android:contentDescription="@string/shuffle_title"
android:focusable="true"
android:scaleType="fitXY"
app:srcCompat="@drawable/ic_shuffle"
android:onClick="@{fragment::onShuffleClick}"
android:layout_marginStart="16dp"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintEnd_toStartOf="@+id/previous"/>
<ImageView
android:id="@+id/repeat"
android:layout_width="40dp"
android:layout_height="40dp"
app:layout_constraintRight_toRightOf="@+id/length"
app:layout_constraintLeft_toRightOf="@+id/next"
app:layout_constraintBottom_toBottomOf="@+id/play_pause"
app:layout_constraintTop_toTopOf="@+id/play_pause"
android:layout_marginEnd="@dimen/default_margin"
android:contentDescription="@string/repeat_title"
android:focusable="true"
android:onClick="@{fragment::onRepeatClick}"
android:scaleType="fitXY"
app:srcCompat="@drawable/ic_repeat"/>
android:id="@+id/previous"
android:layout_width="40dp"
android:layout_height="40dp"
app:layout_constraintBottom_toBottomOf="@+id/play_pause"
app:layout_constraintTop_toTopOf="@+id/play_pause"
android:contentDescription="@string/previous"
android:focusable="true"
android:scaleType="fitXY"
android:onClick="@{fragment::onPreviousClick}"
android:src="?attr/ic_previous"
app:layout_constraintStart_toEndOf="@+id/shuffle"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintEnd_toStartOf="@+id/play_pause"/>
<ImageView
android:id="@+id/play_pause"
......@@ -321,46 +326,51 @@
android:onClick="@{fragment::onPlayPauseClick}"
android:onLongClick="@{fragment::onStopClick}"
android:scaleType="fitXY"
app:layout_constraintLeft_toRightOf="@+id/previous"
app:layout_constraintRight_toLeftOf="@+id/next"
app:layout_constraintBottom_toBottomOf="@+id/backgroundView"/>
app:layout_constraintBottom_toBottomOf="@+id/backgroundView"
app:layout_constraintStart_toEndOf="@+id/previous"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintEnd_toStartOf="@+id/next"/>
<ImageView
android:id="@+id/next"
android:layout_width="40dp"
android:layout_height="40dp"
app:layout_constraintLeft_toRightOf="@+id/play_pause"
app:layout_constraintRight_toLeftOf="@+id/repeat"
app:layout_constraintBottom_toBottomOf="@+id/play_pause"
app:layout_constraintTop_toTopOf="@+id/play_pause"
android:contentDescription="@string/next"
android:focusable="true"
android:scaleType="fitXY"
android:onClick="@{fragment::onNextClick}"
android:src="?attr/ic_next" />
android:id="@+id/next"
android:layout_width="40dp"
android:layout_height="40dp"
Right_toLeftOf="@+id/repeat"
app:layout_constraintBottom_toBottomOf="@+id/play_pause"
app:layout_constraintTop_toTopOf="@+id/play_pause"
android:contentDescription="@string/next"
android:focusable="true"
android:scaleType="fitXY"
android:onClick="@{fragment::onNextClick}"
android:src="?attr/ic_next"
app:layout_constraintStart_toEndOf="@+id/play_pause"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintEnd_toStartOf="@+id/repeat"/>
<ImageView
android:id="@+id/previous"
android:layout_width="40dp"
android:layout_height="40dp"
app:layout_constraintRight_toLeftOf="@+id/play_pause"
app:layout_constraintLeft_toRightOf="@+id/shuffle"
app:layout_constraintBottom_toBottomOf="@+id/play_pause"
app:layout_constraintTop_toTopOf="@+id/play_pause"
android:contentDescription="@string/previous"
android:focusable="true"
android:scaleType="fitXY"
android:onClick="@{fragment::onPreviousClick}"
android:src="?attr/ic_previous" />
android:id="@+id/repeat"
android:layout_width="40dp"
android:layout_height="40dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/play_pause"
app:layout_constraintTop_toTopOf="@+id/play_pause"
android:layout_marginEnd="@dimen/default_margin"
android:contentDescription="@string/repeat_title"
android:focusable="true"
android:onClick="@{fragment::onRepeatClick}"
android:scaleType="fitXY"
app:srcCompat="@drawable/ic_repeat"
app:layout_constraintStart_toEndOf="@+id/next"
app:layout_constraintHorizontal_bias="0.5"/>
<androidx.appcompat.widget.ViewStubCompat
android:id="@+id/player_options_stub"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout="@layout/player_options" />
android:id="@+id/player_options_stub"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout="@layout/player_options"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
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