Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4196e27
[UI]: action book button 컴포넌트 제작 (#17)
Nico1eKim May 14, 2025
8c611e1
[refactor]: clickable 추가 (#17)
Nico1eKim May 16, 2025
adc4b1b
[init]: Color 변수 추가 반영 (#17)
Nico1eKim May 16, 2025
e274b5a
[UI]: action medium button 컴포넌트 제작 (#17)
Nico1eKim May 16, 2025
ac4bf49
[UI]: action fill button 컴포넌트 제작 (#17)
Nico1eKim May 16, 2025
37d65ff
[UI]: toggle switch button 컴포넌트 제작 (#17)
Nico1eKim May 16, 2025
56a64cc
[UI]: checkbox button 컴포넌트 제작 (#17)
Nico1eKim May 17, 2025
61e4358
[UI]: outlined button 컴포넌트 제작 (#17)
Nico1eKim May 23, 2025
f840e26
[UI]: group vote button 컴포넌트 제작 (#17)
Nico1eKim May 25, 2025
4251f1f
[UI]: filter button 컴포넌트 제작 (#17)
Nico1eKim May 25, 2025
acec823
[refactor]: group vote button 컴포넌트 toggle가능하게 수정 (#17)
Nico1eKim May 28, 2025
dd79f98
[refactor]: filter button 컴포넌트 위치, 버튼 수정 (#17)
Nico1eKim May 28, 2025
e32baa8
[refactor]: action medium button 컴포넌트 확장성 넓게 수정 (#17)
Nico1eKim May 28, 2025
4507a30
[refactor]: header button 컴포넌트 제작 (#17)
Nico1eKim May 28, 2025
897585c
[chore]: 변수 명 변경 (#17)
Nico1eKim May 28, 2025
1a6a105
[UI]: option chip button 컴포넌트 제작 (#17)
Nico1eKim May 28, 2025
e57937f
[UI]: genre chip button 컴포넌트 제작 (#17)
Nico1eKim May 28, 2025
243190c
[UI]: recent search button 컴포넌트 제작 (#17)
Nico1eKim May 28, 2025
ef98a30
[UI]: expandable floating button 컴포넌트 제작 (#17)
Nico1eKim May 29, 2025
6a487cb
[UI]: floating button 컴포넌트 제작 (#17)
Nico1eKim May 29, 2025
c3367bc
Merge branch 'develop' of https://github.com/THIP-TextHip/THIP-Androi…
Nico1eKim May 29, 2025
49db2f4
[UI]: floating button 화면 상 위치 수정 (#17)
Nico1eKim Jun 23, 2025
3eadbf6
[UI]: Group Vote Button에 애니메이션 효과 추가 (#17)
Nico1eKim Jun 23, 2025
b6f3833
Merge pull request #20 from Nico1eKim/ui/#17-buttons
Nico1eKim Jun 23, 2025
b6adea3
Merge branch 'UI-#18]' into develop
rbqks529 Jun 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package com.texthip.thip.ui.common.buttons

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.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.texthip.thip.R
import com.texthip.thip.ui.theme.ThipTheme.colors
import com.texthip.thip.ui.theme.ThipTheme.typography

@Composable
fun ActionBookButton(
bookTitle: String = stringResource(R.string.book_title),
bookAuthor: String = stringResource(R.string.book_author),
onClick: () -> Unit = {}
) {
Box(
modifier = Modifier
.background(color = colors.DarkGrey, shape = RoundedCornerShape(12.dp))
.clickable {
onClick()
}
.padding(top = 16.dp, bottom = 16.dp, start = 12.dp, end = 4.dp)

) {
Row(
verticalAlignment = Alignment.CenterVertically,
) {
Text(
text = bookTitle,
style = typography.smalltitle_sb600_s16_h24,
color = colors.White,
modifier = Modifier.weight(1f),
overflow = TextOverflow.Ellipsis,
maxLines = 1
)

Text(
text = bookAuthor + stringResource(R.string.author),
style = typography.info_r400_s12_h24,
color = colors.Grey,
modifier = Modifier.width(100.dp),
textAlign = TextAlign.Right,
overflow = TextOverflow.Ellipsis,
maxLines = 1
)

Icon(
painter = painterResource(R.drawable.ic_chevron),
contentDescription = null,
tint = colors.Grey,
)
}
}
}

@Preview
@Composable
private fun ActionBookButtonPreview() {
Column(
modifier = Modifier
.fillMaxSize()
.padding(30.dp)
) {
ActionBookButton()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package com.texthip.thip.ui.common.buttons

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
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.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.texthip.thip.R
import com.texthip.thip.ui.theme.ThipTheme.colors
import com.texthip.thip.ui.theme.ThipTheme.typography

@Composable
fun ActionFillButton(
text: String,
backgroundColor: Color,
onClick: () -> Unit,
) {
Row(
modifier = Modifier
.fillMaxWidth()
.height(50.dp)
.background(backgroundColor)
.clickable(onClick = onClick),
horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterHorizontally),
verticalAlignment = Alignment.CenterVertically
) {
Icon(
painter = painterResource(R.drawable.ic_write),
contentDescription = null,
tint = colors.White,
)

Text(
text = text,
color = colors.White,
style = typography.smalltitle_sb600_s18_h24,
)

Icon(
painter = painterResource(R.drawable.ic_send),
contentDescription = null,
tint = colors.White,
)
}
}

@Preview
@Composable
private fun ActionFillButtonPreview() {
Column(
modifier = Modifier
.fillMaxSize()
.padding(30.dp),
verticalArrangement = Arrangement.spacedBy(30.dp, Alignment.CenterVertically),
) {
ActionFillButton(
text = stringResource(R.string.post),
backgroundColor = colors.Purple,
onClick = {}
)

ActionFillButton(
text = stringResource(R.string.post),
backgroundColor = colors.Grey02,
onClick = {}
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
package com.texthip.thip.ui.common.buttons

import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
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.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.texthip.thip.R
import com.texthip.thip.ui.theme.ThipTheme.colors
import com.texthip.thip.ui.theme.ThipTheme.typography

@Composable
fun ActionMediumButton(
text: String,
icon: Painter? = null,
contentColor: Color,
backgroundColor: Color,
hasRightIcon: Boolean = false,
modifier: Modifier = Modifier,
onClick: () -> Unit = {},
) {
val hasLeftIcon = icon != null

Row(
modifier = modifier
.fillMaxWidth()
.height(44.dp)
.background(color = backgroundColor, shape = RoundedCornerShape(12.dp))
.clickable {
onClick()
},
horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterHorizontally),
verticalAlignment = Alignment.CenterVertically,
) {
if (hasLeftIcon) {
Icon(
painter = icon,
contentDescription = null,
tint = contentColor,
)
}

Text(
text = text,
color = contentColor,
style = typography.smalltitle_sb600_s16_h24,
)

if (hasRightIcon) {
Icon(
painter = painterResource(R.drawable.ic_chevron),
contentDescription = null,
tint = contentColor,
)
}
}
}

@Preview
@Composable
private fun ActionMediumButtonPreview() {
Column(
modifier = Modifier
.fillMaxSize()
.padding(30.dp),
verticalArrangement = Arrangement.spacedBy(16.dp, Alignment.CenterVertically),
) {
ActionMediumButton(
text = stringResource(R.string.add_to_my_feed),
icon = painterResource(R.drawable.ic_search),
contentColor = colors.White,
backgroundColor = colors.Grey02,
hasRightIcon = true,
modifier = Modifier.width(180.dp),
onClick = {},
)

ActionMediumButton(
text = stringResource(R.string.add_to_my_feed),
icon = painterResource(R.drawable.ic_plus),
contentColor = colors.White,
backgroundColor = colors.Purple,
hasRightIcon = true,
modifier = Modifier.width(180.dp),
onClick = {},
)

ActionMediumButton(
text = stringResource(R.string.add_to_my_feed),
icon = painterResource(R.drawable.ic_search),
contentColor = colors.Grey,
backgroundColor = Color.Transparent,
hasRightIcon = true,
modifier = Modifier
.width(180.dp)
.border(width = 1.dp, color = colors.Grey02, shape = RoundedCornerShape(12.dp)),
onClick = {},
)

Row(
horizontalArrangement = Arrangement.spacedBy(20.dp, Alignment.CenterHorizontally),
) {

ActionMediumButton(
text = stringResource(R.string.yes),
contentColor = colors.White,
backgroundColor = colors.Purple,
modifier = Modifier.weight(1f),
onClick = {},
)

ActionMediumButton(
text = stringResource(R.string.no),
contentColor = colors.White,
backgroundColor = colors.Grey02,
modifier = Modifier.weight(1f),
onClick = {},
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.texthip.thip.ui.common.buttons

import androidx.compose.foundation.border
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Checkbox
import androidx.compose.material3.CheckboxDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.texthip.thip.ui.theme.ThipTheme.colors

@Composable
fun CheckboxButton(
isChecked: Boolean,
onCheckedChange: (Boolean) -> Unit,
) {
Checkbox(
checked = isChecked,
onCheckedChange = onCheckedChange,
modifier =
Modifier
.border(1.dp, colors.Grey01, RoundedCornerShape(8.dp))
.size(30.dp),
colors =
CheckboxDefaults.colors(
checkmarkColor = colors.NeonGreen,
checkedColor = Color.Transparent,
uncheckedColor = Color.Transparent,
),
)
}

@Preview
@Composable
private fun CheckboxButtonPreview() {
var isChecked by rememberSaveable { mutableStateOf(false) }

CheckboxButton(
isChecked = isChecked,
onCheckedChange = { isChecked = it }
)
}
Loading