-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* UiText 보완 String Resoucr 내에 변수가 있는 경우에 대한 대응을 하기 위함 * core:util 모듈 추가 ui 모듈과 util 모듈을 분리, 다른 모듈들에서 공통으로 사용하는 ui와 관련되지 않는 함수 및 클래스를 모아둠 패키지 구조 변경-> 확장함수가 아닌 파일들은 extension 밖으로 꺼냄 * deprecated 된 아이콘 교체 * ObserveAsEvents 함수 추가 Event 를 핸들링 하기 위함 * MVVM 패턴에 맞게 ViewModel 에서 사용자의 액션을 처리하고, 이벤트를 View 에 전달하는 방식으로 변경 뷰에서 사용자의 액션을 직접 처리하는 것은 MVVM 패턴에 위배, style check success * 네비게이션 바 스타일에 따라 모달 바텀시트의 하단의 패딩의 차이가 생기는 것을 보정 * style check success * @nAmed Annotation -> @qualifier Annotation 으로 변경 @nAmed 를 통한 동일한 타입에 대한 식별의 경우 하드 코딩된 문자열이 식별자이므로 휴먼 에러가 발생할 수 있음 @nAmed 를 통한 식별보단 조금 더 복잡하지만 타입 안정성을 제공하고, 휴먼 에러가 발생할 가능성이 없는 Custom Qualifier(Custom Annotation Class)의 방법으로 변경 * modifier parameter 순서 변경 및 modifier 가 없는 Composable modifier 추가 공식 문서에 의하면 modifier 의 위치는 first 'optional' parameter 임, first parameter 가 아니라 * core:ui 모듈로 빼낼 수 있는 컴포저블 core:ui 모듈로 이동 * deprecated 된 아이콘 변경 필요 없는 import 제거
- Loading branch information
Showing
63 changed files
with
446 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...etwork/src/main/kotlin/com/nexters/bandalart/android/core/network/di/RetrofitQualifier.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.nexters.bandalart.android.core.network.di | ||
|
||
import javax.inject.Qualifier | ||
|
||
@Qualifier | ||
@Retention(AnnotationRetention.BINARY) | ||
annotation class BandalartApi | ||
|
||
@Qualifier | ||
@Retention(AnnotationRetention.BINARY) | ||
annotation class LoginApi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...core/ui/extension/MultipleEventsCutter.kt → ...t/android/core/ui/MultipleEventsCutter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
core/ui/src/main/kotlin/com/nexters/bandalart/android/core/ui/ObserveEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.nexters.bandalart.android.core.ui | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.LaunchedEffect | ||
import androidx.compose.ui.platform.LocalLifecycleOwner | ||
import androidx.lifecycle.Lifecycle | ||
import androidx.lifecycle.repeatOnLifecycle | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.withContext | ||
|
||
// https://www.youtube.com/watch?v=njchj9d_Lf8&t=1218s | ||
@Composable | ||
fun <T> ObserveAsEvents(flow: Flow<T>, onEvent: (T) -> Unit) { | ||
val lifecycleOwner = LocalLifecycleOwner.current | ||
LaunchedEffect(flow, lifecycleOwner.lifecycle) { | ||
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { | ||
withContext(Dispatchers.Main.immediate) { | ||
flow.collect(onEvent) | ||
} | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...art/android/core/ui/extension/TextUnit.kt → ...ers/bandalart/android/core/ui/TextUnit.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t/android/core/ui/extension/ThemeColor.kt → ...s/bandalart/android/core/ui/ThemeColor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
core/ui/src/main/kotlin/com/nexters/bandalart/android/core/ui/UiText.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.nexters.bandalart.android.core.ui | ||
|
||
import android.content.Context | ||
import androidx.annotation.StringRes | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.res.stringResource | ||
|
||
sealed class UiText { | ||
data class DirectString(val value: String) : UiText() | ||
|
||
class StringResource( | ||
@StringRes val resId: Int, | ||
vararg val args: Any, | ||
) : UiText() | ||
|
||
@Composable | ||
fun asString() = when (this) { | ||
is DirectString -> value | ||
is StringResource -> stringResource(resId, *args) | ||
} | ||
|
||
fun asString(context: Context) = when (this) { | ||
is DirectString -> value | ||
is StringResource -> context.getString(resId, *args) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.