Conversation
| override fun onCreate() { | ||
| prefs = UserSharedPreferences(this) | ||
| super.onCreate() | ||
| if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree()) |
| @@ -34,12 +33,15 @@ class MainActivity : AppCompatActivity() { | |||
| R.id.menu_home -> { | |||
| this.changeFragment(HomeFragment()) | |||
There was a problem hiding this comment.
이렇게 하면 프래그먼트 전환 시마다 프래그먼트 객체가 생겨날 것 같은데, 이를 방지하려면 어떤 방식으로 해결해볼 수 있을지 고민해보시면 좋을 것 같습니다 !
|
|
||
| override fun onDestroyView() { | ||
| super.onDestroyView() | ||
| pagerAdapter = null |
| fun bind(userData: HomeUser) { | ||
| with(binding) { | ||
| data = userData | ||
| ivAvatar.load(userData.avatar) |
There was a problem hiding this comment.
확실히 Glide보다 간결하고 좋은 것 같습니다!
|
|
||
| override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SearchViewHolder { | ||
| val binding = ItemSearchBinding.inflate(inflater, parent, false) | ||
| val binding = ItemSearchBinding.inflate(LayoutInflater.from(parent.context), parent, false) |
| _binding = DataBindingUtil.inflate(inflater, layoutRes, container, false) | ||
| binding.lifecycleOwner = viewLifecycleOwner |
There was a problem hiding this comment.
binding과 vm을 연결해주는 부분은 각각의 프래그먼트에서 작업하신 것 같아요. 하지만 이 작업을 까먹고 안 할수도 있을 것 같아요(휴먼이슈). 이 작업을 해야한다는 것을 명시적으로 나타낼 수 있는 방법이 있을까요 !?
| abstract class BindingActivity<T : ViewDataBinding>( | ||
| @LayoutRes private val layoutRes: Int, | ||
| ) : AppCompatActivity() { |
There was a problem hiding this comment.
저 같은 경우에는, BindingActivity를 ViewBindingActivity와 DataBindingActivity로 나누어 놓는 편입니다!
물론 절대 정답은 아니구요.
제가 그렇게 하는 이유는 구글 공식문서에 나와있듯, 뷰바인딩이 컴파일 시간이 더 빠르고 코드 수도 줄어들기 때문입니다 !
이에 대한 의견이 있다면 자유롭게 달아주세요! 저도 배워가고 있습니다.
| override fun onCreate() { | ||
| prefs = UserSharedPreferences(this) | ||
| super.onCreate() | ||
| if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree()) |
| companion object { | ||
| val ID_PATTERN = "^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z0-9]{6,10}\$".toRegex() | ||
| val PASSWORD_PATTERN = | ||
| "^(?=.*[a-zA-Z])(?=.*[!@#\$%^&*()])(?=.*[0-9])[a-zA-Z!@#\$%^&*()0-9]{6,12}\$".toRegex() |
There was a problem hiding this comment.
오 저도 regex를 companion object로 빼주어야겠습니다.
| if (viewModel.isValidPassword.value == false && viewModel.password.value != "") { | ||
| binding.etSignupPassword.error = "영문, 숫자, 특수문자가 포함되어야 하며 6~12글자 이내" | ||
| } else { | ||
| binding.etSignupPassword.error = null |
| if (viewModel.isValidPassword.value == false && viewModel.password.value != "") { | ||
| binding.etSignupPassword.error = "영문, 숫자, 특수문자가 포함되어야 하며 6~12글자 이내" | ||
| } else { | ||
| binding.etSignupPassword.error = null |
| @Provides | ||
| @Singleton | ||
| fun providesKakaoSearchService(@RetrofitModule.Retrofit2(BaseUrlType.KAKAO) retrofit: Retrofit): KakaoSearchService = | ||
| retrofit.create(KakaoSearchService::class.java) |
|
|
||
| override fun onDestroyView() { | ||
| super.onDestroyView() | ||
| pagerAdapter = null |
|
선환아 폼 진짜 미쳤다... |
amourxyoung
left a comment
There was a problem hiding this comment.
선환님 너무 잘하셔서 리뷰 달게 없네요,,,, 짱이다👍 앱잼 홧팅 !!!
| import org.android.go.sopt.util.UserSharedPreferences | ||
| import timber.log.Timber | ||
|
|
||
| @HiltAndroidApp |
| private val authDataSource: AuthDataSource, | ||
| ) : AuthRepository { | ||
| override suspend fun signIn(requestSignInDto: RequestSignInDto): Result<ResponseSignInDto?> = | ||
| runCatching { |
There was a problem hiding this comment.
저같은 경우에는 runCatching에서 제공해주는 onSuccess, onFailure를 이용해서 로직이 잘 실행되고 있는지 로그 찍어서 확인하는 용으로 유용하게 사용하고 있어용 추후에 참고하시라고 ~
| @Provides | ||
| @Singleton | ||
| fun providesKakaoSearchService(@RetrofitModule.Retrofit2(BaseUrlType.KAKAO) retrofit: Retrofit): KakaoSearchService = | ||
| retrofit.create(KakaoSearchService::class.java) |
필수 과제
심화 과제
도전 과제
부족한 부분