1
1
package com.foke.together.presenter.screen
2
2
3
3
import androidx.compose.foundation.Image
4
+ import androidx.compose.foundation.clickable
5
+ import androidx.compose.foundation.layout.Box
4
6
import androidx.compose.foundation.layout.PaddingValues
5
7
import androidx.compose.foundation.layout.aspectRatio
6
8
import androidx.compose.foundation.layout.fillMaxSize
7
9
import androidx.compose.foundation.layout.size
10
+ import androidx.compose.foundation.layout.width
8
11
import androidx.compose.foundation.pager.HorizontalPager
9
12
import androidx.compose.foundation.pager.PageSize
10
13
import androidx.compose.foundation.pager.rememberPagerState
11
14
import androidx.compose.material.icons.Icons
12
15
import androidx.compose.material.icons.automirrored.filled.ArrowBack
13
- import androidx.compose.material.icons.automirrored.filled.ArrowForward
16
+ import androidx.compose.material3.Button
14
17
import androidx.compose.material3.Icon
15
18
import androidx.compose.material3.IconButton
16
19
import androidx.compose.material3.MaterialTheme
@@ -20,6 +23,7 @@ import androidx.compose.runtime.Composable
20
23
import androidx.compose.ui.Alignment
21
24
import androidx.compose.ui.Modifier
22
25
import androidx.compose.ui.res.painterResource
26
+ import androidx.compose.ui.res.stringResource
23
27
import androidx.compose.ui.text.font.FontWeight
24
28
import androidx.compose.ui.tooling.preview.Preview
25
29
import androidx.compose.ui.unit.dp
@@ -50,8 +54,8 @@ fun SelectFrameScreen(
50
54
val (backKey, title, pager, frameSelectButton) = createRefs()
51
55
val topGuideLine = createGuidelineFromTop(0.1f )
52
56
val bottomGuideLine = createGuidelineFromBottom(0.1f )
53
- val startGuideLine = createGuidelineFromStart(0.2f )
54
- val endGuideLine = createGuidelineFromEnd(0.2f )
57
+ val startGuideLine = createGuidelineFromStart(0.1f )
58
+ val endGuideLine = createGuidelineFromEnd(0.1f )
55
59
56
60
IconButton (
57
61
onClick = { popBackStack() },
@@ -99,18 +103,46 @@ fun SelectFrameScreen(
99
103
state = pagerState,
100
104
pageSize = PageSize .Fill ,
101
105
contentPadding = PaddingValues (
102
- start = 25 .dp,
103
- end = 25 .dp
106
+ start = 40 .dp,
107
+ end = 40 .dp
104
108
)
105
109
) { page ->
106
110
when (page){
107
- CutFrameType .MAKER_FAIRE .ordinal -> Image (painter = painterResource(id = R .drawable.maker_faire_frame), contentDescription = " maker_faire_frame" )
108
- CutFrameType .FOURCUT_LIGHT .ordinal -> Image (painter = painterResource(id = R .drawable.fourcut_frame_medium_light), contentDescription = " fourcut_frame_medium_light" )
109
- CutFrameType .FOURCUT_DARK .ordinal -> Image (painter = painterResource(id = R .drawable.fourcut_frame_medium_dark), contentDescription = " fourcut_frame_medium_dark" )
111
+ CutFrameType .MAKER_FAIRE .ordinal -> {
112
+ Box (
113
+ contentAlignment = Alignment .Center ,
114
+ modifier = Modifier
115
+ .clickable {
116
+ viewModel.setCutFrameType(pagerState.currentPage)
117
+ navigateToMethod()
118
+ }
119
+ ) { Image (painter = painterResource(id = R .drawable.maker_faire_frame), contentDescription = " maker_faire_frame" ) }
120
+ }
121
+ CutFrameType .FOURCUT_LIGHT .ordinal -> {
122
+ Box (
123
+ contentAlignment = Alignment .Center ,
124
+ modifier = Modifier
125
+ .clickable {
126
+ viewModel.setCutFrameType(pagerState.currentPage)
127
+ navigateToMethod()
128
+ }
129
+
130
+ ) { Image (painter = painterResource(id = R .drawable.fourcut_frame_medium_light), contentDescription = " fourcut_frame_medium_light" ) }
131
+ }
132
+ CutFrameType .FOURCUT_DARK .ordinal -> {
133
+ Box (
134
+ modifier = Modifier
135
+ .clickable {
136
+ viewModel.setCutFrameType(pagerState.currentPage)
137
+ navigateToMethod()
138
+ },
139
+ contentAlignment = Alignment .Center
140
+ ) { Image (painter = painterResource(id = R .drawable.fourcut_frame_medium_dark), contentDescription = " fourcut_frame_medium_dark" ) }
141
+ }
110
142
}
111
143
}
112
144
113
- IconButton (
145
+ Button (
114
146
onClick = {
115
147
viewModel.setCutFrameType(pagerState.currentPage)
116
148
navigateToMethod()
@@ -122,13 +154,13 @@ fun SelectFrameScreen(
122
154
bottom.linkTo(bottomGuideLine)
123
155
height = Dimension .wrapContent
124
156
width = Dimension .wrapContent
125
- },
157
+ }.width( 200 .dp) ,
126
158
) {
127
- Icon (
128
- modifier = Modifier .size( 85 .dp ),
129
- imageVector = Icons . AutoMirrored . Filled . ArrowForward ,
130
- contentDescription = " Camera Navigation Button Icon " ,
131
- tint = MaterialTheme .colorScheme.primary
159
+ Text (
160
+ text = stringResource(id = R .string.select_frame_button_next ),
161
+ style = MaterialTheme .typography.displayLarge ,
162
+ fontWeight = FontWeight . Bold ,
163
+ fontSize = 36 .sp
132
164
)
133
165
}
134
166
}
0 commit comments