Skip to content

Commit 560a9ec

Browse files
authored
Merge pull request #183 from YAPP-Github/ui/#182-fix-minor-adjustments
[UI] μžμž˜ν•œ UI μˆ˜μ • 및 κ°œμ„ 
2 parents 6d8896e + 100d9d6 commit 560a9ec

File tree

7 files changed

+201
-143
lines changed

7 files changed

+201
-143
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:aapt="http://schemas.android.com/aapt"
3+
android:width="140dp"
4+
android:height="140dp"
5+
android:viewportWidth="140"
6+
android:viewportHeight="140">
7+
<path
8+
android:pathData="M40.2,47.53C40.2,36.49 43.12,14.61 54.78,15.35C66.45,16.09 83.18,35.41 90.08,44.98C102.39,47.64 126.58,55.47 124.92,65.47C123.25,75.47 110.33,80.98 104.08,82.48C107.36,86.84 112.77,96.51 108.14,100.3L108.13,100.3C108.13,100.31 108.13,100.31 108.13,100.31C106.28,102.29 97.14,105.14 92.29,105.4C87.8,105.63 82.94,103.8 82.67,99.31L80.67,99.23L53.89,98.1L37.06,99.23L34.95,92.88C34.61,90.79 34.13,85.78 34.95,82.48C29.58,83.22 18.16,82.78 15.44,75.07C12.04,65.43 29.22,52.77 40.2,47.53Z"
9+
android:fillColor="#ffffff"
10+
android:fillType="evenOdd"/>
11+
<path
12+
android:pathData="M45,112.67C49.12,114.3 53.83,115.01 57.37,115.83C60.48,116.56 63.64,116.96 66.76,117.62C67.26,117.73 67.66,118.25 67.44,118.75C66.94,119.9 64.54,120.13 63.53,120.35C61.78,120.74 59.99,121.09 58.19,121.14C54.25,121.23 50.24,120.81 46.31,120.55C44.64,120.44 42.97,120.21 41.32,119.97C40.35,119.83 39.32,119.51 38.34,119.51C37.83,119.51 37.92,120.14 38.01,120.45C38.15,120.98 38.8,121.23 39.26,121.42C40.21,121.83 41.22,122.2 42.22,122.49C42.89,122.68 43.6,122.9 43.45,123.72C43.3,124.48 41.76,124.29 41.28,124.32C39.14,124.44 37.06,124.56 34.92,124.56C33.17,124.56 30.91,124.93 29.23,124.25C27.79,123.67 26.1,123.08 24.54,122.92C23.92,122.86 23.03,122.72 22.5,122.41"
13+
android:strokeWidth="3.1169"
14+
android:fillColor="#00000000"
15+
android:strokeLineCap="round">
16+
<aapt:attr name="android:strokeColor">
17+
<gradient
18+
android:startX="26.27"
19+
android:startY="123.77"
20+
android:endX="67.5"
21+
android:endY="118.67"
22+
android:type="linear">
23+
<item android:offset="0" android:color="#00737373"/>
24+
<item android:offset="1" android:color="#FF737373"/>
25+
</gradient>
26+
</aapt:attr>
27+
</path>
28+
<path
29+
android:pathData="M45.21,108.99C43.94,108.26 41.99,105.73 41.17,104.56C41.04,102.88 47.3,99.62 47.37,103.32C47.44,107.03 46.79,109.9 45.21,108.99Z"
30+
android:fillColor="#CBCBCB"/>
31+
<path
32+
android:pathData="M46.82,108.09C46.23,107.57 45.5,108.22 45.21,108.61C45.11,110.64 46.15,111.79 47.01,111.51C47.88,111.23 47.55,108.73 46.82,108.09Z"
33+
android:fillColor="#737373"/>
34+
<path
35+
android:pathData="M38.28,71.23C35.35,71.25 33.29,72.56 32.63,73.21C35.09,82.32 40.13,100.93 40.52,102.46C40.9,103.99 40.69,105.08 42.04,104.37C44.86,102.88 46.68,103.1 47.09,102.79C47.5,102.48 47.46,101.93 47.39,101.68L38.28,71.23Z"
36+
android:fillColor="#A2A2A2"/>
37+
<path
38+
android:pathData="M47.91,95.84C45.87,102.21 33.5,102.86 33.5,94.22C33.5,91.78 33.62,90.48 34.5,89.17C35.5,87.67 36.9,87.17 37.83,86.74C39.4,86.02 41.48,85.77 42.5,85.67C46.21,85.67 49.77,90.06 47.91,95.84Z"
39+
android:fillColor="#ffffff"/>
40+
<path
41+
android:pathData="M99.24,89.94C95.67,88.36 87.62,86.97 83.98,94.04"
42+
android:strokeWidth="2"
43+
android:fillColor="#00000000"
44+
android:strokeColor="#D5DCE4"
45+
android:strokeLineCap="round"/>
46+
<path
47+
android:pathData="M47.91,95.84C49.37,91.32 47.96,88.26 45.5,87.14"
48+
android:strokeWidth="2"
49+
android:fillColor="#00000000"
50+
android:strokeColor="#D5DCE4"
51+
android:strokeLineCap="round"/>
52+
<path
53+
android:pathData="M62.96,78.08C62.42,77.74 62.56,77.49 61.35,77.2C61.07,77.1 60.78,77.13 60.5,77.13C59.84,77.13 59.17,77.13 58.53,77.29C58.01,77.42 57.57,77.68 57.1,77.96C57.02,78.01 56.85,78.18 56.82,78.3"
54+
android:strokeWidth="2"
55+
android:fillColor="#00000000"
56+
android:strokeColor="#424139"
57+
android:strokeLineCap="round"/>
58+
<path
59+
android:pathData="M49.92,75.59C49.56,75.14 49,74.89 48.42,74.9L46.08,74.97C45.59,74.99 45.12,75.21 44.8,75.59C44.3,76.18 44.26,77.04 44.71,77.67L44.72,77.69C45.03,78.13 45.51,78.4 46.04,78.44L48.43,78.59C48.95,78.62 49.46,78.43 49.83,78.06C50.49,77.4 50.54,76.35 49.96,75.63L49.92,75.59Z"
60+
android:fillColor="#DCDCDC"/>
61+
<path
62+
android:pathData="M71.19,73.89C71.58,73.47 72.15,73.25 72.73,73.31L75.07,73.52C75.56,73.57 76.01,73.82 76.3,74.22C76.75,74.85 76.74,75.7 76.25,76.31L76.24,76.33C75.9,76.74 75.4,76.99 74.87,76.98L72.48,76.98C71.96,76.98 71.46,76.75 71.12,76.36C70.5,75.66 70.52,74.61 71.15,73.93L71.19,73.89Z"
63+
android:fillColor="#DCDCDC"/>
64+
<path
65+
android:pathData="M70.05,69.49C69.75,68.17 68.11,67.98 67.33,68.05C66.23,68.18 66.21,69.15 66.1,70.6C65.99,72.04 65.55,71.43 66.54,73.86C67.52,76.3 69.64,75.8 70.39,74.86C71.14,73.92 70.36,73.64 70.62,71.85C70.87,70.07 70.42,71.15 70.05,69.49Z"
66+
android:fillColor="#424139"/>
67+
<path
68+
android:pathData="M51.89,70.55C51.59,69.22 49.95,69.03 49.17,69.1C48.08,69.24 48.06,70.21 47.95,71.65C47.84,73.1 47.4,72.48 48.38,74.92C49.37,77.35 51.48,76.85 52.23,75.91C52.99,74.98 52.21,74.69 52.46,72.91C52.72,71.12 52.27,72.2 51.89,70.55Z"
69+
android:fillColor="#424139"/>
70+
<path
71+
android:pathData="M104.97,19.01L105.4,14.39C105.46,13.65 106.36,13.31 106.9,13.82L109.71,16.46C109.93,16.67 110.26,16.75 110.56,16.67L114.74,15.5C115.46,15.3 116.09,16.02 115.8,16.71L114.4,20.03C114.29,20.29 114.31,20.59 114.46,20.83L116.74,24.66C117.07,25.22 116.71,25.94 116.06,26.01L111.03,26.56C110.85,26.58 110.68,26.65 110.54,26.77L107.38,29.53C106.88,29.96 106.11,29.74 105.93,29.11L104.92,25.66C104.85,25.4 104.65,25.19 104.4,25.08L100.76,23.63C100.07,23.35 99.99,22.4 100.63,22.03L104.53,19.7C104.78,19.55 104.94,19.3 104.97,19.01Z">
72+
<aapt:attr name="android:fillColor">
73+
<gradient
74+
android:startX="104.4"
75+
android:startY="13.26"
76+
android:endX="113.36"
77+
android:endY="28.3"
78+
android:type="linear">
79+
<item android:offset="0" android:color="#FFDCD9BD"/>
80+
<item android:offset="1" android:color="#FF979580"/>
81+
</gradient>
82+
</aapt:attr>
83+
</path>
84+
</vector>

