33package com.shifthackz.aisdv1.presentation.screen.donate
44
55import androidx.compose.animation.AnimatedContent
6- import androidx.compose.foundation.Canvas
76import androidx.compose.foundation.Image
87import androidx.compose.foundation.layout.Arrangement
98import androidx.compose.foundation.layout.Box
@@ -38,7 +37,6 @@ import androidx.compose.ui.Modifier
3837import androidx.compose.ui.draw.clip
3938import androidx.compose.ui.draw.drawBehind
4039import androidx.compose.ui.geometry.CornerRadius
41- import androidx.compose.ui.graphics.Brush
4240import androidx.compose.ui.graphics.Color
4341import androidx.compose.ui.layout.ContentScale
4442import androidx.compose.ui.platform.LocalContext
@@ -49,6 +47,7 @@ import androidx.compose.ui.tooling.preview.Preview
4947import androidx.compose.ui.unit.dp
5048import androidx.compose.ui.unit.sp
5149import com.shifthackz.aisdv1.core.common.extensions.openUrl
50+ import com.shifthackz.aisdv1.core.extensions.fadedEdge
5251import com.shifthackz.aisdv1.domain.entity.Supporter
5352import com.shifthackz.aisdv1.presentation.widget.item.SupporterItem
5453import com.shifthackz.android.core.mvi.MviComponent
@@ -175,11 +174,12 @@ private fun DonateScreenContent(
175174 ) { contentVisible ->
176175 if (contentVisible) {
177176 if (state.supporters.isNotEmpty()) {
177+ val shadowHeight = 150 .dp
178178 Box (
179- modifier = Modifier .fillMaxSize(),
179+ modifier = Modifier .fillMaxSize()
180+ .fadedEdge(gradientOffset = shadowHeight),
180181 contentAlignment = Alignment .BottomCenter ,
181182 ) {
182- val shadowHeight = 150 .dp
183183 LazyColumn (
184184 modifier = Modifier .fillMaxSize(),
185185 ) {
@@ -227,19 +227,6 @@ private fun DonateScreenContent(
227227 Spacer (modifier = Modifier .height(shadowHeight + 32 .dp))
228228 }
229229 }
230- val shadowGradient = Brush .verticalGradient(
231- listOf (
232- Color .Transparent ,
233- MaterialTheme .colorScheme.background,
234- )
235- )
236- Canvas (
237- modifier = Modifier
238- .fillMaxWidth()
239- .height(shadowHeight),
240- ) {
241- drawRect(shadowGradient)
242- }
243230 }
244231 }
245232 } else {
0 commit comments