[Android] Decrease audio header size
Nicolas Pomepuy
git at videolan.org
Fri Jul 26 11:08:23 CEST 2019
vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Fri Jul 26 09:18:28 2019 +0200| [c14185c74faf08f5972ad5c21e6382a02527ee56] | committer: Nicolas Pomepuy
Decrease audio header size
> https://code.videolan.org/videolan/vlc-android/commit/c14185c74faf08f5972ad5c21e6382a02527ee56
---
vlc-android/res/layout/recycler_section_header.xml | 5 ++---
vlc-android/res/values/dimens.xml | 2 +-
.../src/org/videolan/vlc/gui/view/RecyclerSectionItemDecoration.kt | 3 ++-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/vlc-android/res/layout/recycler_section_header.xml b/vlc-android/res/layout/recycler_section_header.xml
index 44a41ce95..0a5b3da2d 100644
--- a/vlc-android/res/layout/recycler_section_header.xml
+++ b/vlc-android/res/layout/recycler_section_header.xml
@@ -2,12 +2,11 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/section_header"
android:layout_width="match_parent"
- android:layout_height="48dp"
+ android:layout_height="@dimen/recycler_section_header_height"
android:background="?attr/background_default_gradient"
android:paddingStart="16dp"
- android:paddingTop="@dimen/audio_item_header_padding"
android:paddingEnd="28dp"
- android:paddingBottom="@dimen/audio_item_header_padding"
android:singleLine="true"
+ android:gravity="center_vertical"
android:textColor="?attr/audio_browser_separator"
android:textSize="20sp"/>
\ No newline at end of file
diff --git a/vlc-android/res/values/dimens.xml b/vlc-android/res/values/dimens.xml
index d3235991d..9d70d4f76 100644
--- a/vlc-android/res/values/dimens.xml
+++ b/vlc-android/res/values/dimens.xml
@@ -104,7 +104,7 @@
<dimen name="audio_item_padding_botom">4dp</dimen>
<dimen name="audio_item_title_size">14sp</dimen>
<dimen name="wizard_dialog_width">288dp</dimen>
- <dimen name="recycler_section_header_height">48dp</dimen>
+ <dimen name="recycler_section_header_height">36dp</dimen>
<dimen name="recycler_section_header_tv_height">56dp</dimen>
<dimen name="recycler_section_header_spacing">12dp</dimen>
diff --git a/vlc-android/src/org/videolan/vlc/gui/view/RecyclerSectionItemDecoration.kt b/vlc-android/src/org/videolan/vlc/gui/view/RecyclerSectionItemDecoration.kt
index ebf78ef42..a381abd95 100644
--- a/vlc-android/src/org/videolan/vlc/gui/view/RecyclerSectionItemDecoration.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/view/RecyclerSectionItemDecoration.kt
@@ -9,6 +9,7 @@ import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import org.videolan.vlc.R
import org.videolan.vlc.providers.medialibrary.MedialibraryProvider
+import kotlin.math.max
private const val TAG = "RecyclerSectionItemDecoration"
@@ -74,7 +75,7 @@ class RecyclerSectionItemDecoration(private val headerOffset: Int, private val s
private fun drawHeader(c: Canvas, child: View, headerView: View) {
c.save()
if (sticky) {
- c.translate(0f, Math.max(0, child.top - headerView.height).toFloat())
+ c.translate(0f, max(0, child.top - headerView.height).toFloat())
} else {
c.translate(0f, (child.top - headerView.height).toFloat())
}
More information about the Android
mailing list