Simplification/fix

pull/177/head
M66B 5 years ago
parent 5fdc673292
commit 8ea6a184b2

@ -3008,7 +3008,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
boolean expanded = !properties.getValue("expanded", message.id); boolean expanded = !properties.getValue("expanded", message.id);
properties.setExpanded(message, expanded); properties.setExpanded(message, expanded);
bindTo(message, getAdapterPosition()); bindTo(message, getAdapterPosition());
properties.scrollTo(getAdapterPosition()); properties.scrollTo(getAdapterPosition(), 0);
} }
} }
@ -4722,7 +4722,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
public void onCurrentListChanged(@Nullable PagedList<TupleMessageEx> previousList, @Nullable PagedList<TupleMessageEx> currentList) { public void onCurrentListChanged(@Nullable PagedList<TupleMessageEx> previousList, @Nullable PagedList<TupleMessageEx> currentList) {
if (gotoTop) { if (gotoTop) {
gotoTop = false; gotoTop = false;
properties.scrollTo(0); properties.scrollTo(0, 0);
} }
} }
}); });
@ -4761,7 +4761,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
} }
void gotoTop() { void gotoTop() {
properties.scrollTo(0); properties.scrollTo(0, 0);
this.gotoTop = true; this.gotoTop = true;
} }
@ -4978,8 +4978,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
List<EntityAttachment> getAttachments(long id); List<EntityAttachment> getAttachments(long id);
void scrollTo(int pos);
void scrollTo(int pos, int y); void scrollTo(int pos, int y);
void move(long id, String type); void move(long id, String type);

@ -1487,16 +1487,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
return attachments.get(id); return attachments.get(id);
} }
@Override
public void scrollTo(final int pos) {
new Handler().post(new Runnable() {
@Override
public void run() {
rvMessage.scrollToPosition(pos);
}
});
}
public void scrollTo(final int pos, final int y) { public void scrollTo(final int pos, final int y) {
new Handler().post(new Runnable() { new Handler().post(new Runnable() {
@Override @Override

Loading…
Cancel
Save