β€Žcore/designsystem/src/main/res/drawable/ic_charcter_no_alarm.xml

-129
This file was deleted.

β€Žcore/designsystem/src/main/res/raw/fortune_preload.json

+1-1
Large diffs are not rendered by default.

β€Žcore/ui/src/main/java/com/yapp/ui/component/OrbitBottomSheet.kt

+79-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.yapp.ui.component
22

3+
import androidx.compose.foundation.Canvas
34
import androidx.compose.foundation.layout.Box
4-
import androidx.compose.foundation.layout.ColumnScope
55
import androidx.compose.foundation.layout.fillMaxWidth
66
import androidx.compose.foundation.layout.height
77
import androidx.compose.foundation.shape.RoundedCornerShape
@@ -19,9 +19,14 @@ import androidx.compose.runtime.saveable.rememberSaveable
1919
import androidx.compose.runtime.setValue
2020
import androidx.compose.ui.Alignment
2121
import androidx.compose.ui.Modifier
22+
import androidx.compose.ui.geometry.Rect
2223
import androidx.compose.ui.graphics.Color
24+
import androidx.compose.ui.graphics.Path
25+
import androidx.compose.ui.graphics.PathMeasure
2326
import androidx.compose.ui.graphics.Shape
27+
import androidx.compose.ui.graphics.drawscope.Stroke
2428
import androidx.compose.ui.tooling.preview.Preview
29+
import androidx.compose.ui.unit.Dp
2530
import androidx.compose.ui.unit.dp
2631
import com.yapp.designsystem.theme.OrbitTheme
2732
import kotlinx.coroutines.launch
@@ -37,7 +42,9 @@ fun OrbitBottomSheet(
3742
onDismissRequest: () -> Unit = {},
3843
shape: Shape = RoundedCornerShape(topStart = 30.dp, topEnd = 30.dp),
3944
containerColor: Color = OrbitTheme.colors.gray_800,
40-
content: @Composable ColumnScope.() -> Unit,
45+
strokeColor: Color = OrbitTheme.colors.gray_700,
46+
strokeThickness: Dp = 1.dp,
47+
content: @Composable () -> Unit,
4148
) {
4249
val scope = rememberCoroutineScope()
4350
if (isSheetOpen) {
@@ -54,7 +61,76 @@ fun OrbitBottomSheet(
5461
containerColor = containerColor,
5562
dragHandle = null,
5663
) {
57-
content()
64+
Box {
65+
content()
66+
BottomSheetTopRoundedStroke(
67+
strokeColor = strokeColor,
68+
strokeThickness = strokeThickness,
69+
)
70+
}
71+
}
72+
}
73+
}
74+
75+
@Composable
76+
fun BottomSheetTopRoundedStroke(
77+
modifier: Modifier = Modifier,
78+
strokeColor: Color,
79+
strokeThickness: Dp = 1.dp,
80+
radius: Dp = 30.dp,
81+
) {
82+
Canvas(
83+
modifier = modifier
84+
.fillMaxWidth()
85+
.height(radius + strokeThickness), // Stroke κ³ λ €
86+
) {
87+
val width = size.width
88+
val height = size.height
89+
val radiusPx = radius.toPx()
90+
val fadeWidth = radiusPx // μ–‘ λμ—μ„œ 선이 μ–‡μ•„μ§€λŠ” λ²”μœ„
91+
92+
val path = Path().apply {
93+
moveTo(0f, height) // μ™Όμͺ½ 끝
94+
arcTo(
95+
rect = Rect(0f, 0f, radiusPx * 2, radiusPx * 2),
96+
startAngleDegrees = 180f,
97+
sweepAngleDegrees = 90f,
98+
forceMoveTo = false,
99+
)
100+
lineTo(width - radiusPx, 0f)
101+
arcTo(
102+
rect = Rect(width - radiusPx * 2, 0f, width, radiusPx * 2),
103+
startAngleDegrees = 270f,
104+
sweepAngleDegrees = 90f,
105+
forceMoveTo = false,
106+
)
107+
}
108+
109+
val pathMeasure = PathMeasure().apply { setPath(path, false) }
110+
val totalLength = pathMeasure.length
111+
val segmentCount = 100
112+
113+
for (i in 0 until segmentCount) {
114+
val start = i * (totalLength / segmentCount)
115+
val end = (i + 1) * (totalLength / segmentCount)
116+
117+
val segmentPath = Path()
118+
if (pathMeasure.getSegment(start, end, segmentPath, true)) {
119+
val minThickness = 0.dp.toPx()
120+
val maxThickness = strokeThickness.toPx()
121+
122+
val thickness = when {
123+
start < fadeWidth -> minThickness + (maxThickness - minThickness) * (start / fadeWidth)
124+
start > totalLength - fadeWidth -> minThickness + (maxThickness - minThickness) * ((totalLength - start) / fadeWidth)
125+
else -> maxThickness
126+
}
127+
128+
drawPath(
129+
path = segmentPath,
130+
color = strokeColor,
131+
style = Stroke(width = thickness),
132+
)
133+
}
58134
}
59135
}
60136
}

