File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
image/src/main/java/com/smarttoolfactory/image/beforeafter Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 11package com.smarttoolfactory.image.beforeafter
22
33import androidx.compose.foundation.background
4+ import androidx.compose.foundation.layout.BoxScope
45import androidx.compose.foundation.layout.padding
56import androidx.compose.foundation.shape.RoundedCornerShape
67import androidx.compose.material.Text
78import androidx.compose.runtime.Composable
9+ import androidx.compose.ui.Alignment
810import androidx.compose.ui.Modifier
911import androidx.compose.ui.graphics.Color
1012import androidx.compose.ui.text.font.FontWeight
@@ -26,3 +28,27 @@ fun Label(modifier: Modifier = Modifier, text: String) {
2628 .padding(horizontal = 12 .dp, vertical = 8 .dp)
2729 )
2830}
31+
32+ @Composable
33+ fun BoxScope.BeforeLabel (contentOrder : ContentOrder ) {
34+ Label (
35+ text = " Before" , modifier = Modifier
36+ .padding(8 .dp)
37+ .align(
38+ if (contentOrder == ContentOrder .BeforeAfter )
39+ Alignment .TopStart else Alignment .TopEnd
40+ )
41+ )
42+ }
43+
44+ @Composable
45+ fun BoxScope.AfterLabel (contentOrder : ContentOrder ) {
46+ Label (
47+ text = " After" , modifier = Modifier
48+ .padding(8 .dp)
49+ .align(
50+ if (contentOrder == ContentOrder .BeforeAfter )
51+ Alignment .TopEnd else Alignment .TopStart
52+ )
53+ )
54+ }
You can’t perform that action at this time.
0 commit comments