upgrade SparkButton to 3.0.0 (#1594)
This commit is contained in:
parent
a8f3070889
commit
60b9a9c40b
|
@ -151,7 +151,7 @@ dependencies {
|
||||||
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
|
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
|
||||||
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
|
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
|
||||||
|
|
||||||
implementation "com.github.connyduck:sparkbutton:2.0.1"
|
implementation "com.github.connyduck:sparkbutton:3.0.0"
|
||||||
|
|
||||||
implementation "com.github.chrisbanes:PhotoView:2.3.0"
|
implementation "com.github.chrisbanes:PhotoView:2.3.0"
|
||||||
|
|
||||||
|
|
|
@ -565,60 +565,25 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (reblogButton != null) {
|
if (reblogButton != null) {
|
||||||
reblogButton.setEventListener(new SparkEventListener() {
|
reblogButton.setEventListener((button, buttonState) -> {
|
||||||
@Override
|
int position = getAdapterPosition();
|
||||||
public void onEvent(ImageView button, boolean buttonState) {
|
if (position != RecyclerView.NO_POSITION) {
|
||||||
int position = getAdapterPosition();
|
listener.onReblog(buttonState, position);
|
||||||
if (position != RecyclerView.NO_POSITION) {
|
|
||||||
listener.onReblog(buttonState, position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEventAnimationEnd(ImageView button, boolean buttonState) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEventAnimationStart(ImageView button, boolean buttonState) {
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
favouriteButton.setEventListener(new SparkEventListener() {
|
favouriteButton.setEventListener((button, buttonState) -> {
|
||||||
@Override
|
int position = getAdapterPosition();
|
||||||
public void onEvent(ImageView button, boolean buttonState) {
|
if (position != RecyclerView.NO_POSITION) {
|
||||||
int position = getAdapterPosition();
|
listener.onFavourite(buttonState, position);
|
||||||
if (position != RecyclerView.NO_POSITION) {
|
|
||||||
listener.onFavourite(buttonState, position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEventAnimationEnd(ImageView button, boolean buttonState) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEventAnimationStart(ImageView button, boolean buttonState) {
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
bookmarkButton.setEventListener(new SparkEventListener() {
|
bookmarkButton.setEventListener((button, buttonState) -> {
|
||||||
@Override
|
int position = getAdapterPosition();
|
||||||
public void onEvent(ImageView button, boolean buttonState) {
|
if (position != RecyclerView.NO_POSITION) {
|
||||||
int position = getAdapterPosition();
|
listener.onBookmark(buttonState, position);
|
||||||
if (position != RecyclerView.NO_POSITION) {
|
|
||||||
listener.onBookmark(buttonState, position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEventAnimationEnd(ImageView button, boolean buttonState) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEventAnimationStart(ImageView button, boolean buttonState) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue