Fix lint UnnecessaryComposedModifier and make it an error
This commit is contained in:
parent
6b13d044bb
commit
2cce7f3b47
2 changed files with 5 additions and 3 deletions
|
|
@ -21,7 +21,6 @@ import android.os.Build
|
|||
import androidx.annotation.ChecksSdkIntAtLeast
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.composed
|
||||
import androidx.compose.ui.draw.BlurredEdgeTreatment
|
||||
import androidx.compose.ui.draw.blur
|
||||
import androidx.compose.ui.draw.drawBehind
|
||||
|
|
@ -94,8 +93,8 @@ fun Modifier.blurredShapeShadow(
|
|||
fun Modifier.blurCompat(
|
||||
radius: Dp,
|
||||
edgeTreatment: BlurredEdgeTreatment = BlurredEdgeTreatment.Rectangle
|
||||
): Modifier = composed {
|
||||
when {
|
||||
): Modifier {
|
||||
return when {
|
||||
radius.value == 0f -> this
|
||||
canUseBlur() -> blur(radius, edgeTreatment)
|
||||
else -> this // Added in case we find a way to make this work on older devices
|
||||
|
|
|
|||
|
|
@ -124,4 +124,7 @@
|
|||
|
||||
<!-- DI -->
|
||||
<!-- issue id="JvmStaticProvidesInObjectDetector" severity="error" /-->
|
||||
|
||||
<!-- Compose -->
|
||||
<issue id="UnnecessaryComposedModifier" severity="error" />
|
||||
</lint>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue