all: general cleanup

This commit is contained in:
Alexander Capehart
2023-08-14 19:54:43 -06:00
parent f5c7f25cdf
commit e912120f9f
3 changed files with 7 additions and 4 deletions
@@ -35,9 +35,9 @@ import org.oxycblt.auxio.util.showToast
/**
* A dialog that shows a stack trace for a music loading error.
*
* TODO: Extend to other errors
*
* @author Alexander Capehart (OxygenCobalt)
*
* TODO: Extend to other errors
*/
class ErrorDetailsDialog : ViewBindingMaterialDialogFragment<DialogErrorDetailsBinding>() {
private val args: ErrorDetailsDialogArgs by navArgs()
@@ -24,7 +24,10 @@ import androidx.navigation.NavDestination
/**
* A [NavController.OnDestinationChangedListener] that will call [callback] when moving between
* fragments only (not between dialogs or anything similar)
* fragments only (not between dialogs or anything similar).
*
* Note: This only works because of special naming used in Auxio's navigation graphs. Keep this in
* mind when porting to other projects.
*
* @author Alexander Capehart (OxygenCobalt)
*/
@@ -74,6 +77,5 @@ class DialogAwareNavigationListener(private val callback: () -> Unit) :
}
}
/** This relies on special label naming used in-app. */
private fun NavDestination.isDialog() = label?.endsWith("dialog") == true
}