generated from ajou4095/template-android
-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Feature] HistoryDetail 내역 보기 & 수정 구현 #57
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0d66513
[Refactor]: text field Ellipsis 추가
jinuemong a6572f3
[Feat]
jinuemong 4eae30d
[Feat]: 바텀시트 그림자 추가
jinuemong a207036
[Fix]: 패키지 이동
jinuemong eeca0a8
[Feat]: 히스토리 디테일 edit ui 구현
jinuemong 4a5b0d6
[Feat]: HistoryDetailEdit 로직 구현
jinuemong e614fa5
[Feat]: shadow 샘플 추가
jinuemong bd0fd79
[Feat]: 이벤트 선택 바텀시트 기능 구현
jinuemong ba20df5
[Style]: 포맷 수정, 네이밍 수정
jinuemong 0567c3c
[Fix]: 오류 수정
jinuemong 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
42 changes: 42 additions & 0 deletions
42
...n/src/main/kotlin/ac/dnd/bookkeeping/android/presentation/common/util/expansion/Shadow.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,42 @@ | ||
package ac.dnd.bookkeeping.android.presentation.common.util.expansion | ||
|
||
import android.graphics.BlurMaskFilter | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.drawBehind | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.Paint | ||
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas | ||
import androidx.compose.ui.graphics.toArgb | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
|
||
fun Modifier.customOuterShadow( | ||
color: Color, | ||
offsetX: Dp = 0.dp, | ||
offsetY: Dp = 0.dp, | ||
blurRadius: Float, | ||
) = then( | ||
drawBehind { | ||
drawIntoCanvas { canvas -> | ||
val paint = Paint() | ||
val frameworkPaint = paint.asFrameworkPaint() | ||
if (blurRadius != 0f) { | ||
frameworkPaint.maskFilter = (BlurMaskFilter(blurRadius, BlurMaskFilter.Blur.NORMAL)) | ||
} | ||
frameworkPaint.color = color.toArgb() | ||
|
||
val leftPixel = offsetX.toPx() | ||
val topPixel = offsetY.toPx() | ||
val rightPixel = size.width + topPixel | ||
val bottomPixel = size.height + leftPixel | ||
|
||
canvas.drawRect( | ||
left = leftPixel, | ||
top = topPixel, | ||
right = rightPixel, | ||
bottom = bottomPixel, | ||
paint = paint, | ||
) | ||
} | ||
} | ||
) |
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
2 changes: 1 addition & 1 deletion
2
...l/history/HistoryRegistrationEventType.kt → ...ntation/model/history/HistoryEventType.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
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
153 changes: 153 additions & 0 deletions
153
...kotlin/ac/dnd/bookkeeping/android/presentation/ui/main/common/calendar/EventTypeScreen.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,153 @@ | ||
package ac.dnd.bookkeeping.android.presentation.ui.main.common.calendar | ||
|
||
import ac.dnd.bookkeeping.android.presentation.common.theme.Gray000 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Gray150 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Gray200 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Gray600 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Gray800 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Headline3 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Primary1 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Space12 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Space16 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Space20 | ||
import ac.dnd.bookkeeping.android.presentation.model.history.HistoryEventType | ||
import androidx.compose.animation.animateColorAsState | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.wrapContentHeight | ||
import androidx.compose.foundation.lazy.LazyColumn | ||
import androidx.compose.foundation.lazy.items | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableLongStateOf | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.rememberCoroutineScope | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import com.holix.android.bottomsheetdialog.compose.BottomSheetBehaviorProperties | ||
import com.holix.android.bottomsheetdialog.compose.BottomSheetDialog | ||
import com.holix.android.bottomsheetdialog.compose.BottomSheetDialogProperties | ||
import kotlinx.coroutines.delay | ||
import kotlinx.coroutines.launch | ||
|
||
@Composable | ||
fun EventTypeScreen( | ||
onDismissRequest: () -> Unit, | ||
onConfirm: (String) -> Unit | ||
) { | ||
var selectedEventId by remember { mutableLongStateOf(-1) } | ||
val scope = rememberCoroutineScope() | ||
BottomSheetDialog( | ||
onDismissRequest = onDismissRequest, | ||
properties = BottomSheetDialogProperties( | ||
behaviorProperties = BottomSheetBehaviorProperties( | ||
state = BottomSheetBehaviorProperties.State.Expanded, | ||
skipCollapsed = true | ||
) | ||
) | ||
) { | ||
Column( | ||
modifier = Modifier | ||
.background(Gray000) | ||
.fillMaxWidth() | ||
.wrapContentHeight() | ||
) { | ||
Box( | ||
modifier = Modifier | ||
.background(Gray200) | ||
.fillMaxWidth() | ||
.padding( | ||
horizontal = Space20, | ||
vertical = Space12 | ||
) | ||
) { | ||
Text( | ||
text = "경사 종류", | ||
style = Headline3.merge( | ||
color = Gray800, | ||
fontWeight = FontWeight.SemiBold | ||
), | ||
modifier = Modifier.align(Alignment.CenterStart) | ||
) | ||
Text( | ||
text = "완료", | ||
style = Headline3.merge( | ||
color = Gray600, | ||
fontWeight = FontWeight.Normal | ||
), | ||
modifier = Modifier | ||
.align(Alignment.CenterEnd) | ||
.clickable { | ||
if (selectedEventId!= -1L){ | ||
onConfirm( | ||
HistoryEventType.getEventName(selectedEventId) | ||
) | ||
} | ||
} | ||
) | ||
} | ||
LazyColumn { | ||
items(HistoryEventType.entries) { type -> | ||
var clickState by remember { mutableStateOf(false) } | ||
val backgroundColor = animateColorAsState( | ||
targetValue = | ||
if (clickState) Gray150 else if (selectedEventId == type.id) Primary1 else Gray000, | ||
label = "" | ||
) | ||
Box( | ||
modifier = Modifier | ||
.background(backgroundColor.value) | ||
.fillMaxWidth() | ||
.clickable { | ||
selectedEventId = | ||
if (selectedEventId == type.id) -1 else type.id | ||
|
||
scope.launch { | ||
clickState = true | ||
delay(100L) | ||
clickState = false | ||
} | ||
|
||
} | ||
.padding( | ||
horizontal = Space20, | ||
vertical = Space16 | ||
) | ||
){ | ||
Text( | ||
text = type.eventName, | ||
style = Headline3.merge( | ||
color = Gray800, | ||
fontWeight = FontWeight.SemiBold | ||
) | ||
) | ||
} | ||
} | ||
|
||
//TODO 직접 입력 케이스 추가 | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun EventTypeScreenPreview(){ | ||
EventTypeScreen( | ||
onDismissRequest = { | ||
|
||
}, | ||
onConfirm = { | ||
|
||
} | ||
) | ||
} |
12 changes: 11 additions & 1 deletion
12
...okkeeping/android/presentation/ui/main/home/history/detail/edit/HistoryDetailEditEvent.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 |
---|---|---|
@@ -1,3 +1,13 @@ | ||
package ac.dnd.bookkeeping.android.presentation.ui.main.home.history.detail.edit | ||
|
||
sealed interface HistoryDetailEditEvent | ||
import ac.dnd.bookkeeping.android.domain.model.feature.heart.RelatedHeart | ||
|
||
sealed interface HistoryDetailEditEvent { | ||
sealed interface EditRelatedHeart : HistoryDetailEditEvent { | ||
data class Success(val relatedHeart: RelatedHeart) : EditRelatedHeart | ||
} | ||
|
||
sealed interface DeleteRelatedHeart : HistoryDetailEditEvent { | ||
data object Success : DeleteRelatedHeart | ||
} | ||
} |
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.
format