Skip to content

Commit

Permalink
Merge branch 'develop' into feature/gael/list
Browse files Browse the repository at this point in the history
  • Loading branch information
Gael-Android authored Nov 25, 2023
2 parents 47ba772 + eb61615 commit e6d59bc
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ implementation("com.github.yourssu.YDS-Android:compose:${YDSVersion}")

## 💻 타 버전 저장소
[YDS-iOS](https://github.com/yourssu/YDS-iOS)
[YDS-Web](https://github.com/yourssu/YDS-Web)
[YDS-React](https://github.com/yourssu/YDS-React)
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.yourssu.design.system.compose.atom

import androidx.compose.foundation.indication
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
Expand Down Expand Up @@ -32,22 +34,21 @@ import com.yourssu.design.system.compose.base.YdsText

@Composable
fun PasswordTextField(
text: String,
modifier: Modifier = Modifier,
isError: Boolean = false,
isEnabled: Boolean = true,
onValueChange: (value: String) -> Unit,
onErrorChange: (Boolean) -> Unit,
placeHolder: String = "",
hintText: String = "",
) {
var text by rememberSaveable { mutableStateOf("") }
var showPassword by remember { mutableStateOf(value = false) }
val interactionSource = remember { MutableInteractionSource() }
var showPassword by remember { mutableStateOf(false) }
Column(modifier = modifier) {
OutlinedTextField(
value = text,
onValueChange = { value: String ->
text = value
onValueChange(value)
},
onValueChange = onValueChange,
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(8.dp),
colors = TextFieldDefaults.outlinedTextFieldColors(
Expand Down Expand Up @@ -76,16 +77,22 @@ fun PasswordTextField(
},
trailingIcon = {
if (showPassword) {
IconButton(onClick = { showPassword = false }) {
IconButton(
onClick = { showPassword = false },
modifier = Modifier.indication(interactionSource, null),
) {
Icon(
id = R.drawable.ic_eyeclosed_line,
id = R.drawable.ic_eyeopen_line,
iconSize = IconSize.Medium,
)
}
} else {
IconButton(onClick = { showPassword = true }) {
IconButton(
onClick = { showPassword = true },
modifier = Modifier.indication(interactionSource, null),
) {
Icon(
id = R.drawable.ic_eyeopen_line,
id = R.drawable.ic_eyeclosed_line,
iconSize = IconSize.Medium,
)
}
Expand All @@ -99,7 +106,7 @@ fun PasswordTextField(
Row(modifier = Modifier.padding(top = 8.dp)) {
Spacer(
modifier = Modifier
.width(16.dp)
.width(16.dp),
)
YdsText(
text = hintText,
Expand All @@ -125,6 +132,7 @@ fun PreviewPasswordTextField() {
var text by rememberSaveable { mutableStateOf("") }
Column {
PasswordTextField(
text = text,
isError = isError, isEnabled = true,
placeHolder = "플레이스 홀더",
onValueChange = { value ->
Expand All @@ -133,18 +141,29 @@ fun PreviewPasswordTextField() {
},
hintText = "힌트 텍스트",
modifier = Modifier.padding(10.dp),
onErrorChange = { isError = it },
)

var text2 by rememberSaveable { mutableStateOf("") }
var text3 by rememberSaveable { mutableStateOf("") }

PasswordTextField(
text = text2,
isEnabled = false,
onValueChange = { value ->

text2 = value
},
modifier = Modifier.padding(bottom = 10.dp),
hintText = "힌트 텍스트",
onErrorChange = { isError = it },
)

PasswordTextField(isError = true, onValueChange = { value -> })
PasswordTextField(
text = text3,
isError = true,
onValueChange = { value -> text3 = value },
onErrorChange = { isError = it },
)

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ fun ScrollableTabBar(
tabBarWidth += it.width
}

// Position the children.

layout(tabBarWidth, tabBarHeight) {
// Place the tabs

val tabPositions = mutableListOf<TabPosition>()
var left = edgePadding

Expand Down

0 comments on commit e6d59bc

Please sign in to comment.