Added contact info debug

pull/200/head
M66B 3 years ago
parent f67d7ffc37
commit a66c605e33

@ -1526,12 +1526,17 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (main == null || !main.hasPhoto()) { if (main == null || !main.hasPhoto()) {
ibAvatar.setImageDrawable(null); ibAvatar.setImageDrawable(null);
ibAvatar.setTag(null); ibAvatar.setTag(null);
ibAvatar.setEnabled(false);
} else { } else {
ibAvatar.setImageBitmap(main.getPhotoBitmap()); ibAvatar.setImageBitmap(main.getPhotoBitmap());
Uri lookupUri = main.getLookupUri(); Uri lookupUri = main.getLookupUri();
ibAvatar.setTag(lookupUri); 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); 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) { private void onViewContact(TupleMessageEx message) {
Uri lookupUri = (Uri) ibAvatar.getTag(); 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); Intent intent = new Intent(Intent.ACTION_VIEW, lookupUri);
try { try {
context.startActivity(intent); context.startActivity(intent);

Loading…
Cancel
Save