mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-22 04:55:29 +03:00
Add clickable resources
This commit is contained in:
parent
3e6b5f8382
commit
1800209999
2 changed files with 17 additions and 0 deletions
|
@ -21,8 +21,11 @@
|
|||
package com.nextcloud.talk.adapters.messages;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
|
@ -145,6 +148,12 @@ public class MagicIncomingTextMessageViewHolder
|
|||
|
||||
messageString = DisplayUtils.searchAndColor(messageText.getText().toString(),
|
||||
messageString, "@" + individualHashMap.get("name"), color);
|
||||
} else if (individualHashMap.get("type").equals("file")) {
|
||||
itemView.setOnClickListener(v -> {
|
||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(individualHashMap.get("link")));
|
||||
context.startActivity(browserIntent);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,8 +21,10 @@
|
|||
package com.nextcloud.talk.adapters.messages;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
|
@ -95,6 +97,12 @@ public class MagicOutcomingTextMessageViewHolder extends MessageHolders.Outcomin
|
|||
.getSharedApplication().getResources().getColor(R.color.nc_outcoming_text_default));
|
||||
}
|
||||
|
||||
} else if (individualHashMap.get("type").equals("file")) {
|
||||
itemView.setOnClickListener(v -> {
|
||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(individualHashMap.get("link")));
|
||||
context.startActivity(browserIntent);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue