generated from ajou4095/template-android
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
550 additions
and
2 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
...ookkeeping/android/presentation/ui/main/home/history/common/HistoryBackgroundComponent.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,64 @@ | ||
package ac.dnd.bookkeeping.android.presentation.ui.main.home.history.common | ||
|
||
import ac.dnd.bookkeeping.android.presentation.R | ||
import ac.dnd.bookkeeping.android.presentation.model.history.HistoryDetailGrowthType | ||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.layout.ContentScale | ||
import androidx.compose.ui.platform.LocalConfiguration | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
|
||
@Composable | ||
fun HistoryBackgroundComponent( | ||
currentGrowthType: HistoryDetailGrowthType, | ||
backgroundHeight: Dp, | ||
currentScreenHeightRatio: Float, | ||
isInformationShowing: Boolean = true, | ||
innerContent: @Composable () -> Unit = {}, | ||
onClickInformation: () -> Unit = {} | ||
) { | ||
Box( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.height(backgroundHeight) | ||
) { | ||
Image( | ||
painter = painterResource(currentGrowthType.backgroundImageResource), | ||
modifier = Modifier.fillMaxSize(), | ||
contentScale = ContentScale.Crop, | ||
contentDescription = null | ||
) | ||
LocalConfiguration.current.screenHeightDp.dp | ||
innerContent() | ||
|
||
//TODO 로티 | ||
if (isInformationShowing) { | ||
Box( | ||
modifier = Modifier | ||
.align(Alignment.TopStart) | ||
.padding( | ||
start = 20.dp, | ||
top = 389.dp * currentScreenHeightRatio | ||
) | ||
) { | ||
Image( | ||
painter = painterResource(R.drawable.ic_info), | ||
contentDescription = null, | ||
modifier = Modifier.clickable { | ||
onClickInformation() | ||
} | ||
) | ||
} | ||
} | ||
} | ||
} |
98 changes: 98 additions & 0 deletions
98
...d/bookkeeping/android/presentation/ui/main/home/history/detail/HistoryDetailPageScreen.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,98 @@ | ||
package ac.dnd.bookkeeping.android.presentation.ui.main.home.history.detail | ||
|
||
import ac.dnd.bookkeeping.android.presentation.common.theme.Body1 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Gray400 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Gray500 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Gray600 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Shapes | ||
import ac.dnd.bookkeeping.android.presentation.common.util.coroutine.event.EventFlow | ||
import ac.dnd.bookkeeping.android.presentation.model.history.HistoryViewType | ||
import ac.dnd.bookkeeping.android.presentation.ui.main.ApplicationState | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.border | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import kotlinx.coroutines.CoroutineExceptionHandler | ||
|
||
@Composable | ||
fun HistoryDetailPageScreen( | ||
appState: ApplicationState, | ||
model: HistoryDetailModel, | ||
event: EventFlow<HistoryDetailEvent>, | ||
intent: (HistoryDetailIntent) -> Unit, | ||
handler: CoroutineExceptionHandler, | ||
viewType: HistoryViewType | ||
) { | ||
} | ||
|
||
@Composable | ||
private fun EmptyHeartView() { | ||
Column( | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
modifier = Modifier.fillMaxWidth() | ||
) { | ||
Spacer(modifier = Modifier.weight(44.39f)) | ||
Text( | ||
text = "아직 주고 받은 내역이 없어요", | ||
style = Body1.merge( | ||
color = Gray600, | ||
fontWeight = FontWeight.SemiBold | ||
) | ||
) | ||
Spacer(modifier = Modifier.height(6.dp)) | ||
Text( | ||
text = "주고 받은 금액을 기록해 보세요", | ||
style = Body1.merge( | ||
color = Gray500, | ||
fontWeight = FontWeight.Normal | ||
) | ||
) | ||
Spacer(modifier = Modifier.height(24.dp)) | ||
Box( | ||
modifier = Modifier | ||
.clip(Shapes.medium) | ||
.background(color = Color.White) | ||
.border( | ||
width = 1.dp, | ||
color = Gray400 | ||
) | ||
.clickable { | ||
|
||
} | ||
.padding( | ||
horizontal = 16.dp, | ||
vertical = 6.5.dp | ||
) | ||
) { | ||
Text( | ||
text = "마음 등록하기", | ||
style = Body1.merge( | ||
fontWeight = FontWeight.SemiBold, | ||
color = Gray500 | ||
) | ||
) | ||
} | ||
Spacer(modifier = Modifier.weight(56.61f)) | ||
} | ||
} | ||
|
||
|
||
@Preview | ||
@Composable | ||
private fun EmptyHeartPreview() { | ||
EmptyHeartView() | ||
} |
Oops, something went wrong.