本文整理汇总了Java中butterknife.internal.ListenerClass类的典型用法代码示例。如果您正苦于以下问题:Java ListenerClass类的具体用法?Java ListenerClass怎么用?Java ListenerClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListenerClass类属于butterknife.internal包,在下文中一共展示了ListenerClass类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addMethodBinding
import butterknife.internal.ListenerClass; //导入依赖的package包/类
public void addMethodBinding(ListenerClass listener, ListenerMethod method,
MethodViewBinding binding) {
Map<ListenerMethod, Set<MethodViewBinding>> methods = methodBindings.get(listener);
Set<MethodViewBinding> set = null;
if (methods == null) {
methods = new LinkedHashMap<>();
methodBindings.put(listener, methods);
} else {
set = methods.get(method);
}
if (set == null) {
set = new LinkedHashSet<>();
methods.put(method, set);
}
set.add(binding);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:ViewBinding.java
示例2: addMethodBinding
import butterknife.internal.ListenerClass; //导入依赖的package包/类
public void addMethodBinding(ListenerClass listener, ListenerMethod method,
MethodViewBinding binding) {
Map<ListenerMethod, Set<MethodViewBinding>> methods = methodBindings.get(listener);
Set<MethodViewBinding> set = null;
if (methods == null) {
methods = new LinkedHashMap<>();
methodBindings.put(listener, methods);
} else {
set = methods.get(method);
}
if (set == null) {
set = new LinkedHashSet<>();
methods.put(method, set);
}
set.add(binding);
}
开发者ID:CaMnter,项目名称:AndroidLife,代码行数:17,代码来源:ViewBinding.java
示例3: hasOnTouchMethodBindings
import butterknife.internal.ListenerClass; //导入依赖的package包/类
private boolean hasOnTouchMethodBindings() {
for (ViewBinding bindings : viewBindings) {
if (bindings.getMethodBindings()
.containsKey(OnTouch.class.getAnnotation(ListenerClass.class))) {
return true;
}
}
return false;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:BindingSet.java
示例4: addMethod
import butterknife.internal.ListenerClass; //导入依赖的package包/类
boolean addMethod(
Id id,
ListenerClass listener,
ListenerMethod method,
MethodViewBinding binding) {
ViewBinding.Builder viewBinding = getOrCreateViewBindings(id);
if (viewBinding.hasMethodBinding(listener, method) && !"void".equals(method.returnType())) {
return false;
}
viewBinding.addMethodBinding(listener, method, binding);
return true;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:BindingSet.java
示例5: hasOnTouchMethodBindings
import butterknife.internal.ListenerClass; //导入依赖的package包/类
private boolean hasOnTouchMethodBindings() {
for (ViewBinding bindings : viewBindings) {
if (bindings.getMethodBindings()
.containsKey(OnTouch.class.getAnnotation(ListenerClass.class))) {
return true;
}
}
return false;
}
开发者ID:qq542391099,项目名称:butterknife-parent,代码行数:10,代码来源:BindingSet.java
示例6: addMethod
import butterknife.internal.ListenerClass; //导入依赖的package包/类
boolean addMethod(
Id id,
ListenerClass listener,
ListenerMethod method,
MethodViewBinding binding) {
ViewBinding.Builder viewBinding = getOrCreateViewBindings(id);
if (viewBinding.hasMethodBinding(listener, method) && !"void".equals(method.returnType())) {
return false;
}
viewBinding.addMethodBinding(listener, method, binding);
return true;
}
开发者ID:qq542391099,项目名称:butterknife-parent,代码行数:13,代码来源:BindingSet.java
示例7: addMethod
import butterknife.internal.ListenerClass; //导入依赖的package包/类
boolean addMethod(
Id id,
ListenerClass listener,
ListenerMethod method,
MethodViewBinding binding) {
ViewBindings viewBindings = getOrCreateViewBindings(id);
if (viewBindings.hasMethodBinding(listener, method) && !"void".equals(method.returnType())) {
return false;
}
viewBindings.addMethodBinding(listener, method, binding);
return true;
}
开发者ID:hoangkien0705,项目名称:Android-ButterKinfe,代码行数:13,代码来源:BindingClass.java
示例8: hasOnTouchMethodBindings
import butterknife.internal.ListenerClass; //导入依赖的package包/类
/**
* 校验该 ViewBinding @OnTouch 是否有 @ListenerClass 注解
*
* @return 是否
*/
private boolean hasOnTouchMethodBindings() {
for (ViewBinding bindings : viewBindings) {
if (bindings.getMethodBindings()
.containsKey(OnTouch.class.getAnnotation(ListenerClass.class))) {
return true;
}
}
return false;
}
开发者ID:CaMnter,项目名称:AndroidLife,代码行数:15,代码来源:BindingSet.java
示例9: addMethod
import butterknife.internal.ListenerClass; //导入依赖的package包/类
boolean addMethod(
Id id,
ListenerClass listener,
ListenerMethod method,
MethodViewBinding binding) {
ViewBinding.Builder viewBinding = getOrCreateViewBindings(id);
if (viewBinding.hasMethodBinding(listener, method) &&
!"void".equals(method.returnType())) {
return false;
}
viewBinding.addMethodBinding(listener, method, binding);
return true;
}
开发者ID:CaMnter,项目名称:AndroidLife,代码行数:14,代码来源:BindingSet.java
示例10: ViewBinding
import butterknife.internal.ListenerClass; //导入依赖的package包/类
ViewBinding(Id id, Map<ListenerClass, Map<ListenerMethod, Set<MethodViewBinding>>> methodBindings,
FieldViewBinding fieldBinding) {
this.id = id;
this.methodBindings = methodBindings;
this.fieldBinding = fieldBinding;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:ViewBinding.java
示例11: getMethodBindings
import butterknife.internal.ListenerClass; //导入依赖的package包/类
public Map<ListenerClass, Map<ListenerMethod, Set<MethodViewBinding>>> getMethodBindings() {
return methodBindings;
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:ViewBinding.java
示例12: hasMethodBinding
import butterknife.internal.ListenerClass; //导入依赖的package包/类
public boolean hasMethodBinding(ListenerClass listener, ListenerMethod method) {
Map<ListenerMethod, Set<MethodViewBinding>> methods = methodBindings.get(listener);
return methods != null && methods.containsKey(method);
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:ViewBinding.java
示例13: addFieldAndUnbindStatement
import butterknife.internal.ListenerClass; //导入依赖的package包/类
private void addFieldAndUnbindStatement(TypeSpec.Builder result, MethodSpec.Builder unbindMethod,
ViewBinding bindings) {
// Only add fields to the binding if there are method bindings.
Map<ListenerClass, Map<ListenerMethod, Set<MethodViewBinding>>> classMethodBindings =
bindings.getMethodBindings();
if (classMethodBindings.isEmpty()) {
return;
}
String fieldName = bindings.isBoundToRoot() ? "viewSource" : "view" + bindings.getId().value;
result.addField(VIEW, fieldName, PRIVATE);
// We only need to emit the null check if there are zero required bindings.
boolean needsNullChecked = bindings.getRequiredBindings().isEmpty();
if (needsNullChecked) {
unbindMethod.beginControlFlow("if ($N != null)", fieldName);
}
for (ListenerClass listenerClass : classMethodBindings.keySet()) {
// We need to keep a reference to the listener
// in case we need to unbind it via a remove method.
boolean requiresRemoval = !"".equals(listenerClass.remover());
String listenerField = "null";
if (requiresRemoval) {
TypeName listenerClassName = bestGuess(listenerClass.type());
listenerField = fieldName + ((ClassName) listenerClassName).simpleName();
result.addField(listenerClassName, listenerField, PRIVATE);
}
if (!VIEW_TYPE.equals(listenerClass.targetType())) {
unbindMethod.addStatement("(($T) $N).$N($N)", bestGuess(listenerClass.targetType()),
fieldName, removerOrSetter(listenerClass, requiresRemoval), listenerField);
} else {
unbindMethod.addStatement("$N.$N($N)", fieldName,
removerOrSetter(listenerClass, requiresRemoval), listenerField);
}
if (requiresRemoval) {
unbindMethod.addStatement("$N = null", listenerField);
}
}
unbindMethod.addStatement("$N = null", fieldName);
if (needsNullChecked) {
unbindMethod.endControlFlow();
}
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:49,代码来源:BindingSet.java
示例14: removerOrSetter
import butterknife.internal.ListenerClass; //导入依赖的package包/类
private String removerOrSetter(ListenerClass listenerClass, boolean requiresRemoval) {
return requiresRemoval
? listenerClass.remover()
: listenerClass.setter();
}
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:BindingSet.java
示例15: addFieldAndUnbindStatement
import butterknife.internal.ListenerClass; //导入依赖的package包/类
private void addFieldAndUnbindStatement(TypeSpec.Builder result, MethodSpec.Builder unbindMethod,
ViewBinding bindings) {
// Only add fields to the binding if there are method bindings.
Map<ListenerClass, Map<ListenerMethod, Set<MethodViewBinding>>> classMethodBindings =
bindings.getMethodBindings();
if (classMethodBindings.isEmpty()) {
return;
}
String fieldName = bindings.isBoundToRoot() ? "viewSource" : "view" + bindings.getId().value;
result.addField(VIEW, fieldName, PRIVATE);
// We only need to emit the null check if there are zero required bindings.
boolean needsNullChecked = bindings.getRequiredBindings().isEmpty();
if (needsNullChecked) {
unbindMethod.beginControlFlow("if ($N != null)", fieldName);
}
for (ListenerClass listenerClass : classMethodBindings.keySet()) {
// We need to keep a reference to the listener
// in case we need to unbind it via a remove method.
boolean requiresRemoval = !"".equals(listenerClass.remover());
String listenerField = "null";
if (requiresRemoval) {
TypeName listenerClassName = bestGuess(listenerClass.type());
listenerField = fieldName + ((ClassName) listenerClassName).simpleName();
result.addField(listenerClassName, listenerField, PRIVATE);
}
if (!VIEW_TYPE.equals(listenerClass.targetType())) {
unbindMethod.addStatement("(($T) $N).$N($N)", bestGuess(listenerClass.targetType()),
fieldName, removerOrSetter(listenerClass, requiresRemoval), listenerField);
} else {
unbindMethod.addStatement("$N.$N($N)", fieldName,
removerOrSetter(listenerClass, requiresRemoval), listenerField);
}
if (requiresRemoval) {
unbindMethod.addStatement("$N = null", listenerField);
}
}
unbindMethod.addStatement("$N = null", fieldName);
if (needsNullChecked) {
unbindMethod.endControlFlow();
}
}
开发者ID:qq542391099,项目名称:butterknife-parent,代码行数:49,代码来源:BindingSet.java
示例16: removerOrSetter
import butterknife.internal.ListenerClass; //导入依赖的package包/类
private String removerOrSetter(ListenerClass listenerClass, boolean requiresRemoval) {
return requiresRemoval
? listenerClass.remover()
: listenerClass.setter();
}
开发者ID:qq542391099,项目名称:butterknife-parent,代码行数:6,代码来源:BindingSet.java
示例17: addFieldAndUnbindStatement
import butterknife.internal.ListenerClass; //导入依赖的package包/类
private void addFieldAndUnbindStatement(TypeSpec.Builder result, MethodSpec.Builder unbindMethod,
ViewBindings bindings) {
// Only add fields to the binding if there are method bindings.
Map<ListenerClass, Map<ListenerMethod, Set<MethodViewBinding>>> classMethodBindings =
bindings.getMethodBindings();
if (classMethodBindings.isEmpty()) {
return;
}
String fieldName = bindings.isBoundToRoot() ? "viewSource" : "view" + bindings.getId().value;
result.addField(VIEW, fieldName, PRIVATE);
// We only need to emit the null check if there are zero required bindings.
boolean needsNullChecked = bindings.getRequiredBindings().isEmpty();
if (needsNullChecked) {
unbindMethod.beginControlFlow("if ($N != null)", fieldName);
}
for (ListenerClass listenerClass : classMethodBindings.keySet()) {
// We need to keep a reference to the listener
// in case we need to unbind it via a remove method.
boolean requiresRemoval = !"".equals(listenerClass.remover());
String listenerField = "null";
if (requiresRemoval) {
TypeName listenerClassName = bestGuess(listenerClass.type());
listenerField = fieldName + ((ClassName) listenerClassName).simpleName();
result.addField(listenerClassName, listenerField, PRIVATE);
}
if (!VIEW_TYPE.equals(listenerClass.targetType())) {
unbindMethod.addStatement("(($T) $N).$N($N)", bestGuess(listenerClass.targetType()),
fieldName, removerOrSetter(listenerClass, requiresRemoval), listenerField);
} else {
unbindMethod.addStatement("$N.$N($N)", fieldName,
removerOrSetter(listenerClass, requiresRemoval), listenerField);
}
if (requiresRemoval) {
unbindMethod.addStatement("$N = null", listenerField);
}
}
unbindMethod.addStatement("$N = null", fieldName);
if (needsNullChecked) {
unbindMethod.endControlFlow();
}
}
开发者ID:hoangkien0705,项目名称:Android-ButterKinfe,代码行数:49,代码来源:BindingClass.java
示例18: ViewBinding
import butterknife.internal.ListenerClass; //导入依赖的package包/类
ViewBinding(Id id, Map<ListenerClass, Map<ListenerMethod, Set<MethodViewBinding>>> methodBindings,
FieldViewBinding fieldBinding) {
this.id = id;
this.methodBindings = methodBindings;
this.fieldBinding = fieldBinding;
}
开发者ID:CaMnter,项目名称:AndroidLife,代码行数:7,代码来源:ViewBinding.java
示例19: getMethodBindings
import butterknife.internal.ListenerClass; //导入依赖的package包/类
public Map<ListenerClass, Map<ListenerMethod, Set<MethodViewBinding>>> getMethodBindings() {
return methodBindings;
}
开发者ID:CaMnter,项目名称:AndroidLife,代码行数:4,代码来源:ViewBinding.java
示例20: hasMethodBinding
import butterknife.internal.ListenerClass; //导入依赖的package包/类
public boolean hasMethodBinding(ListenerClass listener, ListenerMethod method) {
Map<ListenerMethod, Set<MethodViewBinding>> methods = methodBindings.get(listener);
return methods != null && methods.containsKey(method);
}
开发者ID:CaMnter,项目名称:AndroidLife,代码行数:5,代码来源:ViewBinding.java
注:本文中的butterknife.internal.ListenerClass类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论