Last active
April 3, 2018 02:55
-
-
Save Laimiux/68d65d0f48168adfd152668177ce7737 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CommentFormView(val rootView: View) { | |
// View binding logic | |
val commentTextField: EditText = rootView.findViewById(R.id.comment_text_field) | |
val submitButton: Button = rootView.findViewById(R.id.submit_button) | |
// Our view update function, takes a view state | |
// snapshot and updates the android views | |
fun setViewState(state: CommentFormViewState) { | |
commentTextField.text = state.textEntered | |
submitButton.isEnabled = state.isSubmitButtonEnabled | |
// update the listeners ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment