-
Notifications
You must be signed in to change notification settings - Fork 2
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
[REFACTOR/#188] 코드 리펙토링 및 navigate 확장함수 구현 #190
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.
코드가 이렇게 간결해질 수 있구나,,,를 깨달으며,,,입이 안 다물어져요,,,
navigateToScreen<DashBoardActivity>( | ||
listOf( | ||
Intent.FLAG_ACTIVITY_NEW_TASK, | ||
Intent.FLAG_ACTIVITY_CLEAR_TASK, | ||
), | ||
) |
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.
오 이렇게 사용하면 되는군요!
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.
와.........................미쳤다...............
inline fun <reified T : Activity> Activity.navigateToScreen( | ||
flags: List<Int>? = null, | ||
addFlags: Boolean = true, | ||
isFinish: Boolean = true, | ||
) { | ||
Intent(this, T::class.java).apply { | ||
if (addFlags) { | ||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) | ||
flags?.map { | ||
addFlags(it) | ||
} | ||
} | ||
startActivity(this) | ||
} | ||
if (isFinish) { | ||
finish() | ||
} | ||
} |
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.
진짜,,,최고다,,,,,,,,,,,,
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.
확장함수 말안되네 진짜 ,,, 당신멋져
private fun observeCheckedState(checkedStateFlow: Flow<Boolean>, textView: TextView) { | ||
checkedStateFlow.flowWithLifecycle(lifecycle).onEach { | ||
textView.setTextAppearance(setFont(it)) | ||
}.launchIn(lifecycleScope) | ||
} |
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.
checkedStateFlow 네이밍 보다는, isFirstChecked의 형태를 유지하는 파라미터면 더 깔끔할 것 같다는 생각!
동일한 느낌으로, {} 안에도 it 대신 네이밍을 부여해준다면 이후 유지보수할때 코드를 이해하기 더 쉬워질듯합니닷
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.
이부분은 미처 신경쓰지 못했었네요! 해당 함수의 파라미터의 이름을 아규먼츠의 네이밍과 비슷하게 해두는게 좋은 방식인 것 같습니다! 그래서 checkedStateFlow -> isCheckedState로 네이밍 변경하였습니다.
it은 안써야지.. 하면서도 계속 쓰고있네요 ㅋㅋㅋㅋ isChecked로 후딱 수정했습니다 :)
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.
pr 설명도 넘 자세히 올려주어서 이해가 아주...쏙쏙.......미쳤따......이걸 왜 지금 봤지 진짜 대박
수고햇습니다요 👍👍👍👍👍
navigateToScreen<DashBoardActivity>( | ||
listOf( | ||
Intent.FLAG_ACTIVITY_NEW_TASK, | ||
Intent.FLAG_ACTIVITY_CLEAR_TASK, | ||
), | ||
) |
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.
와.........................미쳤다...............
inline fun <reified T : Activity> Activity.navigateToScreen( | ||
flags: List<Int>? = null, | ||
addFlags: Boolean = true, | ||
isFinish: Boolean = true, | ||
) { | ||
Intent(this, T::class.java).apply { | ||
if (addFlags) { | ||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) | ||
flags?.map { | ||
addFlags(it) | ||
} | ||
} | ||
startActivity(this) | ||
} | ||
if (isFinish) { | ||
finish() |
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.
와...............
⛳️ Work Description
📢 To Reviewers