release: bump to 3.0.1

Bump the version to 3.0.1 (25).
This commit is contained in:
Alexander Capehart
2023-01-02 19:05:57 -07:00
parent 4db4b023d5
commit b3b7ed524c
8 changed files with 45 additions and 45 deletions
@@ -295,7 +295,13 @@ class HomeFragment :
// Update the scrolling view in AppBarLayout to align with the current tab's
// scrolling state. This prevents the lift state from being confused as one
// goes between different tabs.
requireBinding().homeAppbar.liftOnScrollTargetViewId = getTabRecyclerId(tabMode)
requireBinding().homeAppbar.liftOnScrollTargetViewId =
when (tabMode) {
MusicMode.SONGS -> R.id.home_song_recycler
MusicMode.ALBUMS -> R.id.home_album_recycler
MusicMode.ARTISTS -> R.id.home_artist_recycler
MusicMode.GENRES -> R.id.home_genre_recycler
}
}
private fun handleRecreate(recreate: Boolean) {
@@ -313,6 +319,9 @@ class HomeFragment :
}
private fun updateIndexerState(state: Indexer.State?) {
// TODO: Make music loading experience a bit more pleasant
// 1. Loading placeholder for item lists
// 2. Rework the "No Music" case to not be an error and instead result in a placeholder
val binding = requireBinding()
when (state) {
is Indexer.State.Complete -> setupCompleteState(binding, state.result)
@@ -356,8 +365,6 @@ class HomeFragment :
}
is Indexer.NoMusicException -> {
logD("Updating UI to no music state")
// TODO: Rework how empty libraries are treated to feel less jarring if
// there was a previously loaded library
binding.homeIndexingStatus.text = context.getString(R.string.err_no_music)
// Configure the action to act as a reload trigger.
binding.homeIndexingAction.apply {
@@ -453,20 +460,6 @@ class HomeFragment :
reenterTransition = MaterialSharedAxis(axis, false)
}
/**
* Get the ID of the RecyclerView contained by [ViewPager2] tab represented with the given
* [MusicMode].
* @param tabMode The [MusicMode] of the tab.
* @return The ID of the RecyclerView contained by the given tab.
*/
private fun getTabRecyclerId(tabMode: MusicMode) =
when (tabMode) {
MusicMode.SONGS -> R.id.home_song_recycler
MusicMode.ALBUMS -> R.id.home_album_recycler
MusicMode.ARTISTS -> R.id.home_artist_recycler
MusicMode.GENRES -> R.id.home_genre_recycler
}
/**
* [FragmentStateAdapter] implementation for the [HomeFragment]'s [ViewPager2] instance.
* @param tabs The current tab configuration. This will define the [Fragment]s created.
@@ -71,26 +71,6 @@ class FastScrollRecyclerView
@JvmOverloads
constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr: Int = 0) :
AuxioRecyclerView(context, attrs, defStyleAttr) {
/** An interface to provide text to use in the popup when fast-scrolling. */
interface PopupProvider {
/**
* Get text to use in the popup at the specified position.
* @param pos The position in the list.
* @return A [String] to use in the popup. Null if there is no applicable text for the popup
* at [pos].
*/
fun getPopup(pos: Int): String?
}
/** A listener for fast scroller interactions. */
interface Listener {
/**
* Called when the fast scrolling state changes.
* @param isFastScrolling true if the user is currently fast scrolling, false otherwise.
*/
fun onFastScrollingChanged(isFastScrolling: Boolean)
}
// Thumb
private val thumbView =
View(context).apply {
@@ -524,6 +504,26 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
else -> 0
}
/** An interface to provide text to use in the popup when fast-scrolling. */
interface PopupProvider {
/**
* Get text to use in the popup at the specified position.
* @param pos The position in the list.
* @return A [String] to use in the popup. Null if there is no applicable text for the popup
* at [pos].
*/
fun getPopup(pos: Int): String?
}
/** A listener for fast scroller interactions. */
interface Listener {
/**
* Called when the fast scrolling state changes.
* @param isFastScrolling true if the user is currently fast scrolling, false otherwise.
*/
fun onFastScrollingChanged(isFastScrolling: Boolean)
}
private companion object {
const val AUTO_HIDE_SCROLLBAR_DELAY_MILLIS = 1500
}