Last active
April 26, 2017 23:03
-
-
Save smaugho/36aa71f1f4217be748742035d811bef9 to your computer and use it in GitHub Desktop.
AndroidAnnotations Dependency Injection and Views Injection
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
@Bean | |
User_ user; | |
@ViewById | |
TextView userFirstName; | |
@ViewById | |
TextView userLastName; | |
@ViewById | |
TextView userEmail; | |
@ViewById | |
ImageView userImage; | |
@AfterViews | |
void populateForm() { | |
userFirstName.setText(user.getFirstName()); | |
userLastName.setText(user.getLastName()); | |
userEmail.setText(user.getEmail()); | |
Picasso.with(this).load(user.getImage()).into(userImage); | |
} | |
@Click | |
void saveUser() { | |
user.setFirstName(userFirstName.getText().toString()); | |
user.setLastName(userLastName.getText().toString()); | |
user.setEmail(userEmail.getText().toString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment