diff --git a/app/build.gradle b/app/build.gradle index 5a2e74aa4..949608345 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -53,6 +53,9 @@ afterEvaluate { dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) + // FIXME: A good chunk of the dependencies I use are implicit, + // I may want to explicitly declare them to avoid any annoying build issues in the future. + // Kotlin implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" @@ -98,10 +101,11 @@ dependencies { implementation 'com.google.android.material:material:1.3.0' // Dialogs + // TODO: Eliminate these, don't want their bloat. implementation 'com.afollestad.material-dialogs:core:3.3.0' implementation 'com.afollestad.material-dialogs:files:3.3.0' - // --- DEV --- + // --- DEBUG --- // Lint ktlint "com.pinterest:ktlint:0.40.0" diff --git a/app/src/main/java/org/oxycblt/auxio/songs/FastScrollThumb.kt b/app/src/main/java/org/oxycblt/auxio/songs/FastScrollThumb.kt index 4c1145aaf..3386cb697 100644 --- a/app/src/main/java/org/oxycblt/auxio/songs/FastScrollThumb.kt +++ b/app/src/main/java/org/oxycblt/auxio/songs/FastScrollThumb.kt @@ -20,8 +20,9 @@ import org.oxycblt.auxio.ui.inflater /** * The companion thumb for [FastScrollView]. This does not need any setup, instead pass it as an * argument to [FastScrollView.setup]. - * This code is fundamentally an adaptation of Reddit's IndicatorFastScroll, targeted towards - * Auxio specifically. Check them out here: https://github.com/reddit/IndicatorFastScroll/ + * This code is fundamentally an adaptation of Reddit's IndicatorFastScroll, albeit specialized + * towards Auxio. The original library is here: https://github.com/reddit/IndicatorFastScroll/ + * TODO: Merge this view and FastScrollView? They are effectively reliant on eachother * @author OxygenCobalt */ class FastScrollThumb @JvmOverloads constructor( @@ -70,7 +71,7 @@ class FastScrollThumb @JvmOverloads constructor( /** * Make the thumb jump to a new position and update its text to the given [indicator]. - * This is not meant for use outside of the main [FastScrollView] code, don't use it. + * This is not meant for use outside of the main [FastScrollView] code. Do not use it. */ fun jumpTo(indicator: FastScrollView.Indicator, centerY: Int) { binding.thumbText.text = indicator.char.toString() diff --git a/app/src/main/java/org/oxycblt/auxio/songs/FastScrollView.kt b/app/src/main/java/org/oxycblt/auxio/songs/FastScrollView.kt index 0f0ca24ca..7dd967c52 100644 --- a/app/src/main/java/org/oxycblt/auxio/songs/FastScrollView.kt +++ b/app/src/main/java/org/oxycblt/auxio/songs/FastScrollView.kt @@ -24,8 +24,8 @@ import kotlin.math.min /** * A view that allows for quick scrolling through a [RecyclerView] with many items. Unlike other * fast-scrollers, this one displays indicators instead of simply a scroll bar. - * This code is fundamentally an adaptation of Reddit's IndicatorFastScroll, targeted towards - * Auxio specifically. Check them out here: https://github.com/reddit/IndicatorFastScroll/ + * This code is fundamentally an adaptation of Reddit's IndicatorFastScroll, albeit specialized + * towards Auxio. The original library is here: https://github.com/reddit/IndicatorFastScroll/ * @author OxygenCobalt */ class FastScrollView @JvmOverloads constructor( @@ -172,6 +172,7 @@ class FastScrollView @JvmOverloads constructor( } if (touchY in (indicatorText.top until indicatorText.bottom)) { + // Try to roughly caculate which indicator the user is currently touching [Since the val textHeight = indicatorText.height / indicators.size val indicatorIndex = min( (touchY - indicatorText.top) / textHeight, indicators.lastIndex diff --git a/app/src/main/res/animator/animator_thumb.xml b/app/src/main/res/animator/animator_thumb.xml new file mode 100644 index 000000000..e35ef53a5 --- /dev/null +++ b/app/src/main/res/animator/animator_thumb.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/view_scroll_thumb.xml b/app/src/main/res/layout/view_scroll_thumb.xml index 7f2f01b9c..775d1fcbd 100644 --- a/app/src/main/res/layout/view_scroll_thumb.xml +++ b/app/src/main/res/layout/view_scroll_thumb.xml @@ -1,19 +1,20 @@ + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index ccaaf470c..45ecb4786 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -40,6 +40,7 @@ 70dp 36dp + 32dp 32dp 60dp @@ -55,6 +56,7 @@ 20sp + 2dp 4dp 4dp \ No newline at end of file