recycler: improve fast-scroller truncation
Make fast-scroller truncation more aggressive, mostly because on my new ROM it seems like display calculations become a little wonky and cause slight indicator cutoff. May as well add padding then so that indicators [and the thumb by extension] actually fit and won't get clipped.
This commit is contained in:
parent
ec4ca16658
commit
6d9c9f65c2
4 changed files with 10 additions and 7 deletions
|
@ -58,12 +58,12 @@ private val ID3_GENRES = arrayOf(
|
|||
*/
|
||||
fun String.getGenreNameCompat(): String? {
|
||||
if (isDigitsOnly()) {
|
||||
// ID3 v1, just parse as an integer
|
||||
// ID3v1, just parse as an integer
|
||||
return ID3_GENRES.getOrNull(toInt())
|
||||
}
|
||||
|
||||
if (startsWith('(') && endsWith(')')) {
|
||||
// ID3 v2+, parse out the parentheses and get the integer
|
||||
// ID3v2.3/ID3v2.4, parse out the parentheses and get the integer
|
||||
// Any genres formatted as "(CHARS)" will be ignored.
|
||||
val genreInt = substring(1 until lastIndex).toIntOrNull()
|
||||
|
||||
|
|
|
@ -157,10 +157,13 @@ class FastScrollView @JvmOverloads constructor(
|
|||
)
|
||||
|
||||
// If the scroller size is too small to contain all the entries, truncate entries
|
||||
// so that the fast scroller entries fit.
|
||||
val maxEntries = height / textHeight
|
||||
// so that the fast scroller entries fit. Include the thumb in here so it isn't cut
|
||||
// off.
|
||||
val maxEntries = (height - (binding.scrollThumb.height * 2)) / textHeight
|
||||
|
||||
if (indicators.size > maxEntries.toInt()) {
|
||||
logD("${ceil(indicators.size / maxEntries).toInt()}")
|
||||
|
||||
if (indicators.size > maxEntries) {
|
||||
val truncateInterval = ceil(indicators.size / maxEntries).toInt()
|
||||
|
||||
check(truncateInterval > 1) {
|
||||
|
|
|
@ -23,6 +23,6 @@ Feel free to fork Auxio to add your own feature set however.
|
|||
|
||||
#### Additions that have already been rejected:
|
||||
- Lyrics [#19]
|
||||
- Recently added list[#18]
|
||||
- Recently added list [#18]
|
||||
- Folder View/Grouping [#10]
|
||||
- ReplayGain [#7]
|
||||
|
|
|
@ -10,7 +10,7 @@ Here are the music formats that Auxio supports, as per the [Supported ExoPlayer
|
|||
|
||||
| Format | Supported | Comments |
|
||||
|--------|-----------|-----------
|
||||
| M4A | ✅ | |
|
||||
| MP4 | ✅ | |
|
||||
| MP3 | ✅ | |
|
||||
| MKA | ✅ | |
|
||||
| OGG | ✅ | Containing Vorbis, Opus, and FLAC |
|
||||
|
|
Loading…
Reference in a new issue