-
Notifications
You must be signed in to change notification settings - Fork 0
[#2] Home 화면 디자인 #3
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package com.hyeon.dayroutine.ui.component | ||
|
|
||
| import androidx.compose.foundation.Canvas | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.LinearProgressIndicator | ||
| import androidx.compose.material3.ProgressIndicatorDefaults.drawStopIndicator | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.draw.clip | ||
| import androidx.compose.ui.geometry.CornerRadius | ||
| import androidx.compose.ui.geometry.Size | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.graphics.StrokeCap | ||
| import androidx.compose.ui.unit.dp | ||
|
|
||
| @Composable | ||
| fun RoutineProgress( | ||
| modifier: Modifier, | ||
| progress: Float | ||
| ) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Q) 이렇게 작성하는 Composable을 뭐라고 표현할까요?(stateless? stateful?) Q2) stateless? stateful?에 대해 설명해주세요
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [공부]
|
||
| Canvas( | ||
| modifier = modifier | ||
| .fillMaxWidth() | ||
| .height(6.dp) | ||
| ) { | ||
| val radius = size.height / 2 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Q) 이 radius는 몇번이 계산될까요? Q2) 리컴포지션에 대해서 설명해주세요
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| drawRoundRect( | ||
| color = Color(0xFF33334a), | ||
| cornerRadius = CornerRadius(radius) | ||
| ) | ||
|
|
||
| drawRoundRect( | ||
| color = Color(0xFF6c63ff), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Q) Color 정의하는 다른 방식은 없나요?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MaterialTheme에서 Color 값을 지정해서 사용할 수 있을거 같습니다. 아니면 Color 값을 관리하는 Object를 생성해서 사용할 수 있을거같습니다. |
||
| cornerRadius = CornerRadius(radius), | ||
| size = Size(width = size.width * progress, height = size.height) | ||
| ) | ||
| } | ||
| } | ||
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.
q) enableEdgeToEdge 에 대해서 설명해주세요
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.
[공부]
화면은 시스템바(상태바, 네비게이션바)영역까지 확장해서 UI를 그릴 수 있게 해줍니다.