-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
전남대 Android 오진우_6주차 과제 Step2 #84
base: fivejinw
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨어요 진우님! 끝내 멘토링은 진행하지 못해서 얼굴을 뵙지는 못했지만, 그래도 적극적으로 임해주셔서 감사해요! 앞으로도 현업에서든, 행사에서든 뵐날을 기대해볼게요!
마지막에 Splash 화면에 UiState 는 잘 정의해주셨어요. 그렇게 MVVM 을 사용하시면 좋을 것 같습니다 👍
firebase에서RemoteConfig를 가져오는 부분이 어색하지 않은지
잘 가져오고 있어요. RemoteConfigs 로 따로 데이터 클래스도 잘 정의해주셨구요!
새롭게 추가된 부분에 대하여 Hilt가 제대로 적용되고 있는지
RemoteConfigRepository 와 같은 것들은 interface 로 정의 후 implementation 코드를 binds 하는 것을 추천드려요!
remoteConfig에 따른 UIState 관리가 제대로 되고있는지.
UiState 도입이 매우 좋았어요. 조금 더 첨언드리자면 ON_SERVICE 와 같은 것은 uiState 라고 정의하기에는 애매한 부분이 있어요. 특정 message 의 visible 값이 들어가는 것이 조금 더 좋을 수 있습니다 :)
전체적으로 추가할만한 것들이 있는지
Splash Screen 을 추가해주셨으면 더욱 더 좋은 사용성이 제공될 수 있을 것 같네요 :)
class MainApplication : Application() { | ||
override fun onCreate() { | ||
super.onCreate() | ||
KakaoMapSdk.init(this, BuildConfig.KAKAO_NATIVE_APP_KEY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
object KakaoRetrofitInstance { | ||
|
||
val kakaoLocalApi : KakaoLocalApi = getApiClient().create() | ||
|
||
private fun getApiClient(): Retrofit { | ||
return Retrofit.Builder() | ||
.baseUrl(BuildConfig.KAKAO_BASE_URL) | ||
.client(provideOkHttpClient(AppInterceptor())) | ||
.addConverterFactory(GsonConverterFactory.create()) | ||
.build() | ||
} | ||
|
||
private fun provideOkHttpClient(interceptor: AppInterceptor): OkHttpClient | ||
= OkHttpClient.Builder().run { | ||
addInterceptor(interceptor) | ||
build() | ||
} | ||
|
||
class AppInterceptor : Interceptor { | ||
override fun intercept(chain: Interceptor.Chain) : okhttp3.Response = with(chain) { | ||
val newRequest = request().newBuilder() | ||
.addHeader("Authorization", BuildConfig.KAKAO_LOCAL_API_KEY) | ||
.build() | ||
proceed(newRequest) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이런친구들도 hilt 를 통해서 주입받을 수 있도록 하는게 어떨까요?
data class RemoteConfigs( | ||
val state : String, | ||
val message : String | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
fun UpdateSplash(uiState : SplashUIState){ | ||
when (uiState) { | ||
is SplashUIState.Loading -> { | ||
binding.serviceMessage.isVisible = true | ||
binding.serviceMessage.text = "로딩" | ||
} | ||
|
||
is SplashUIState.OnService -> { | ||
Handler(Looper.getMainLooper()).postDelayed({ | ||
val mainIntent = | ||
Intent(this@SplashActivity, MapActivity::class.java) | ||
startActivity(mainIntent) | ||
finish() | ||
}, 2000) | ||
} | ||
|
||
is SplashUIState.OffService -> { | ||
binding.serviceMessage.isVisible = true | ||
binding.serviceMessage.text = uiState.message | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
너무 잘 적용해주셨는데요!? method 만 소문자로 시작하시면 좋을 것 같은데요 ㅋㅋㅋ
Handler(Looper.getMainLooper()).postDelayed({ | ||
val mainIntent = | ||
Intent(this@SplashActivity, MapActivity::class.java) | ||
startActivity(mainIntent) | ||
finish() | ||
}, 2000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coroutine 을 사용하고 계시니, lifecycleScope 내에서 delay 를 사용해보심이 어떨까요?
fun getFCMToken(){ | ||
FirebaseMessaging.getInstance().token.addOnCompleteListener(OnCompleteListener { task -> | ||
if (!task.isSuccessful) { | ||
return@OnCompleteListener | ||
} | ||
Log.d("testtt", task.result.toString()) | ||
|
||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이런 로직은 ViewModel 로 옮겨주시는 것이 좋아요!
안녕하세요 코치님! 마지막 코드리뷰 부탁드립니다!
코드 작성하면서 어려웠던 점 & 느낀 점
멘토님께서 중점적으로 리뷰해주셨으면 하는 부분