-
Notifications
You must be signed in to change notification settings - Fork 1
[김예란_Android] 7주차 과제 제출 #7
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
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| override fun onEditButtonClick(word: WordEntity) { | ||
| val intent = Intent(this@MainActivity, SecondActivity::class.java) | ||
| intent.putExtra("WORD_ID", word.id) |
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.
key <=> constant
|
|
||
| adapter.setOnWordItemClickListener(object : WordAdapter.OnWordItemClickListener{ | ||
| override fun onWordItemClick(position: Int, word: WordEntity) { | ||
| adapter.moveToTop(position) |
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.
오... 단어 클릭 시 단어 리스트에서 최상단으로 가는 게 아닌
해당 단어를 최상단에 존재하는 선택된 단어 표시 view 에 보여달라는 의미 입니다.
| wordViewModel = ViewModelProvider(this)[WordViewModel::class.java] | ||
|
|
||
| wordId = intent.getIntExtra("WORD_ID", -1) | ||
| if (wordId == -1) { |
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.
-1 이 곧 없음인데 굳이 null 로 한번 더 바꿀 필요는 없다고 생각합니다.
| val existingWord = intent.getStringExtra("WORD") | ||
| val existingMeaning = intent.getStringExtra("MEANING") | ||
|
|
||
| if (wordId != null) { |
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.
wordId?.let {} 의 방법도 있습니다.
No description provided.