androidx
Zhanty 5 years ago
parent 1210fee50b
commit caf510c998
  1. 2
      config/repository.gradle
  2. 11
      lib_base/src/main/java/com/android/base/interfaces/OnItemClickListener.java
  3. 9
      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',
//https://github.com/davemorrissey/subsampling-scale-image-view
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',
//https://github.com/vinc3m1/RoundedImageView
roundedImageView : 'com.makeramen:roundedimageview:2.3.0',

@ -1,9 +1,8 @@
package com.android.base.interfaces;
import android.support.annotation.NonNull;
import android.view.View;
import timber.log.Timber;
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) {
Object tag = v.getTag();
if (tag == null) {
Timber.w("OnItemClickListener tag is null , view = " + v);
return;
throw new NullPointerException("OnItemClickListener --> no tag found");
}
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 timber.log.Timber;
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) {
Object tag = v.getTag();
if (tag == null) {
Timber.w("OnItemLongClickListener tag is null , view = " + v);
return false;
throw new NullPointerException("OnItemLongClickListener --> no tag found");
}
return onClick(v, (T) tag);
}
public abstract boolean onClick(View view, T t);
}
}
Loading…
Cancel
Save