aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-02-09 23:57:53 +0100
committerChristian Schneppe <christian@pix-art.de>2019-02-09 23:57:53 +0100
commit4dea23f23f3e05c0775653a51903fce273e64c97 (patch)
treeef3bffc1bc40b8a0629c3b8b9d27bc81cbdd1d9d /src/main/java/de/pixart
parent441b1c5d67c84a39b6349d7ad1c0b8319d5712a7 (diff)
change isDatasaverDisabled integration for web preview
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java3
-rw-r--r--src/main/java/de/pixart/messenger/ui/widget/RichLinkView.java12
2 files changed, 6 insertions, 9 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
index 3215c9ef0..8a2ca0b4d 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
@@ -685,7 +685,8 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
viewHolder.messageBody.setTextIsSelectable(true);
viewHolder.messageBody.setMovementMethod(ClickableMovementMethod.getInstance());
listSelectionManager.onUpdate(viewHolder.messageBody, message);
- if (showLinksInside) {
+ boolean dataSaverDisabled = activity.xmppConnectionService.isDataSaverDisabled();
+ if (showLinksInside && dataSaverDisabled) {
viewHolder.richlinkview.setVisibility(View.VISIBLE);
viewHolder.richlinkview.setLink(body.toString(), new ViewListener() {
diff --git a/src/main/java/de/pixart/messenger/ui/widget/RichLinkView.java b/src/main/java/de/pixart/messenger/ui/widget/RichLinkView.java
index 7a7baa5c7..b82095c32 100644
--- a/src/main/java/de/pixart/messenger/ui/widget/RichLinkView.java
+++ b/src/main/java/de/pixart/messenger/ui/widget/RichLinkView.java
@@ -97,14 +97,10 @@ public class RichLinkView extends RelativeLayout {
if (meta.getImageurl().equals("") || meta.getImageurl().isEmpty()) {
imageView.setVisibility(GONE);
} else {
- if (mXmppConnectionService != null && mXmppConnectionService.isDataSaverDisabled()) {
- imageView.setVisibility(VISIBLE);
- Picasso.get()
- .load(meta.getImageurl())
- .into(imageView);
- } else {
- imageView.setVisibility(GONE);
- }
+ imageView.setVisibility(VISIBLE);
+ Picasso.get()
+ .load(meta.getImageurl())
+ .into(imageView);
}
if (meta.getTitle().isEmpty() || meta.getTitle().equals("")) {
textViewTitle.setVisibility(GONE);