Commit db9a5d09 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy

Fix advanced options focus and background

parent 40579537
......@@ -4,7 +4,9 @@
android:shape="rectangle">
<solid android:color="@color/playerbackground">
</solid>
<corners android:radius="5dp">
<corners
android:topLeftRadius="4dp"
android:bottomLeftRadius="4dp">
</corners>
</shape>
\ No newline at end of file
......@@ -6,7 +6,8 @@
android:color="@color/whitetransparent" >
</solid>
<corners
android:radius="3dp" >
android:topLeftRadius="4dp"
android:bottomLeftRadius="4dp">
</corners>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<org.videolan.vlc.gui.view.AutoFitRecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/adv_options_margin"
android:background="?attr/rounded_bg"/>
......@@ -6,11 +6,11 @@
type="org.videolan.vlc.gui.helpers.PlayerOption" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/player_option_width"
android:layout_height="wrap_content"
android:focusable="true"
android:layout_margin="6dp">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/player_option_width"
android:layout_height="wrap_content"
android:focusable="true"
android:padding="8dp">
<ImageView
android:id="@+id/option_icon"
......
......@@ -7,12 +7,12 @@
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" />
android:id="@+id/options_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|end"
android:background="?attr/advanced_options_bg"
android:clipToPadding="false"
android:paddingTop="@dimen/default_margin"
android:paddingBottom="@dimen/default_margin" />
</FrameLayout>
......@@ -78,7 +78,7 @@
<attr name="shadow_bottom_9patch" format="reference"/>
<attr name="advanced_options_style" format="reference" />
<attr name="rounded_bg" format="reference" />
<attr name="advanced_options_bg" format="reference"/>
<declare-styleable name="SlidingPaneLayout">
<attr name="overhangSize" format="dimension" />
......
......@@ -71,7 +71,7 @@
<item name="gridview_progressbar">@drawable/gridview_progressbar</item>
<item name="progress_mini_player">@drawable/progress_mini_player</item>
<item name="advanced_options_style">@style/Theme.MaterialComponents.Light.Dialog</item>
<item name="rounded_bg">@drawable/rounded_corners_light</item>
<item name="advanced_options_bg">@drawable/rounded_corners_light</item>
<item name="ic_playasaudio_off">@drawable/ic_playasaudio_off</item>
<item name="ic_playasaudio_on">@drawable/ic_playasaudio_on</item>
<item name="ic_popup_expand">@drawable/ic_popup_expand</item>
......@@ -182,7 +182,7 @@
<item name="gridview_progressbar">@drawable/gridview_progressbar_w</item>
<item name="progress_mini_player">@drawable/progress_mini_player_dark</item>
<item name="advanced_options_style">@style/Theme.MaterialComponents.Dialog</item>
<item name="rounded_bg">@drawable/rounded_corners</item>
<item name="advanced_options_bg">@drawable/rounded_corners</item>
<item name="ic_playasaudio_off">@drawable/ic_playasaudio_off_w</item>
<item name="ic_playasaudio_on">@drawable/ic_playasaudio_on_w</item>
<item name="ic_popup_expand">@drawable/ic_popup_expand_w</item>
......@@ -330,7 +330,7 @@
<item name="colorAccent">@color/orange500</item>
<item name="background_default">@color/grey850</item>
<item name="rounded_bg">@drawable/rounded_corners</item>
<item name="advanced_options_bg">@drawable/rounded_corners</item>
<item name="advanced_options_style">@style/Theme.MaterialComponents.Dialog</item>
<item name="ic_playasaudio_on">@drawable/ic_playasaudio_on_w</item>
<item name="ic_popup_dim">@drawable/ic_popup_dim_w</item>
......
......@@ -407,13 +407,9 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
}
inner class ViewHolder(val binding: PlayerOptionItemBinding) : RecyclerView.ViewHolder(binding.root) {
val textColor = binding.optionTitle.currentTextColor
init {
itemView.setOnClickListener { onClick(dataset[layoutPosition]) }
itemView.onFocusChangeListener = View.OnFocusChangeListener { _, hasFocus ->
binding.optionTitle.setTextColor(if (hasFocus) ContextCompat.getColor(itemView.context, R.color.orange500transparent) else textColor)
}
}
}
}
......
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