mirror of https://github.com/M66B/FairEmail.git
Simplification
This commit is contained in:
parent
13c16bb7ac
commit
a7266739c2
|
@ -1762,8 +1762,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
public Drawable getDrawable(String source) {
|
public Drawable getDrawable(String source) {
|
||||||
Drawable image = HtmlHelper.decodeImage(source, message.id, show_images, tvBody);
|
Drawable image = HtmlHelper.decodeImage(source, message.id, show_images, tvBody);
|
||||||
|
|
||||||
float width = context.getResources().getDisplayMetrics().widthPixels -
|
float width = tvBody.getWidth();
|
||||||
Helper.dp2pixels(context, 12); // margins
|
|
||||||
if (image.getIntrinsicWidth() > width) {
|
if (image.getIntrinsicWidth() > width) {
|
||||||
float scale = width / image.getIntrinsicWidth();
|
float scale = width / image.getIntrinsicWidth();
|
||||||
image.setBounds(0, 0,
|
image.setBounds(0, 0,
|
||||||
|
|
|
@ -2762,8 +2762,7 @@ public class FragmentCompose extends FragmentBase {
|
||||||
public Drawable getDrawable(String source) {
|
public Drawable getDrawable(String source) {
|
||||||
Drawable image = HtmlHelper.decodeImage(source, id, show_images, tvReference);
|
Drawable image = HtmlHelper.decodeImage(source, id, show_images, tvReference);
|
||||||
|
|
||||||
float width = context.getResources().getDisplayMetrics().widthPixels -
|
float width = tvReference.getWidth();
|
||||||
Helper.dp2pixels(context, 12); // margins;
|
|
||||||
if (image.getIntrinsicWidth() > width) {
|
if (image.getIntrinsicWidth() > width) {
|
||||||
float scale = width / image.getIntrinsicWidth();
|
float scale = width / image.getIntrinsicWidth();
|
||||||
image.setBounds(0, 0,
|
image.setBounds(0, 0,
|
||||||
|
|
Loading…
Reference in New Issue