Skip to content

Commit d0d1b81

Browse files
authored
UI 커스텀 테마 생성 [#130] (#156)
- **[Issue]** #130 - **[Descriptions]** - AppDesignSystem 컴포저블 생성 - Color, Shape, Type, Theme 수정 - Size 추가 - font_certs.xml 추가 - MainActivity, HomeScreen, SelectMethodScreen, SettingScreen, ShareScreen, InternalCamera, 수정 - Basic 컴포저블 생성 - FourCutFrame 수정 - SelectFrameViewModel, SettingViewModel 수정
2 parents f59275c + 893afd1 commit d0d1b81

File tree

32 files changed

+1544
-1187
lines changed

32 files changed

+1544
-1187
lines changed

data/src/main/java/com/foke/together/data/repository/AppPreferencesRepository.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import com.foke.together.domain.output.AppPreferenceInterface
1111
import kotlinx.coroutines.flow.Flow
1212
import kotlinx.coroutines.flow.map
1313
import javax.inject.Inject
14+
import kotlin.time.Duration
15+
import kotlin.time.DurationUnit
16+
import kotlin.time.toDuration
1417

1518
// TODO: datasource -> local / remote 기준으로 module 구분하는게 어떨지?
1619
class AppPreferencesRepository @Inject constructor(
@@ -98,6 +101,19 @@ class AppPreferencesRepository @Inject constructor(
98101
}
99102
}
100103

104+
override fun getCaptureDuration(): Flow<Duration> = appPreferencesFlow.map {
105+
it.cameraDuration.toDuration(DurationUnit.MILLISECONDS)
106+
}
107+
108+
override suspend fun setCaptureDuration(duration: Duration) {
109+
appPreferences.updateData {
110+
it.toBuilder()
111+
.setCameraDuration(duration.toLong(DurationUnit.MILLISECONDS))
112+
.build()
113+
}
114+
}
115+
116+
101117

102118
override suspend fun clearAll() {
103119
appPreferences.updateData {

data/src/main/proto/app_preferences.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ message AppPreferences {
2020
int32 internal_camera_capture_mode = 22;
2121
int32 internal_camera_aspect_ratio = 23;
2222

23+
int64 camera_duration = 24;
24+
2325
// TODO: sample code. remove later.
2426
string sample_id = 999997;
2527
string sample_title = 999998;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.foke.together.domain
2+
3+
import com.foke.together.domain.output.AppPreferenceInterface
4+
import kotlinx.coroutines.flow.Flow
5+
import javax.inject.Inject
6+
import kotlin.time.Duration
7+
8+
class GetCaptureDurationUseCase @Inject constructor(
9+
private val appPreferenceInterface: AppPreferenceInterface
10+
) {
11+
operator fun invoke() : Flow<Duration> = appPreferenceInterface.getCaptureDuration()
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.foke.together.domain
2+
3+
import com.foke.together.domain.output.AppPreferenceInterface
4+
import javax.inject.Inject
5+
import kotlin.time.Duration
6+
7+
class SetCaptureDurationUseCase @Inject constructor(
8+
private val appPreferenceInterface: AppPreferenceInterface
9+
) {
10+
suspend operator fun invoke(duration: Duration) = appPreferenceInterface.setCaptureDuration(duration)
11+
}

domain/src/main/java/com/foke/together/domain/interactor/GetInternalCameraLensFacingUseCase.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,5 @@ import javax.inject.Inject
99
class GetInternalCameraLensFacingUseCase @Inject constructor(
1010
private val appPreferenceRepository: AppPreferenceInterface
1111
) {
12-
operator fun invoke() : Flow<CameraSelector> = appPreferenceRepository.getInternalCameraLensFacing().map { cameraSelectorIdx ->
13-
CameraSelector.Builder()
14-
.requireLensFacing(cameraSelectorIdx)
15-
.build()
16-
}
12+
operator fun invoke() : Flow<Int> = appPreferenceRepository.getInternalCameraLensFacing()
1713
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.foke.together.domain.interactor
2+
3+
import com.foke.together.domain.output.AppPreferenceInterface
4+
import javax.inject.Inject
5+
6+
class SetInternalCameraLensFacingUseCase @Inject constructor(
7+
private val appPreferenceRepository: AppPreferenceInterface
8+
) {
9+
suspend operator fun invoke(lensFacing: Int) = appPreferenceRepository.setInternalCameraLensFacing(lensFacing)
10+
}

domain/src/main/java/com/foke/together/domain/interactor/entity/CutFrameType.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,18 @@ sealed class DefaultCutFrameSet (
165165
),
166166
dateStringHeight = 495
167167
)
168+
169+
companion object {
170+
val entries = listOf(
171+
FourCutLight,
172+
FourCurDark,
173+
MakerFaire,
174+
Wedding1,
175+
Wedding2,
176+
Bride1,
177+
Bride2,
178+
Groom1,
179+
Groom2,
180+
).sortedBy { it.index }
181+
}
168182
}

domain/src/main/java/com/foke/together/domain/output/AppPreferenceInterface.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import androidx.camera.core.CameraSelector
55
import com.foke.together.domain.interactor.entity.CameraSourceType
66
import com.foke.together.domain.interactor.entity.ExternalCameraIP
77
import kotlinx.coroutines.flow.Flow
8+
import kotlin.time.Duration
89

910
interface AppPreferenceInterface {
1011
fun getCameraSourceType(): Flow<CameraSourceType>
@@ -28,5 +29,11 @@ interface AppPreferenceInterface {
2829
@IntRange(from = 0, to = 2) captureMode: Int
2930
)
3031

32+
fun getCaptureDuration(): Flow<Duration>
33+
34+
suspend fun setCaptureDuration(
35+
duration: Duration
36+
)
37+
3138
suspend fun clearAll()
3239
}

external/src/main/java/com/foke/together/external/repository/InternalCameraRepository.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import javax.inject.Singleton
2626
@Singleton
2727
class InternalCameraRepository @Inject constructor(
2828
): InternalCameraRepositoryInterface{
29-
private lateinit var previewView: PreviewView
3029
private lateinit var cameraController: LifecycleCameraController
3130
private lateinit var imageCapture: ImageCapture
3231

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
9696
androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
9797
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
9898
androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
99+
androidx-ui-text-google-fonts = { group = "androidx.compose.ui", name = "ui-text-google-fonts" }
99100
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
100101
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation-compose" }
101102

0 commit comments

Comments
 (0)