mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-03 13:44:40 +00:00
Fixed scaling of inline images
This commit is contained in:
parent
ae803e4719
commit
0bfd8bf015
1 changed files with 6 additions and 1 deletions
|
@ -568,6 +568,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
float scale = (textSize == 0 ? 1.0f : size / (textSize * message_zoom / 100f));
|
||||
boolean show_images = properties.getValue("images", message.id);
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean inline = prefs.getBoolean("inline_images", false);
|
||||
|
||||
if (scale > 10)
|
||||
return true;
|
||||
|
||||
|
@ -578,11 +581,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
// Image size
|
||||
Spanned spanned = (Spanned) tvBody.getText();
|
||||
for (ImageSpan img : spanned.getSpans(0, spanned.length(), ImageSpan.class)) {
|
||||
String source = img.getSource();
|
||||
boolean embedded = (source != null && source.startsWith("cid:"));
|
||||
Drawable d = img.getDrawable();
|
||||
int w = 0;
|
||||
int h = 0;
|
||||
if (img instanceof ImageSpanEx) {
|
||||
if (show_images) {
|
||||
if (show_images || (embedded && inline)) {
|
||||
w = ((ImageSpanEx) img).getWidth();
|
||||
h = ((ImageSpanEx) img).getHeight();
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue