Created
March 25, 2018 20:55
-
-
Save ChaitanyaPramod/9029890e4127679d3ebd385d0e6d630f 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
private static Unbinder createBinding(@NonNull Object target, @NonNull View source) { | |
Class<?> targetClass = target.getClass(); | |
... | |
Constructor<? extends Unbinder> constructor = findBindingConstructorForClass(targetClass); | |
... | |
try { | |
return constructor.newInstance(target, source); | |
} | |
... | |
} | |
@Nullable @CheckResult @UiThread | |
private static Constructor<? extends Unbinder> findBindingConstructorForClass(Class<?> cls) { | |
Constructor<? extends Unbinder> bindingCtor; | |
... // Removed cache code | |
String clsName = cls.getName(); | |
... | |
try { | |
Class<?> bindingClass = cls.getClassLoader().loadClass(clsName + "_ViewBinding"); | |
... | |
bindingCtor = (Constructor<? extends Unbinder>) bindingClass.getConstructor(cls, View.class); | |
... | |
} | |
... | |
return bindingCtor; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment