diff options
author | steckbrief <steckbrief@chefmail.de> | 2015-11-06 21:41:29 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2015-11-06 21:41:29 +0100 |
commit | 6bc277152a8e1bcf5347d3e1d60c93dfc904ca23 (patch) | |
tree | f8ff8a13090f774243d2744eaba0185877245a14 /src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java | |
parent | 0575767152abc391fd1d0241d9cbae154236df70 (diff) | |
parent | 8838a5094812e0540ccfef3334e49e1a5c1a564b (diff) |
Merge remote-tracking branch 'remotes/origin/trz/rename' into trz/rebase
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java index d4a2e7f7..86d7da65 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -12,7 +12,6 @@ import android.text.Spanned; import android.text.style.ForegroundColorSpan; import android.text.style.RelativeSizeSpan; import android.text.style.StyleSpan; -import android.util.DisplayMetrics; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnLongClickListener; @@ -27,6 +26,7 @@ import android.widget.Toast; import java.util.List; import de.thedevstack.conversationsplus.ConversationsPlusPreferences; + import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Contact; @@ -35,9 +35,11 @@ import eu.siacs.conversations.entities.Transferable; import eu.siacs.conversations.entities.DownloadableFile; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.entities.Message.FileParams; +import eu.siacs.conversations.persistance.FileBackend; import eu.siacs.conversations.ui.ConversationActivity; import eu.siacs.conversations.utils.GeoHelper; import eu.siacs.conversations.utils.UIHelper; + import github.ankushsachdeva.emojicon.EmojiconTextView; public class MessageAdapter extends ArrayAdapter<Message> { @@ -48,8 +50,6 @@ public class MessageAdapter extends ArrayAdapter<Message> { private ConversationActivity activity; - private DisplayMetrics metrics; - private OnContactPictureClicked mOnContactPictureClickedListener; private OnContactPictureLongClicked mOnContactPictureLongClickedListener; @@ -65,7 +65,6 @@ public class MessageAdapter extends ArrayAdapter<Message> { public MessageAdapter(ConversationActivity activity, List<Message> messages) { super(activity, 0, messages); this.activity = activity; - metrics = getContext().getResources().getDisplayMetrics(); } public void setOnContactPictureClicked(OnContactPictureClicked listener) { @@ -364,8 +363,7 @@ public class MessageAdapter extends ArrayAdapter<Message> { @Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_VIEW); - intent.setDataAndType(activity.xmppConnectionService - .getFileBackend().getJingleFileUri(message), "image/*"); + intent.setDataAndType(FileBackend.getJingleFileUri(message), "image/*"); getContext().startActivity(intent); } }); @@ -552,7 +550,7 @@ public class MessageAdapter extends ArrayAdapter<Message> { } public void openDownloadable(Message message) { - DownloadableFile file = activity.xmppConnectionService.getFileBackend().getFile(message); + DownloadableFile file = FileBackend.getFile(message); if (!file.exists()) { Toast.makeText(activity,R.string.file_deleted,Toast.LENGTH_SHORT).show(); return; |