3
3
package com.shifthackz.aisdv1.presentation.screen.donate
4
4
5
5
import androidx.compose.animation.AnimatedContent
6
- import androidx.compose.foundation.Canvas
7
6
import androidx.compose.foundation.Image
8
7
import androidx.compose.foundation.layout.Arrangement
9
8
import androidx.compose.foundation.layout.Box
@@ -38,7 +37,6 @@ import androidx.compose.ui.Modifier
38
37
import androidx.compose.ui.draw.clip
39
38
import androidx.compose.ui.draw.drawBehind
40
39
import androidx.compose.ui.geometry.CornerRadius
41
- import androidx.compose.ui.graphics.Brush
42
40
import androidx.compose.ui.graphics.Color
43
41
import androidx.compose.ui.layout.ContentScale
44
42
import androidx.compose.ui.platform.LocalContext
@@ -49,6 +47,7 @@ import androidx.compose.ui.tooling.preview.Preview
49
47
import androidx.compose.ui.unit.dp
50
48
import androidx.compose.ui.unit.sp
51
49
import com.shifthackz.aisdv1.core.common.extensions.openUrl
50
+ import com.shifthackz.aisdv1.core.extensions.fadedEdge
52
51
import com.shifthackz.aisdv1.domain.entity.Supporter
53
52
import com.shifthackz.aisdv1.presentation.widget.item.SupporterItem
54
53
import com.shifthackz.android.core.mvi.MviComponent
@@ -175,11 +174,12 @@ private fun DonateScreenContent(
175
174
) { contentVisible ->
176
175
if (contentVisible) {
177
176
if (state.supporters.isNotEmpty()) {
177
+ val shadowHeight = 150 .dp
178
178
Box (
179
- modifier = Modifier .fillMaxSize(),
179
+ modifier = Modifier .fillMaxSize()
180
+ .fadedEdge(gradientOffset = shadowHeight),
180
181
contentAlignment = Alignment .BottomCenter ,
181
182
) {
182
- val shadowHeight = 150 .dp
183
183
LazyColumn (
184
184
modifier = Modifier .fillMaxSize(),
185
185
) {
@@ -227,19 +227,6 @@ private fun DonateScreenContent(
227
227
Spacer (modifier = Modifier .height(shadowHeight + 32 .dp))
228
228
}
229
229
}
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
- }
243
230
}
244
231
}
245
232
} else {
0 commit comments