-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UI/#48] 온보딩 뷰 / UI 구현 #70
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
a9861ef
[UI/#48] StartScreen UI 구현
leeeyubin 78e6f62
[FEAT/#48] 애니메이션 구현
leeeyubin ee773f6
[FEAT/#48] solving conflict
leeeyubin 145076b
[FEAT/#48] TopAppBar 수정
leeeyubin 1d01e28
[ADD/#48] Filtering Screen 추가
leeeyubin 3823413
[FEAT/#48] TerningBasicImage 구현
leeeyubin d1b435d
[FEAT/#48] Text 구현
leeeyubin b7fe480
[FEAT/#48] string 추출
leeeyubin b40a191
[FEAT/#48] solving conflict
leeeyubin d395dbc
[FEAT/#48] FilteringButton 구현
leeeyubin d5149d1
[FEAT/#48] FilteringButton 구현
leeeyubin c43e4b9
[UI/#48] FilteringOneScreen UI 구현
leeeyubin 3c4ab6b
[FEAT/#48] Filtering 버튼 연결
leeeyubin a3b3183
[UI/#48] FilteringTwoScreen UI 구현
leeeyubin 7569fec
[UI/#48] FilteringTwoScreen UI 구현
leeeyubin e3b7d1c
[FEAT/#48] navigation 연결
leeeyubin ab9dd9f
[FEAT/#48] button3_a 추가
leeeyubin 6f334c3
[FEAT/#48] padding vertical 수정
leeeyubin 08ad2bb
[FEAT/#48] Calendar 구현
leeeyubin 93cb52f
[FEAT/#48] solving conflict
leeeyubin 16c1646
[FEAT/#48] solving conflict
leeeyubin e05f2c8
[FEAT/#48] StartHomeScreen 추가
leeeyubin c4adc81
[FEAT/#48] 스크롤 시 버튼 활성화 구현
leeeyubin 439eb06
[FEAT/#48] 데이트 피커 구현
leeeyubin 6e7565b
[FEAT/#48] pull from develop
leeeyubin 965cb71
[FEAT/#48] pull from develop
leeeyubin 1b2e0d5
[FIX/#48] 마지막 아이템 선택 이슈 해결
leeeyubin 8fc7213
[FEAT/#48] StartHomeScreen 구현
leeeyubin a06c968
[FEAT/#48] string에 년, 월 추가
leeeyubin 3e8d879
[CHORE/#48] startDestination 수정
leeeyubin d3b69e9
[CHORE/#48] MONTH 상수화
leeeyubin 72d1d53
Merge branch 'develop' of https://github.com/teamterning/Terning-Andr…
leeeyubin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,4 +69,5 @@ dependencies { | |
|
||
//ThirdPartyDependencies | ||
implementation(libs.compose.coil) | ||
implementation(libs.okhttp) | ||
} |
82 changes: 82 additions & 0 deletions
82
core/src/main/java/com/terning/core/designsystem/component/button/FilteringButton.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package com.terning.core.designsystem.component.button | ||
|
||
import androidx.annotation.StringRes | ||
import androidx.compose.foundation.BorderStroke | ||
import androidx.compose.foundation.interaction.MutableInteractionSource | ||
import androidx.compose.foundation.interaction.collectIsPressedAsState | ||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.material.ripple.LocalRippleTheme | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.ButtonDefaults | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.CompositionLocalProvider | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
import com.terning.core.designsystem.theme.Grey400 | ||
import com.terning.core.designsystem.theme.TerningMain | ||
import com.terning.core.designsystem.theme.TerningSub1 | ||
import com.terning.core.designsystem.theme.TerningSub3 | ||
import com.terning.core.designsystem.theme.TerningSub4 | ||
import com.terning.core.designsystem.theme.TerningSub5 | ||
import com.terning.core.designsystem.theme.TerningTheme | ||
import com.terning.core.designsystem.theme.White | ||
import com.terning.core.util.NoRippleTheme | ||
|
||
@Composable | ||
fun FilteringButton( | ||
isSelected: Boolean, | ||
@StringRes text: Int, | ||
cornerRadius: Dp, | ||
paddingVertical: Dp, | ||
onButtonClick: () -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { | ||
val interactionSource = remember { MutableInteractionSource() } | ||
val isPressed by interactionSource.collectIsPressedAsState() | ||
val backgroundColor = when { | ||
!isSelected && !isPressed -> White | ||
!isSelected && isPressed -> TerningSub5 | ||
isSelected && !isPressed -> TerningSub4 | ||
else -> TerningSub3 | ||
} | ||
val textColor = when { | ||
!isSelected -> Grey400 | ||
else -> TerningMain | ||
} | ||
val borderColor = when { | ||
!isSelected -> TerningMain | ||
else -> TerningSub1 | ||
} | ||
|
||
CompositionLocalProvider(LocalRippleTheme provides NoRippleTheme) { | ||
Button( | ||
contentPadding = PaddingValues(paddingVertical), | ||
modifier = modifier.fillMaxWidth(), | ||
interactionSource = interactionSource, | ||
colors = ButtonDefaults.buttonColors( | ||
containerColor = backgroundColor, | ||
contentColor = textColor, | ||
), | ||
border = BorderStroke( | ||
width = 1.dp, | ||
color = borderColor | ||
), | ||
shape = RoundedCornerShape(cornerRadius), | ||
onClick = { onButtonClick() } | ||
) { | ||
Text( | ||
text = stringResource(id = text), | ||
style = TerningTheme.typography.button3_a, | ||
textAlign = TextAlign.Center | ||
) | ||
} | ||
} | ||
} |
151 changes: 151 additions & 0 deletions
151
core/src/main/java/com/terning/core/designsystem/component/datepicker/DatePicker.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
package com.terning.core.designsystem.component.datepicker | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxHeight | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.layout.width | ||
import androidx.compose.foundation.lazy.LazyColumn | ||
import androidx.compose.foundation.lazy.rememberLazyListState | ||
import androidx.compose.material3.HorizontalDivider | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.LaunchedEffect | ||
import androidx.compose.runtime.derivedStateOf | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.unit.dp | ||
import com.terning.core.designsystem.theme.Grey300 | ||
import com.terning.core.designsystem.theme.Grey500 | ||
import com.terning.core.designsystem.theme.TerningMain | ||
import com.terning.core.designsystem.theme.TerningTheme | ||
import okhttp3.internal.toImmutableList | ||
|
||
private const val START_YEAR = 2023 | ||
private const val END_YEAR = 2025 | ||
private const val START_MONTH = 1 | ||
private const val END_MONTH = 12 | ||
private val years = | ||
(listOf("") + (START_YEAR..END_YEAR).map { it.toString() } + listOf("") + listOf("")).toImmutableList() | ||
private val monthsNumber = | ||
(listOf("") + (START_MONTH..END_MONTH).map { it.toString() } + listOf("") + listOf("")).toImmutableList() | ||
|
||
@Composable | ||
fun DatePickerUI( | ||
chosenYear: Int, | ||
chosenMonth: Int, | ||
onYearChosen: (Int) -> Unit = {}, | ||
onMonthChosen: (Int) -> Unit = {}, | ||
) { | ||
|
||
Column( | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
modifier = Modifier.fillMaxWidth() | ||
) { | ||
DateSelectionSection( | ||
chosenYear = chosenYear, | ||
chosenMonth = chosenMonth, | ||
onYearChosen = { onYearChosen(it.toInt()) }, | ||
onMonthChosen = { onMonthChosen(it.toInt()) }, | ||
) | ||
} | ||
} | ||
|
||
@Composable | ||
fun DateSelectionSection( | ||
chosenYear: Int, | ||
chosenMonth: Int, | ||
onYearChosen: (String) -> Unit, | ||
onMonthChosen: (String) -> Unit, | ||
) { | ||
Row( | ||
horizontalArrangement = Arrangement.Center, | ||
modifier = Modifier.fillMaxWidth() | ||
) { | ||
DateItemsPicker( | ||
items = years.toImmutableList(), | ||
firstIndex = (chosenYear - START_YEAR), | ||
onItemSelected = onYearChosen, | ||
isYear = true | ||
) | ||
Spacer(modifier = Modifier.width(25.dp)) | ||
DateItemsPicker( | ||
items = monthsNumber.toImmutableList(), | ||
firstIndex = chosenMonth, | ||
onItemSelected = onMonthChosen, | ||
isYear = false | ||
) | ||
} | ||
} | ||
|
||
@Composable | ||
fun DateItemsPicker( | ||
items: List<String>, | ||
firstIndex: Int, | ||
onItemSelected: (String) -> Unit, | ||
modifier: Modifier = Modifier, | ||
isYear: Boolean | ||
) { | ||
val listState = rememberLazyListState(firstIndex) | ||
val currentValue = remember { mutableStateOf("") } | ||
|
||
LaunchedEffect(!listState.isScrollInProgress) { | ||
onItemSelected(currentValue.value) | ||
listState.animateScrollToItem(index = listState.firstVisibleItemIndex) | ||
} | ||
|
||
Box( | ||
modifier = Modifier.height(108.dp), | ||
contentAlignment = Alignment.Center | ||
) { | ||
Column( | ||
modifier = modifier.fillMaxHeight(), | ||
verticalArrangement = Arrangement.SpaceEvenly | ||
) { | ||
HorizontalDivider( | ||
modifier = Modifier.size(height = 1.dp, width = 71.dp), | ||
color = TerningMain | ||
) | ||
HorizontalDivider( | ||
modifier = Modifier.size(height = 1.dp, width = 71.dp), | ||
color = TerningMain | ||
) | ||
} | ||
LazyColumn( | ||
modifier = modifier, | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
state = listState, | ||
) { | ||
items(items.size) { | ||
val index = it % items.size | ||
val firstVisibleItemIndex by remember { | ||
derivedStateOf { listState.firstVisibleItemIndex } | ||
} | ||
if (it == firstVisibleItemIndex + 1) { | ||
currentValue.value = items[index] | ||
} | ||
Spacer(modifier = Modifier.height(6.dp)) | ||
Text( | ||
text = | ||
when (isYear) { | ||
true -> if (items[index].isNotEmpty()) "${items[index]}년" else "" | ||
false -> if (items[index].isNotEmpty()) "${items[index]}월" else "" | ||
}, | ||
style = TerningTheme.typography.title3, | ||
color = if (it == firstVisibleItemIndex + 1) Grey500 else Grey300, | ||
textAlign = TextAlign.Center | ||
) | ||
Spacer(modifier = Modifier.height(6.dp)) | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
core/src/main/java/com/terning/core/designsystem/component/image/TerningImage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.terning.core.designsystem.component.image | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import com.terning.core.R | ||
import com.terning.core.designsystem.theme.TerningPointTheme | ||
|
||
@Composable | ||
fun TerningImage( | ||
painter: Int, | ||
modifier: Modifier = Modifier | ||
) { | ||
Image( | ||
painter = painterResource(id = painter), | ||
contentDescription = stringResource(id = R.string.image_content_descriptin), | ||
modifier = modifier | ||
) | ||
} | ||
|
||
@Preview(showBackground = true) | ||
@Composable | ||
fun TerningBasicImagePreview() { | ||
TerningPointTheme { | ||
TerningImage( | ||
painter = R.drawable.ic_back | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
진짜 고생 많았다,,,,,,,