mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Fix lint UnnecessaryComposedModifier and make it an error
This commit is contained in:
+2
-3
@@ -21,7 +21,6 @@ import android.os.Build
|
|||||||
import androidx.annotation.ChecksSdkIntAtLeast
|
import androidx.annotation.ChecksSdkIntAtLeast
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.composed
|
|
||||||
import androidx.compose.ui.draw.BlurredEdgeTreatment
|
import androidx.compose.ui.draw.BlurredEdgeTreatment
|
||||||
import androidx.compose.ui.draw.blur
|
import androidx.compose.ui.draw.blur
|
||||||
import androidx.compose.ui.draw.drawBehind
|
import androidx.compose.ui.draw.drawBehind
|
||||||
@@ -94,8 +93,8 @@ fun Modifier.blurredShapeShadow(
|
|||||||
fun Modifier.blurCompat(
|
fun Modifier.blurCompat(
|
||||||
radius: Dp,
|
radius: Dp,
|
||||||
edgeTreatment: BlurredEdgeTreatment = BlurredEdgeTreatment.Rectangle
|
edgeTreatment: BlurredEdgeTreatment = BlurredEdgeTreatment.Rectangle
|
||||||
): Modifier = composed {
|
): Modifier {
|
||||||
when {
|
return when {
|
||||||
radius.value == 0f -> this
|
radius.value == 0f -> this
|
||||||
canUseBlur() -> blur(radius, edgeTreatment)
|
canUseBlur() -> blur(radius, edgeTreatment)
|
||||||
else -> this // Added in case we find a way to make this work on older devices
|
else -> this // Added in case we find a way to make this work on older devices
|
||||||
|
|||||||
@@ -124,4 +124,7 @@
|
|||||||
|
|
||||||
<!-- DI -->
|
<!-- DI -->
|
||||||
<!-- issue id="JvmStaticProvidesInObjectDetector" severity="error" /-->
|
<!-- issue id="JvmStaticProvidesInObjectDetector" severity="error" /-->
|
||||||
|
|
||||||
|
<!-- Compose -->
|
||||||
|
<issue id="UnnecessaryComposedModifier" severity="error" />
|
||||||
</lint>
|
</lint>
|
||||||
|
|||||||
Reference in New Issue
Block a user