Skip to content

Commit

Permalink
Merge pull request #47 from YAPP-Github/feature/sksowk156/PC-446
Browse files Browse the repository at this point in the history
[PC-446] value pick ui, basic profile ui 구현
  • Loading branch information
sksowk156 authored Feb 7, 2025
2 parents fd792cb + 5a0e77a commit 2717d73
Show file tree
Hide file tree
Showing 31 changed files with 2,463 additions and 417 deletions.
8 changes: 6 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
android:name="android.permission.POST_NOTIFICATIONS"
tools:targetApi="33" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" android:minSdkVersion="33"/>
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission
android:name="android.permission.READ_MEDIA_IMAGES"
android:minSdkVersion="33" />

<application
android:name=".PieceApplication"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.puzzle.data.repository

import androidx.core.net.toUri
import com.puzzle.common.suspendRunCatching
import com.puzzle.data.image.ImageResizer
import com.puzzle.database.model.matching.ValuePickAnswer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class FakeProfileDataSource : ProfileDataSource {
override suspend fun checkNickname(nickname: String): Result<Boolean> =
Result.success(true)

override suspend fun uploadProfileImage(imageInputStream: InputStream): Result<String> = Result.success("")
override suspend fun uploadProfileImage(imageInputStream: InputStream): Result<String> =
Result.success("")

override suspend fun uploadProfile(
birthdate: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.puzzle.data.repository

import com.puzzle.data.spy.image.SpyImageResizer
import com.puzzle.data.fake.source.profile.FakeLocalProfileDataSource
import com.puzzle.data.fake.source.profile.FakeProfileDataSource
import com.puzzle.data.fake.source.token.FakeLocalTokenDataSource
import com.puzzle.data.fake.source.user.FakeLocalUserDataSource
import com.puzzle.data.spy.image.SpyImageResizer
import com.puzzle.network.model.matching.ValueTalkResponse
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.test.runTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ fun PieceChip(
colors = filterChipColors(
containerColor = PieceTheme.colors.light3,
labelColor = PieceTheme.colors.dark2,
selectedLabelColor = PieceTheme.colors.primaryDefault,
selectedContainerColor = PieceTheme.colors.primaryLight,
selectedLabelColor = PieceTheme.colors.primaryDefault,
disabledSelectedContainerColor = PieceTheme.colors.primaryLight,
disabledContainerColor = PieceTheme.colors.light3,
disabledLabelColor = if (selected) PieceTheme.colors.primaryDefault
else PieceTheme.colors.dark2,
),
border = if (selected) pieceChipSelectedBorder() else null,
border = if (enabled && selected) pieceChipSelectedBorder() else null,
onClick = onChipClicked,
modifier = modifier,
)
Expand All @@ -68,8 +72,8 @@ private fun PreviewPieceChip() {
PieceTheme {
Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
PieceChip(
label = "Select",
selected = true,
label = "Non_Select",
selected = false,
onChipClicked = {},
modifier = Modifier
.width(300.dp)
Expand All @@ -86,9 +90,20 @@ private fun PreviewPieceChip() {
)

PieceChip(
label = "Non-Select",
label = "Non-Selected",
selected = false,
onChipClicked = {},
enabled = false,
modifier = Modifier
.width(300.dp)
.padding(16.dp),
)

PieceChip(
label = "Selected",
selected = true,
onChipClicked = {},
enabled = false,
modifier = Modifier
.width(300.dp)
.padding(16.dp),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ fun PieceTextInputDefault(
keyboardType: KeyboardType = KeyboardType.Text,
throttleTime: Long = 2000L,
onDone: () -> Unit = {},
onFocusChanged: (Boolean) -> Unit = {},
rightComponent: @Composable () -> Unit = {},
) {
val keyboardController = LocalSoftwareKeyboardController.current
var lastDoneTime by remember { mutableLongStateOf(0L) }
var isFocused by remember { mutableStateOf(false) }

BasicTextField(
value = value,
Expand All @@ -83,7 +85,7 @@ fun PieceTextInputDefault(
decorationBox = { innerTextField ->
Row {
Box(modifier = Modifier.weight(1f)) {
if (value.isEmpty()) {
if (value.isEmpty() && !isFocused) {
Text(
text = hint,
style = PieceTheme.typography.bodyMM,
Expand All @@ -105,7 +107,11 @@ fun PieceTextInputDefault(
if (readOnly) PieceTheme.colors.light2
else PieceTheme.colors.light3
)
.padding(horizontal = 16.dp, vertical = 14.dp),
.padding(horizontal = 16.dp, vertical = 14.dp)
.onFocusChanged { focusState ->
isFocused = focusState.isFocused
onFocusChanged(focusState.isFocused)
},
)
}

Expand Down Expand Up @@ -385,6 +391,7 @@ fun PieceTextInputSnsDropDown(
textStyle = PieceTheme.typography.bodyMM,
cursorBrush = SolidColor(PieceTheme.colors.primaryDefault),
decorationBox = { innerTextField -> innerTextField() },
modifier = Modifier.weight(1f)
)
}

Expand Down
Loading

0 comments on commit 2717d73

Please sign in to comment.