playback: fix flickering with album/artist info
Forgot to move these TextViews into the hacky FrameLayout to make their new marquee states work correctly. Resolves #376.
This commit is contained in:
@@ -270,7 +270,8 @@ class MainFragment :
|
||||
when (action) {
|
||||
is MainNavigationAction.Expand -> tryExpandSheets()
|
||||
is MainNavigationAction.Collapse -> tryCollapseSheets()
|
||||
is MainNavigationAction.Directions -> findNavController().navigateSafe(action.directions)
|
||||
is MainNavigationAction.Directions ->
|
||||
findNavController().navigateSafe(action.directions)
|
||||
}
|
||||
|
||||
navModel.mainNavigationAction.consume()
|
||||
|
||||
@@ -64,7 +64,8 @@ class RootPreferenceFragment : BasePreferenceFragment(R.xml.preferences_root) {
|
||||
// do one.
|
||||
when (preference.key) {
|
||||
getString(R.string.set_key_ui) -> {
|
||||
findNavController().navigateSafe(RootPreferenceFragmentDirections.goToUiPreferences())
|
||||
findNavController()
|
||||
.navigateSafe(RootPreferenceFragmentDirections.goToUiPreferences())
|
||||
}
|
||||
getString(R.string.set_key_personalize) -> {
|
||||
findNavController()
|
||||
|
||||
@@ -39,7 +39,8 @@ class MusicPreferenceFragment : BasePreferenceFragment(R.xml.preferences_music)
|
||||
|
||||
override fun onOpenDialogPreference(preference: WrappedDialogPreference) {
|
||||
if (preference.key == getString(R.string.set_key_separators)) {
|
||||
findNavController().navigateSafe(MusicPreferenceFragmentDirections.goToSeparatorsDialog())
|
||||
findNavController()
|
||||
.navigateSafe(MusicPreferenceFragmentDirections.goToSeparatorsDialog())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -32,7 +32,8 @@ import org.oxycblt.auxio.util.navigateSafe
|
||||
class PersonalizePreferenceFragment : BasePreferenceFragment(R.xml.preferences_personalize) {
|
||||
override fun onOpenDialogPreference(preference: WrappedDialogPreference) {
|
||||
if (preference.key == getString(R.string.set_key_home_tabs)) {
|
||||
findNavController().navigateSafe(PersonalizePreferenceFragmentDirections.goToTabDialog())
|
||||
findNavController()
|
||||
.navigateSafe(PersonalizePreferenceFragmentDirections.goToTabDialog())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import androidx.appcompat.widget.AppCompatButton
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.core.graphics.Insets
|
||||
import androidx.core.graphics.drawable.DrawableCompat
|
||||
import androidx.navigation.NavAction
|
||||
import androidx.navigation.NavController
|
||||
import androidx.navigation.NavDirections
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@@ -119,13 +118,15 @@ fun AppCompatButton.fixDoubleRipple() {
|
||||
/**
|
||||
* Crash-safe wrapped around [NavController.navigate] that will not crash if multiple destinations
|
||||
* are selected at once.
|
||||
*
|
||||
* @param directions The [NavDirections] to navigate with.
|
||||
*/
|
||||
fun NavController.navigateSafe(directions: NavDirections) = try {
|
||||
navigate(directions)
|
||||
} catch (e: IllegalStateException) {
|
||||
// Nothing to do.
|
||||
}
|
||||
fun NavController.navigateSafe(directions: NavDirections) =
|
||||
try {
|
||||
navigate(directions)
|
||||
} catch (e: IllegalStateException) {
|
||||
// Nothing to do.
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [CoordinatorLayout.Behavior] of a [View], or null if the [View] is not part of a
|
||||
|
||||
Reference in New Issue
Block a user