Commit a483a362 authored by Ryan VanderMeulen's avatar Ryan VanderMeulen Committed by rvandermeulen@mozilla.com
Browse files

Bug 1967598 - Fix ModifierParameter warning in MenuItem.kt. r=android-reviewers,007

parent b950f40b
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -958,17 +958,6 @@
            column="9"/>
    </issue>

    <issue
        id="ModifierParameter"
        message="Modifier parameter should be the first optional parameter"
        errorLine1="    modifier: Modifier = Modifier,"
        errorLine2="    ~~~~~~~~">
        <location
            file="src/main/java/org/mozilla/fenix/components/menu/compose/MenuItem.kt"
            line="78"
            column="5"/>
    </issue>

    <issue
        id="DiscouragedApi"
        message="Use of this function is discouraged because resource reflection makes it harder to perform build optimizations and compile-time verification of code. It is much more efficient to retrieve resources by identifier (e.g. `R.foo.bar`) than by name (e.g. `getIdentifier(&quot;bar&quot;, &quot;foo&quot;, null)`)."
+4 −4
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@ private val ROUNDED_CORNER_SHAPE = RoundedCornerShape(4.dp)
 *
 * @param label The label in the menu item.
 * @param beforeIconPainter [Painter] used to display an [Icon] before the list item.
 * @param modifier [Modifier] to be applied to the layout.
 * @param labelModifier [Modifier] to be applied to the label.
 * @param beforeIconDescription Content description of the icon.
 * @param description An optional description text below the label.
 * @param state The state of the menu item to display.
@@ -59,8 +61,6 @@ private val ROUNDED_CORNER_SHAPE = RoundedCornerShape(4.dp)
 * at the end.
 * @param afterIconPainter [Painter] used to display an [IconButton] after the list item.
 * @param afterIconDescription Content description of the icon.
 * @param modifier [Modifier] to be applied to the layout.
 * @param labelModifier [Modifier] to be applied to the label.
 * @param onAfterIconClick Invoked when the user clicks on the icon. An [IconButton] will be
 * displayed if this is provided. Otherwise, an [Icon] will be displayed.
 * @param afterContent Optional Composable for adding UI to the end of the list item.
@@ -69,6 +69,8 @@ private val ROUNDED_CORNER_SHAPE = RoundedCornerShape(4.dp)
internal fun MenuItem(
    label: String,
    beforeIconPainter: Painter,
    modifier: Modifier = Modifier,
    labelModifier: Modifier = Modifier,
    beforeIconDescription: String? = null,
    description: String? = null,
    state: MenuItemState = MenuItemState.ENABLED,
@@ -77,8 +79,6 @@ internal fun MenuItem(
    showDivider: Boolean = false,
    afterIconPainter: Painter? = null,
    afterIconDescription: String? = null,
    modifier: Modifier = Modifier,
    labelModifier: Modifier = Modifier,
    onAfterIconClick: (() -> Unit)? = null,
    afterContent: (@Composable RowScope.() -> Unit)? = null,
) {