Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoSoto committed Oct 18, 2023
1 parent 119c260 commit 0bb96cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ internal fun BoxScope.PaywallBackground(templateConfiguration: TemplateConfigura
BlurTransformation(
context = LocalContext.current,
radius = BackgroundUIConstants.blurSize.toFloatPx(),
scale = BackgroundUIConstants.blurScale,
)
} else {
null
Expand All @@ -49,7 +48,7 @@ internal fun BoxScope.PaywallBackground(templateConfiguration: TemplateConfigura
painter = painterResource(id = R.drawable.default_background),
contentDescription = null,
contentScale = BackgroundUIConstants.contentScale,
alpha = imageAlpha
alpha = imageAlpha,
)
} else {
templateConfiguration.images.backgroundUri?.let {
Expand All @@ -58,7 +57,7 @@ internal fun BoxScope.PaywallBackground(templateConfiguration: TemplateConfigura
modifier = modifier,
contentScale = BackgroundUIConstants.contentScale,
transformation = backwardsCompatibleTransformation,
alpha = imageAlpha
alpha = imageAlpha,
)
}
}
Expand All @@ -68,7 +67,6 @@ private object BackgroundUIConstants {
val blurSize = 40.dp
val contentScale = ContentScale.Crop
const val blurAlpha = 0.7f
const val blurScale = 0.5f
const val minSDKVersionSupportingBlur = 31
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal object PackageConfigurationFactory {
// This won't happen because availablePackages won't be empty. Offerings can't have empty available packages
return Result.failure(PackageConfigurationError("No packages found for ids $packageIdsInConfig"))
}
val packageInfos = filteredRCPackages.map {
val packageInfos = filteredRpawCPackages.map {
TemplateConfiguration.PackageInfo(
rcPackage = it,
localization = ProcessedLocalizedConfiguration.create(variableDataProvider, localization, it, locale),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ import kotlin.math.min
*
* @property radius - The radius of the square used for blurring. Higher values
* produce a more pronounced blur effect.
* @property scale - The scale factor for resizing the image before blurring.
* Lower values produce a faster but lower quality blur.
*/
internal class BlurTransformation(
private val context: Context,
private val radius: Float,
private val scale: Float = 0.5f,
) : Transformation {

override val cacheKey: String = "${javaClass.name}-$radius"
Expand All @@ -30,7 +27,7 @@ internal class BlurTransformation(
input: Bitmap,
size: Size,
): Bitmap {
return input.blur(context, radius) ?: input
return input.blur(context, radius)
}

override fun equals(other: Any?): Boolean {
Expand Down

0 comments on commit 0bb96cc

Please sign in to comment.