Scale images when scaling text

This commit is contained in:
M66B
2020-09-05 21:06:39 +02:00
parent d9473c2e7b
commit 4664eadb72
2 changed files with 56 additions and 4 deletions

View File

@@ -309,6 +309,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
final private Map<String, String> kv = new HashMap<>();
final private Map<String, List<Long>> values = new HashMap<>();
final private LongSparseArray<Float> scales = new LongSparseArray<>();
final private LongSparseArray<Float> sizes = new LongSparseArray<>();
final private LongSparseArray<Integer> heights = new LongSparseArray<>();
final private LongSparseArray<Pair<Integer, Integer>> positions = new LongSparseArray<>();
@@ -1645,6 +1646,19 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
handleExpand(message.id);
}
@Override
public void setScale(long id, Float size) {
if (size == null)
scales.remove(id);
else
scales.put(id, size);
}
@Override
public float getScale(long id, float defaultSize) {
return scales.get(id, defaultSize);
}
@Override
public void setSize(long id, Float size) {
if (size == null)
@@ -3513,6 +3527,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
Log.i("Hidden id=" + id);
for (String key : values.keySet())
values.get(key).remove(id);
scales.remove(id);
sizes.remove(id);
heights.remove(id);
positions.remove(id);