β€Žfeature/home/src/main/java/com/yapp/alarm/addedit/AlarmAddEditViewModel.kt

+16
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import dagger.hilt.android.lifecycle.HiltViewModel
2020
import feature.home.R
2121
import kotlinx.coroutines.flow.first
2222
import kotlinx.coroutines.launch
23+
import java.time.LocalTime
2324
import javax.inject.Inject
2425

2526
@HiltViewModel
@@ -57,9 +58,23 @@ class AlarmAddEditViewModel @Inject constructor(
5758

5859
alarmUseCase.initializeSoundPlayer(defaultSound.uri)
5960

61+
val now = LocalTime.now()
62+
val initialAmPm = if (now.hour < 12) "μ˜€μ „" else "μ˜€ν›„"
63+
val initialHour = if (now.hour == 0 || now.hour == 12) 12 else now.hour % 12
64+
val initialMinute = now.minute
65+
6066
updateState {
6167
copy(
6268
initialLoading = false,
69+
timeState = timeState.copy(
70+
initialAmPm = initialAmPm,
71+
initialHour = "$initialHour",
72+
initialMinute = initialMinute.toString().padStart(2, '0'),
73+
currentAmPm = initialAmPm,
74+
currentHour = initialHour,
75+
currentMinute = initialMinute,
76+
alarmMessage = getAlarmMessage(initialAmPm, initialHour, initialMinute, emptySet()),
77+
),
6378
soundState = soundState.copy(sounds = sounds, soundIndex = defaultSoundIndex),
6479
)
6580
}
@@ -480,6 +495,7 @@ class AlarmAddEditViewModel @Inject constructor(
480495
return when {
481496
days > 0 -> "${days}일 ${hours}μ‹œκ°„ 후에 μšΈλ €μš”"
482497
hours > 0 -> "${hours}μ‹œκ°„ ${minutes}λΆ„ 후에 μšΈλ €μš”"
498+
minutes == 0L -> "κ³§ μšΈλ €μš”"
483499
else -> "${minutes}λΆ„ 후에 μšΈλ €μš”"
484500
}
485501
}

0 commit comments

Comments
Β (0)