Skip to content

Commit ba102cb

Browse files
committed
fix select frame scree [FoKE-Developers#30]
1 parent 9ef5117 commit ba102cb

File tree

1 file changed

+47
-15
lines changed

1 file changed

+47
-15
lines changed

presenter/src/main/java/com/foke/together/presenter/screen/SelectFrameScreen.kt

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
package com.foke.together.presenter.screen
22

33
import androidx.compose.foundation.Image
4+
import androidx.compose.foundation.clickable
5+
import androidx.compose.foundation.layout.Box
46
import androidx.compose.foundation.layout.PaddingValues
57
import androidx.compose.foundation.layout.aspectRatio
68
import androidx.compose.foundation.layout.fillMaxSize
79
import androidx.compose.foundation.layout.size
10+
import androidx.compose.foundation.layout.width
811
import androidx.compose.foundation.pager.HorizontalPager
912
import androidx.compose.foundation.pager.PageSize
1013
import androidx.compose.foundation.pager.rememberPagerState
1114
import androidx.compose.material.icons.Icons
1215
import androidx.compose.material.icons.automirrored.filled.ArrowBack
13-
import androidx.compose.material.icons.automirrored.filled.ArrowForward
16+
import androidx.compose.material3.Button
1417
import androidx.compose.material3.Icon
1518
import androidx.compose.material3.IconButton
1619
import androidx.compose.material3.MaterialTheme
@@ -20,6 +23,7 @@ import androidx.compose.runtime.Composable
2023
import androidx.compose.ui.Alignment
2124
import androidx.compose.ui.Modifier
2225
import androidx.compose.ui.res.painterResource
26+
import androidx.compose.ui.res.stringResource
2327
import androidx.compose.ui.text.font.FontWeight
2428
import androidx.compose.ui.tooling.preview.Preview
2529
import androidx.compose.ui.unit.dp
@@ -50,8 +54,8 @@ fun SelectFrameScreen(
5054
val (backKey, title, pager, frameSelectButton) = createRefs()
5155
val topGuideLine = createGuidelineFromTop(0.1f)
5256
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)
5559

5660
IconButton(
5761
onClick = { popBackStack() },
@@ -99,18 +103,46 @@ fun SelectFrameScreen(
99103
state = pagerState,
100104
pageSize = PageSize.Fill,
101105
contentPadding = PaddingValues(
102-
start = 25.dp,
103-
end = 25.dp
106+
start = 40.dp,
107+
end = 40.dp
104108
)
105109
) { page ->
106110
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+
}
110142
}
111143
}
112144

113-
IconButton(
145+
Button(
114146
onClick = {
115147
viewModel.setCutFrameType(pagerState.currentPage)
116148
navigateToMethod()
@@ -122,13 +154,13 @@ fun SelectFrameScreen(
122154
bottom.linkTo(bottomGuideLine)
123155
height = Dimension.wrapContent
124156
width = Dimension.wrapContent
125-
},
157+
}.width(200.dp),
126158
) {
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
132164
)
133165
}
134166
}

0 commit comments

Comments
 (0)