Skip to content

Instantly share code, notes, and snippets.

@adrianhall
Created May 13, 2018 04:39
Show Gist options
  • Save adrianhall/868c1cd95c25270ee61496b080dd076b to your computer and use it in GitHub Desktop.
Save adrianhall/868c1cd95c25270ee61496b080dd076b to your computer and use it in GitHub Desktop.
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val rootView = inflater.inflate(R.layout.fragment_note_detail, container, false)
viewModel.currentNote.observe(this, Observer {
it?.let {
rootView.detail_id_field.text = it.noteId
rootView.detail_title_editor.text.set(it.title)
rootView.detail_content_editor.text.set(it.content)
}
})
rootView.detail_title_editor.afterTextChanged { saveNote() }
rootView.detail_content_editor.afterTextChanged { saveNote() }
return rootView
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment