Skip to content
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

리스너(Euphony) 함수 추가 및 MainActivity에 onClickListener 추가 #8

Merged
merged 2 commits into from Sep 18, 2021

Conversation

YoungSeokHong
Copy link
Contributor

죄송합니다 생각보다 CMake에 오래 잡혀있느라 PR이 늦었네요ㅠㅠ

우선 진산님하고 만들기로 한 리스너를 만들기 위해서 버튼을 받아오는 onClickListener를 만들고 listener()함수를 viewModel에 만들었습니다. 코틀린도 처음이고 mvvm 모델도 처음이라 맞게 한건지 모르겠네요ㅠㅠ 혹독한 피드백 부탁드립니다!

@Jsueeee
Copy link
Member

Jsueeee commented Sep 17, 2021

우선 첫 pr이네요! 넘넘 수고하셨습니다! 👍👍👍👍👍👍

@@ -21,10 +22,23 @@ class MainActivity : AppCompatActivity() {
model.listenData.observe(this, Observer {
binding.tvNum.text = it.toString()
})

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
binding.btnListen.setOnClickListener { model.listener() }

Copy link
Member

Choose a reason for hiding this comment

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

코틀린이 처음이라고 하셔서요! 피드백을 드리자면 코틀린은 함수형 프로그래밍 언어이기 때문에 자바보다 훨씬 간결하게 코드를 짤 수 있습니다! 이게 코틀린의 장점이죠!! MainActivity에 새로 추가하신 모든 초록색 코드 대신에 이 한줄로 표현할 수 있습니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ㅋㅋㅋㅋㅋㅋㅋㅋㅋ 코틀린은 자비가 없군요. 감사합니다!

Copy link
Member

Choose a reason for hiding this comment

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

ㅎㅎ 코틀린은 언어 패러다임 연구하시는 분들도 객체지향과 함수형을 잘 섞었다고 많이들 좋아하시더라구요.

Copy link
Member

@sujin9 sujin9 left a comment

Choose a reason for hiding this comment

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

저도 코틀린이 처음이라 저렇게 한 줄로 표현이 가능한지 몰랐네요..!
배우고 갑니당 감사해요 ㅎㅎ

@dlwlstks96
Copy link
Contributor

고생하셨습니다!! mvvm 패턴 공부해봤는데 왜 어렵다 하셨는지 알았습니다ㅠ
만들어주신 listener 함수 내에서 EuRxManager 객체 생성하고 listener 설정 및 음파 수신하게끔 진행하면 되는 것 맞을까요??
@YoungSeokHong

Copy link
Contributor

@eunzinn eunzinn left a comment

Choose a reason for hiding this comment

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

저도 코틀린이 처음인데 쉬운듯 하면서 어렵네요..! 고생하셨씁니다!!!

@YoungSeokHong
Copy link
Contributor Author

고생하셨습니다!! mvvm 패턴 공부해봤는데 왜 어렵다 하셨는지 알았습니다ㅠ
만들어주신 listener 함수 내에서 EuRxManager 객체 생성하고 listener 설정 및 음파 수신하게끔 진행하면 되는 것 맞을까요??
@YoungSeokHong

네넵 찾아보니까 대부분의 정보처리는 VeiwModel에서 일어나는 것 같아서 MainViewModel에 있는 listener함수를 사용하시면 될 것 같습니다!

@YoungSeokHong YoungSeokHong merged commit cd6f0f3 into euphony-io:master Sep 18, 2021
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.

None yet

6 participants