androidx
Zhanty 5 years ago
parent 1210fee50b
commit caf510c998
  1. 2
      config/repository.gradle
  2. 9
      lib_base/src/main/java/com/android/base/interfaces/OnItemClickListener.java
  3. 7
      lib_base/src/main/java/com/android/base/interfaces/OnItemLongClickListener.java

@ -260,7 +260,7 @@ static Repository innerNewRepository() {
photoView : 'com.github.chrisbanes:PhotoView:2.1.3', photoView : 'com.github.chrisbanes:PhotoView:2.1.3',
//https://github.com/davemorrissey/subsampling-scale-image-view //https://github.com/davemorrissey/subsampling-scale-image-view
subsamplingScaleImageView: 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0', subsamplingScaleImageView: 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0',
//https://github.com/vinc3m1/RoundedImageView //https://github.com/hdodenhof/CircleImageView
circleImageView : 'de.hdodenhof:circleimageview:2.1.0', circleImageView : 'de.hdodenhof:circleimageview:2.1.0',
//https://github.com/vinc3m1/RoundedImageView //https://github.com/vinc3m1/RoundedImageView
roundedImageView : 'com.makeramen:roundedimageview:2.3.0', roundedImageView : 'com.makeramen:roundedimageview:2.3.0',

@ -1,9 +1,8 @@
package com.android.base.interfaces; package com.android.base.interfaces;
import android.support.annotation.NonNull;
import android.view.View; import android.view.View;
import timber.log.Timber;
public abstract class OnItemClickListener<T> implements View.OnClickListener { public abstract class OnItemClickListener<T> implements View.OnClickListener {
@ -12,13 +11,11 @@ public abstract class OnItemClickListener<T> implements View.OnClickListener {
public final void onClick(View v) { public final void onClick(View v) {
Object tag = v.getTag(); Object tag = v.getTag();
if (tag == null) { if (tag == null) {
Timber.w("OnItemClickListener tag is null , view = " + v); throw new NullPointerException("OnItemClickListener --> no tag found");
return;
} }
onClick(v, (T) tag); onClick(v, (T) tag);
} }
public abstract void onClick(View view, T t); public abstract void onClick(@NonNull View view, @NonNull T t);
} }

@ -2,9 +2,6 @@ package com.android.base.interfaces;
import android.view.View; import android.view.View;
import timber.log.Timber;
public abstract class OnItemLongClickListener<T> implements View.OnLongClickListener { public abstract class OnItemLongClickListener<T> implements View.OnLongClickListener {
@ -13,13 +10,11 @@ public abstract class OnItemLongClickListener<T> implements View.OnLongClickList
public final boolean onLongClick(View v) { public final boolean onLongClick(View v) {
Object tag = v.getTag(); Object tag = v.getTag();
if (tag == null) { if (tag == null) {
Timber.w("OnItemLongClickListener tag is null , view = " + v); throw new NullPointerException("OnItemLongClickListener --> no tag found");
return false;
} }
return onClick(v, (T) tag); return onClick(v, (T) tag);
} }
public abstract boolean onClick(View view, T t); public abstract boolean onClick(View view, T t);
} }
Loading…
Cancel
Save