1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-21 21:57:19 +00:00

Added contact info debug

This commit is contained in:
M66B 2021-07-17 18:32:23 +02:00
parent f67d7ffc37
commit a66c605e33

View file

@ -1526,12 +1526,17 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (main == null || !main.hasPhoto()) {
ibAvatar.setImageDrawable(null);
ibAvatar.setTag(null);
ibAvatar.setEnabled(false);
} else {
ibAvatar.setImageBitmap(main.getPhotoBitmap());
Uri lookupUri = main.getLookupUri();
ibAvatar.setTag(lookupUri);
ibAvatar.setEnabled(lookupUri != null);
if (BuildConfig.DEBUG)
ibAvatar.setContentDescription(main.getEmailAddress() + "=" + main.getType());
ibAvatar.setEnabled(lookupUri != null || BuildConfig.DEBUG);
}
ibAvatar.setVisibility(main == null || !main.hasPhoto() ? View.GONE : View.VISIBLE);
@ -3444,7 +3449,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private void onViewContact(TupleMessageEx message) {
Uri lookupUri = (Uri) ibAvatar.getTag();
if (lookupUri != null) {
if (lookupUri == null) {
if (BuildConfig.DEBUG) {
CharSequence type = ibAvatar.getContentDescription();
ToastEx.makeText(context, type, Toast.LENGTH_LONG).show();
}
} else {
Intent intent = new Intent(Intent.ACTION_VIEW, lookupUri);
try {
context.startActivity(intent);