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
24 changed files
with
1,065 additions
and
59 deletions.
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
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
83 changes: 83 additions & 0 deletions
83
...lin/ac/dnd/bookkeeping/android/presentation/common/view/component/FieldSelectComponent.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,83 @@ | ||
package ac.dnd.bookkeeping.android.presentation.common.view.component | ||
|
||
import ac.dnd.bookkeeping.android.presentation.R | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Body1 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Gray000 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Gray400 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Gray800 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Primary4 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Shapes | ||
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.Space48 | ||
import androidx.compose.foundation.Image | ||
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.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.res.painterResource | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
|
||
@Composable | ||
fun FieldSelectComponent( | ||
isSelected: Boolean, | ||
text: String, | ||
onClick: () -> Unit | ||
) { | ||
Box( | ||
modifier = Modifier | ||
.clip(Shapes.medium) | ||
.background(color = Gray000) | ||
.border( | ||
width = 1.dp, | ||
color = if (isSelected) Primary4 else Gray400, | ||
shape = Shapes.medium | ||
) | ||
.fillMaxWidth() | ||
.height(Space48) | ||
.clickable { | ||
onClick() | ||
} | ||
.padding( | ||
start = Space16, | ||
end = Space12, | ||
top = Space12, | ||
bottom = Space12 | ||
) | ||
) { | ||
Text( | ||
text = text, | ||
style = Body1.merge( | ||
color = Gray800, | ||
fontWeight = FontWeight.Normal | ||
), | ||
modifier = Modifier.align(Alignment.CenterStart) | ||
) | ||
|
||
Image( | ||
painter = painterResource(R.drawable.ic_chevron_right), | ||
contentDescription = null, | ||
modifier = Modifier.align(Alignment.CenterEnd) | ||
) | ||
} | ||
} | ||
|
||
@Preview(backgroundColor = 0xFFFFFFFF, showBackground = true) | ||
@Composable | ||
fun FieldSelectComponentPreview() { | ||
FieldSelectComponent( | ||
isSelected = true, | ||
text = "2024/01/10", | ||
onClick = {} | ||
) | ||
} |
55 changes: 55 additions & 0 deletions
55
...in/ac/dnd/bookkeeping/android/presentation/common/view/component/FieldSubjectComponent.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,55 @@ | ||
package ac.dnd.bookkeeping.android.presentation.common.view.component | ||
|
||
import ac.dnd.bookkeeping.android.presentation.R | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Body1 | ||
import ac.dnd.bookkeeping.android.presentation.common.theme.Gray700 | ||
import androidx.compose.foundation.Image | ||
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.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.width | ||
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.alpha | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.unit.dp | ||
|
||
@Composable | ||
fun FieldSubject( | ||
subject: String, | ||
isViewIcon: Boolean = true | ||
) { | ||
Column { | ||
Row { | ||
Text( | ||
text = subject, | ||
style = Body1.merge( | ||
color = Gray700, | ||
fontWeight = FontWeight.SemiBold | ||
) | ||
) | ||
Spacer(modifier = Modifier.width(1.dp)) | ||
Box( | ||
modifier = Modifier | ||
.height(21.dp) | ||
.alpha(if (isViewIcon) 100f else 0f) | ||
.padding(bottom = 3.dp), | ||
contentAlignment = Alignment.Center | ||
) { | ||
Image( | ||
painter = painterResource(R.drawable.ic_essential_field), | ||
contentDescription = null | ||
) | ||
} | ||
} | ||
Spacer( | ||
modifier = Modifier.height(18.dp) | ||
) | ||
} | ||
} |
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.