Unify fast-scroller

Completely unify the fast scroll indicators and the fast scroll thumb into a single view.
This commit is contained in:
OxygenCobalt
2021-03-23 14:35:32 -06:00
parent cc3d4fb9c6
commit 0a18108419
14 changed files with 112 additions and 205 deletions
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@android:color/white" />
</shape>
@@ -39,13 +39,5 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/song_toolbar" />
<org.oxycblt.auxio.songs.FastScrollThumb
android:id="@+id/song_fast_scroll_thumb"
android:layout_width="@dimen/width_thumb_view"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/song_fast_scroll"
app:layout_constraintTop_toBottomOf="@+id/song_toolbar" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<merge
tools:layout_height="match_parent"
tools:layout_width="match_parent"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<FrameLayout
android:id="@+id/scroll_thumb"
android:layout_width="@dimen/size_scroll_thumb"
android:layout_height="@dimen/size_scroll_thumb"
android:background="@drawable/ui_circle"
android:elevation="@dimen/elevation_small"
android:backgroundTint="?attr/colorPrimary"
android:stateListAnimator="@animator/animator_thumb"
app:layout_constraintEnd_toStartOf="@+id/scroll_indicator_text">
<TextView
android:id="@+id/scroll_thumb_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textSize="@dimen/text_size_thumb"
android:textColor="?android:attr/windowBackground"
android:fontFamily="@font/inter_semibold"
tools:text="A" />
</FrameLayout>
<TextView
android:id="@+id/scroll_indicator_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/inter_semibold"
android:gravity="center"
android:includeFontPadding="false"
android:lineSpacingExtra="@dimen/padding_tiny"
android:paddingTop="@dimen/padding_tiny"
android:paddingBottom="@dimen/padding_tiny"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="A\nB\n\C\nD\nE" />
</merge>
</layout>
@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Animator from IndicatorFastScroll (https://github.com/reddit/IndicatorFastScroll) -->
<layout>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:layout_height="match_parent"
tools:layout_width="@dimen/size_scroll_thumb"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<FrameLayout
android:id="@+id/thumb_layout"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/ui_circular_button"
android:elevation="@dimen/elevation_small"
android:stateListAnimator="@animator/animator_thumb"
app:layout_constraintDimensionRatio="W,1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/thumb_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:text="A" />
</FrameLayout>
</merge>
</layout>
-5
View File
@@ -24,11 +24,6 @@
android:name="org.oxycblt.auxio.MainFragment"
android:label="MainFragment"
tools:layout="@layout/fragment_main">
<action
android:id="@+id/action_return_to_loading"
app:destination="@id/loading_fragment"
app:popUpTo="@id/main_fragment"
app:popUpToInclusive="true" />
<action
android:id="@+id/action_go_to_playback"
app:destination="@id/playback_fragment"
+1 -1
View File
@@ -40,7 +40,7 @@
<dimen name="size_play_pause">70dp</dimen>
<dimen name="size_play_pause_compact">36dp</dimen>
<dimen name="size_scroll_thumb">32dp</dimen>
<dimen name="size_scroll_thumb">48dp</dimen>
<dimen name="size_clear">32dp</dimen>
<dimen name="size_app_icon">60dp</dimen>
-12
View File
@@ -98,18 +98,6 @@
<item name="android:fontFamily">@font/inter_exbold</item>
</style>
<!-- Fast scroll text appearance -->
<style name="TextAppearance.FastScroll" parent="TextAppearance.AppCompat.Body2">
<item name="android:fontFamily">@font/inter_semibold</item>
<item name="android:lineSpacingExtra">@dimen/padding_tiny</item>
</style>
<!-- Fast scroll thumb appearance -->
<style name="TextAppearance.ThumbIndicator" parent="TextAppearance.FastScroll">
<item name="android:textSize">@dimen/text_size_thumb</item>
<item name="android:textColor">?android:attr/windowBackground</item>
</style>
<!-- Style for the general item background -->
<style name="ItemSurroundings">
<item name="android:layout_width">match_parent</item>