Skip to content

Instantly share code, notes, and snippets.

@smaugho
Last active April 26, 2017 23:09
Show Gist options
  • Save smaugho/6a320b9d7020cd7177389baf29d5ca6f to your computer and use it in GitHub Desktop.
Save smaugho/6a320b9d7020cd7177389baf29d5ca6f to your computer and use it in GitHub Desktop.
AddressFragment Example
@EFragment(R.id.fragment_address)
public class AddressFragment extends Fragment {
@FragmentArg
@Model
@Populate
@Recollect(validate = true)
User user;
@Click
void save() {
$AlertDialog()
.message("Are you sure you want to save this user?")
.positiveButton("Yes").negativeButton("No");
$PutModel(user);
if ($PutModel.Failed) {
$Toast("User {user.fullName()} couldn't be saved");
}
$Toast("User {user.fullName()} has been saved");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment