Skip to content

Week6#11

Open
SeonHwan-Kim wants to merge 30 commits intodevelopfrom
week6
Open

Week6#11
SeonHwan-Kim wants to merge 30 commits intodevelopfrom
week6

Conversation

@SeonHwan-Kim
Copy link
Collaborator

필수 과제

  • 홈 화면 UI layer 만들어보기
  • 경고 띄우기
    • id 조건 바꾸기
    • 생성 조건 맞지 않을 시 버튼 비활성화
    • 비밀번호 조건 맞지 않을 시 경고

심화 과제

  • 기존 코드 UI layer 분리
  • 양방향 데이터 바인딩 사용

도전 과제

  • Data Layer 분리

부족한 부분

  • 처음에 textInputLayout errorEnabled와 helperText를 databinding을 통해 구분해줬는데 이상하게 잘 작동이 안돼서 우선은 activity에서 값을 변경해줌
  • 로딩뷰

override fun onCreate() {
prefs = UserSharedPreferences(this)
super.onCreate()
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timber까지 못 하는게 뭐니?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사실 그저 복붙..ㅠ

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

짱이다,,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

선환이 멋지다

@@ -34,12 +33,15 @@ class MainActivity : AppCompatActivity() {
R.id.menu_home -> {
this.changeFragment(HomeFragment())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 하면 프래그먼트 전환 시마다 프래그먼트 객체가 생겨날 것 같은데, 이를 방지하려면 어떤 방식으로 해결해볼 수 있을지 고민해보시면 좋을 것 같습니다 !


override fun onDestroyView() {
super.onDestroyView()
pagerAdapter = null

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

크 ㅋㅋ

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

크 ㅋㅋ

fun bind(userData: HomeUser) {
with(binding) {
data = userData
ivAvatar.load(userData.avatar)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coil 적용 Good !!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확실히 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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헤헷 굿

Comment on lines +23 to +24
_binding = DataBindingUtil.inflate(inflater, layoutRes, container, false)
binding.lifecycleOwner = viewLifecycleOwner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

binding과 vm을 연결해주는 부분은 각각의 프래그먼트에서 작업하신 것 같아요. 하지만 이 작업을 까먹고 안 할수도 있을 것 같아요(휴먼이슈). 이 작업을 해야한다는 것을 명시적으로 나타낼 수 있는 방법이 있을까요 !?

Comment on lines +11 to +13
abstract class BindingActivity<T : ViewDataBinding>(
@LayoutRes private val layoutRes: Int,
) : AppCompatActivity() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저 같은 경우에는, BindingActivity를 ViewBindingActivity와 DataBindingActivity로 나누어 놓는 편입니다!
물론 절대 정답은 아니구요.

제가 그렇게 하는 이유는 구글 공식문서에 나와있듯, 뷰바인딩이 컴파일 시간이 더 빠르고 코드 수도 줄어들기 때문입니다 !

이에 대한 의견이 있다면 자유롭게 달아주세요! 저도 배워가고 있습니다.

Copy link

@giovannijunseokim giovannijunseokim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굳굳~~ 고생하셨습니다 !

override fun onCreate() {
prefs = UserSharedPreferences(this)
super.onCreate()
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

선환이 멋지다

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()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 저도 regex를 companion object로 빼주어야겠습니다.

if (viewModel.isValidPassword.value == false && viewModel.password.value != "") {
binding.etSignupPassword.error = "영문, 숫자, 특수문자가 포함되어야 하며 6~12글자 이내"
} else {
binding.etSignupPassword.error = null

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 error도 null로 해놓는 특별한 이유가 있나요??

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요속성들 tools:error라는 속성! xml로 옮기는 방법도 있어요

Copy link

@lsakee lsakee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

배우고 갑니다 !

if (viewModel.isValidPassword.value == false && viewModel.password.value != "") {
binding.etSignupPassword.error = "영문, 숫자, 특수문자가 포함되어야 하며 6~12글자 이내"
} else {
binding.etSignupPassword.error = null
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요속성들 tools:error라는 속성! xml로 옮기는 방법도 있어요

Comment on lines +27 to +30
@Provides
@Singleton
fun providesKakaoSearchService(@RetrofitModule.Retrofit2(BaseUrlType.KAKAO) retrofit: Retrofit): KakaoSearchService =
retrofit.create(KakaoSearchService::class.java)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

di 강의 해주시나요?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

진짜 왤케 잘하세요 선환님


override fun onDestroyView() {
super.onDestroyView()
pagerAdapter = null
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

크 ㅋㅋ

Copy link

@lsakee lsakee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

배우고 갑니다 !

@b1urrrr
Copy link
Member

b1urrrr commented Jun 18, 2023

선환아 폼 진짜 미쳤다...
앱잼 화이팅!!!!!!

Copy link

@amourxyoung amourxyoung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

선환님 너무 잘하셔서 리뷰 달게 없네요,,,, 짱이다👍 앱잼 홧팅 !!!

import org.android.go.sopt.util.UserSharedPreferences
import timber.log.Timber

@HiltAndroidApp

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

와 DI까지 적용하셨네요 진짜 멋지시네요,,,,,🥺👍

private val authDataSource: AuthDataSource,
) : AuthRepository {
override suspend fun signIn(requestSignInDto: RequestSignInDto): Result<ResponseSignInDto?> =
runCatching {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저같은 경우에는 runCatching에서 제공해주는 onSuccess, onFailure를 이용해서 로직이 잘 실행되고 있는지 로그 찍어서 확인하는 용으로 유용하게 사용하고 있어용 추후에 참고하시라고 ~

Comment on lines +27 to +30
@Provides
@Singleton
fun providesKakaoSearchService(@RetrofitModule.Retrofit2(BaseUrlType.KAKAO) retrofit: Retrofit): KakaoSearchService =
retrofit.create(KakaoSearchService::class.java)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

진짜 왤케 잘하세요 선환님

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants