aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui/ConversationFragment.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-21 19:51:03 +0200
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-21 19:51:03 +0200
commit77da0c6b5d3d6925c8018c1eb57fb26d102a937d (patch)
treeef392c79f3ad3df6de361ded98ab9d377965a371 /src/eu/siacs/conversations/ui/ConversationFragment.java
parentfc6a16c31b56a1249fb28b4f90018bca4207dab7 (diff)
allow images to be opened with gallary app
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/ui/ConversationFragment.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java
index 6e1db2bf..0604f1db 100644
--- a/src/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/eu/siacs/conversations/ui/ConversationFragment.java
@@ -31,6 +31,7 @@ import android.content.SharedPreferences;
import android.content.IntentSender.SendIntentException;
import android.graphics.Bitmap;
import android.graphics.Typeface;
+import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
@@ -197,7 +198,7 @@ public class ConversationFragment extends Fragment {
@Override
public View getView(int position, View view, ViewGroup parent) {
- Message item = getItem(position);
+ final Message item = getItem(position);
int type = getItemViewType(position);
ViewHolder viewHolder;
if (view == null) {
@@ -283,6 +284,17 @@ public class ConversationFragment extends Fragment {
viewHolder.image.setImageBitmap(thumbnail);
viewHolder.messageBody.setVisibility(View.GONE);
viewHolder.image.setVisibility(View.VISIBLE);
+ viewHolder.image.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ Uri uri = Uri.parse("content://eu.siacs.conversations.images/"+item.getConversationUuid()+"/"+item.getUuid());
+ Log.d("xmppService","staring intent with uri:"+uri.toString());
+ Intent intent = new Intent(Intent.ACTION_VIEW);
+ intent.setDataAndType(uri, "image/*");
+ startActivity(intent);
+ }
+ });
} catch (FileNotFoundException e) {
viewHolder.image.setVisibility(View.GONE);
viewHolder.messageBody.setText("error loading image file");