Move app icon composables outside of mutable Fragment class.

This way, the composables do not receive an implicit mutable parameter, which allows the compiler to mark them as skippable.
This commit is contained in:
Nicholas Tinsley 2023-05-19 10:57:07 -04:00 committed by Greyson Parrelli
parent d7c06fff50
commit 131f9c4bc9

View file

@ -87,6 +87,15 @@ class AppIconSelectionFragment : ComposeFragment() {
findNavController().safeNavigate(R.id.action_appIconSelectionFragment_to_appIconTutorialFragment)
}
companion object {
val TAG = Log.tag(AppIconSelectionFragment::class.java)
}
}
private const val LEARN_MORE_TAG = "learn_more"
private const val URL_TAG = "URL"
private const val COLUMN_COUNT = 4
/**
* Screen allowing the user to view all the possible icon and select a new one to use.
*/
@ -227,7 +236,7 @@ class AppIconSelectionFragment : ComposeFragment() {
}
/**
* Composable rendering the multiple layers of an adaptive icon onto one flattened rasterized Canvas.
* Composable rendering the icon and optionally a border, to indicate selection.
*/
@Composable
fun AppIcon(preset: AppIconPreset, isSelected: Boolean, onClick: () -> Unit, modifier: Modifier = Modifier) {
@ -283,9 +292,7 @@ class AppIconSelectionFragment : ComposeFragment() {
}
ClickableText(
text = annotatedText,
onClick = { _ ->
onClick()
},
onClick = { onClick() },
style = MaterialTheme.typography.bodyMedium,
modifier = modifier
)
@ -310,12 +317,3 @@ class AppIconSelectionFragment : ComposeFragment() {
}
}
}
companion object {
val TAG = Log.tag(AppIconSelectionFragment::class.java)
private const val LEARN_MORE_TAG = "learn_more"
private const val URL_TAG = "URL"
private const val COLUMN_COUNT = 4
}
}