Cache html, fixes

This commit is contained in:
M66B
2019-02-03 15:42:51 +00:00
parent 19fd778c83
commit e0f4294e01
2 changed files with 92 additions and 66 deletions

View File

@@ -143,6 +143,7 @@ public class FragmentMessages extends FragmentBase {
private boolean autoExpanded = true;
private Map<String, List<Long>> values = new HashMap<>();
private LongSparseArray<Spanned> bodies = new LongSparseArray<>();
private LongSparseArray<String> html = new LongSparseArray<>();
private LongSparseArray<TupleAccountSwipes> accountSwipes = new LongSparseArray<>();
private BoundaryCallbackMessages boundaryCallback = null;
@@ -555,11 +556,11 @@ public class FragmentMessages extends FragmentBase {
}
@Override
public void setBody(long id, Spanned body) {
if (body == null)
public void setBody(long id, Spanned value) {
if (value == null)
bodies.remove(id);
else
bodies.put(id, body);
bodies.put(id, value);
}
@Override
@@ -567,6 +568,19 @@ public class FragmentMessages extends FragmentBase {
return bodies.get(id);
}
@Override
public void setHtml(long id, String value) {
if (value == null)
html.remove(id);
else
html.put(id, value);
}
@Override
public String getHtml(long id) {
return html.get(id);
}
@Override
public void scrollTo(final int pos, final int dy) {
new Handler().post(new Runnable() {