@@ -11,7 +11,6 @@ import androidx.compose.material3.Text
1111import androidx.compose.runtime.*
1212import androidx.compose.ui.Modifier
1313import androidx.compose.ui.draw.clip
14- import androidx.compose.ui.draw.shadow
1514import androidx.compose.ui.graphics.Color
1615import androidx.compose.ui.graphics.ImageBitmap
1716import androidx.compose.ui.layout.ContentScale
@@ -22,6 +21,7 @@ import androidx.compose.ui.unit.dp
2221import androidx.compose.ui.unit.sp
2322import com.smarttoolfactory.beforeafter.BeforeAfterImage
2423import com.smarttoolfactory.beforeafter.ContentOrder
24+ import com.smarttoolfactory.beforeafter.OverlayStyle
2525import com.smarttoolfactory.composebeforeafter.ContentScaleSelectionMenu
2626import com.smarttoolfactory.composebeforeafter.R
2727
@@ -83,28 +83,29 @@ fun BeforeAfterImageDemo() {
8383
8484 BeforeAfterImage (
8585 modifier = Modifier
86- .shadow( 1 .dp, RoundedCornerShape (10 .dp))
86+ .clip( RoundedCornerShape (10 .dp))
8787 .fillMaxWidth()
8888 .aspectRatio(4 / 3f ),
8989 beforeImage = imageBefore,
9090 afterImage = imageAfter,
9191 contentScale = contentScale
9292 )
9393
94- Spacer (modifier = Modifier .height(40 .dp))
94+ Spacer (modifier = Modifier .height(50 .dp))
9595
9696 BeforeAfterImage (
9797 modifier = Modifier
98- .shadow( 1 .dp, RoundedCornerShape (10 .dp))
98+ .clip( RoundedCornerShape (10 .dp))
9999 .fillMaxWidth()
100100 .aspectRatio(4 / 3f ),
101101 beforeImage = imageBefore,
102102 afterImage = imageAfter,
103103 contentOrder = ContentOrder .AfterBefore ,
104- contentScale = contentScale
104+ contentScale = contentScale,
105+ overlayStyle = OverlayStyle ()
105106 )
106107
107- Spacer (modifier = Modifier .height(40 .dp))
108+ Spacer (modifier = Modifier .height(50 .dp))
108109 Text (
109110 text = " Zoom(Pinch gesture)" ,
110111 fontSize = 16 .sp,
@@ -115,7 +116,7 @@ fun BeforeAfterImageDemo() {
115116
116117 BeforeAfterImage (
117118 modifier = Modifier
118- .shadow( 1 .dp, RoundedCornerShape (10 .dp))
119+ .clip( RoundedCornerShape (10 .dp))
119120 .fillMaxWidth()
120121 .aspectRatio(4 / 3f ),
121122 beforeImage = imageBefore2,
@@ -125,7 +126,7 @@ fun BeforeAfterImageDemo() {
125126 )
126127
127128
128- Spacer (modifier = Modifier .height(40 .dp))
129+ Spacer (modifier = Modifier .height(50 .dp))
129130 Text (
130131 text = " Progress animation" ,
131132 fontSize = 16 .sp,
@@ -149,26 +150,26 @@ fun BeforeAfterImageDemo() {
149150 )
150151 )
151152
152- BeforeAfterImage (
153- modifier = Modifier
154- .clip(RoundedCornerShape (10 .dp))
155- .border(3 .dp, Color (0xffE91E63 ), RoundedCornerShape (10 .dp))
156- .fillMaxWidth()
157- .aspectRatio(4 / 3f ),
158- beforeImage = imageBefore3,
159- afterImage = imageAfter3,
160- progress = progress,
161- onProgressChange = {},
162- contentScale = contentScale,
163- beforeLabel = {},
164- afterLabel = {},
165- ) {
166- Text (
167- " ${(progress).roundToInt()} %" ,
168- fontSize = 50 .sp,
169- fontWeight = FontWeight .Bold ,
170- color = Color (0xff03A9F4 )
171- )
172- }
153+ BeforeAfterImage (
154+ modifier = Modifier
155+ .clip(RoundedCornerShape (10 .dp))
156+ .border(3 .dp, Color (0xffE91E63 ), RoundedCornerShape (10 .dp))
157+ .fillMaxWidth()
158+ .aspectRatio(4 / 3f ),
159+ beforeImage = imageBefore3,
160+ afterImage = imageAfter3,
161+ progress = progress,
162+ onProgressChange = {},
163+ contentScale = contentScale,
164+ beforeLabel = {},
165+ afterLabel = {},
166+ ) {
167+ Text (
168+ " ${(progress).roundToInt()} %" ,
169+ fontSize = 50 .sp,
170+ fontWeight = FontWeight .Bold ,
171+ color = Color (0xff03A9F4 )
172+ )
173+ }
173174 }
174175}
0 commit comments