Skip to content

Instantly share code, notes, and snippets.

@rafaelneiva
Created April 4, 2019 13:20
Show Gist options
  • Save rafaelneiva/cf79a22c753ee325aff6ccd54d332ece to your computer and use it in GitHub Desktop.
Save rafaelneiva/cf79a22c753ee325aff6ccd54d332ece to your computer and use it in GitHub Desktop.
Setter template for Databinding BaseObservable in Android Studio
#set($paramName = $helper.getParamName($field, $project))
#if($field.modifierStatic)
static ##
#end
void set$StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project)))($field.type $paramName) {
#if ($field.name == $paramName)
#if (!$field.modifierStatic)
this.##
#else
$classname.##
#end
#end
$field.name = $paramName;
notifyPropertyChanged(BR.$field.name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment