Search in sources :

Example 6 with ChatColors

use of org.thoughtcrime.securesms.conversation.colors.ChatColors in project Signal-Android by signalapp.

the class CallParticipantView method setPipAvatar.

private void setPipAvatar(@NonNull Recipient recipient) {
    ContactPhoto contactPhoto = recipient.isSelf() ? new ProfileContactPhoto(Recipient.self(), Recipient.self().getProfileAvatar()) : recipient.getContactPhoto();
    FallbackContactPhoto fallbackPhoto = recipient.getFallbackContactPhoto(FALLBACK_PHOTO_PROVIDER);
    GlideApp.with(this).load(contactPhoto).fallback(fallbackPhoto.asCallCard(getContext())).error(fallbackPhoto.asCallCard(getContext())).diskCacheStrategy(DiskCacheStrategy.ALL).into(pipAvatar);
    pipAvatar.setScaleType(contactPhoto == null ? ImageView.ScaleType.CENTER_INSIDE : ImageView.ScaleType.CENTER_CROP);
    ChatColors chatColors = recipient.getChatColors();
    pipAvatar.setBackground(chatColors.getChatBubbleMask());
}
Also used : ProfileContactPhoto(org.thoughtcrime.securesms.contacts.avatars.ProfileContactPhoto) FallbackContactPhoto(org.thoughtcrime.securesms.contacts.avatars.FallbackContactPhoto) ChatColors(org.thoughtcrime.securesms.conversation.colors.ChatColors) ContactPhoto(org.thoughtcrime.securesms.contacts.avatars.ContactPhoto) ProfileContactPhoto(org.thoughtcrime.securesms.contacts.avatars.ProfileContactPhoto) FallbackContactPhoto(org.thoughtcrime.securesms.contacts.avatars.FallbackContactPhoto) ResourceContactPhoto(org.thoughtcrime.securesms.contacts.avatars.ResourceContactPhoto)

Aggregations

ChatColors (org.thoughtcrime.securesms.conversation.colors.ChatColors)6 Drawable (android.graphics.drawable.Drawable)4 ProfileContactPhoto (org.thoughtcrime.securesms.contacts.avatars.ProfileContactPhoto)4 Context (android.content.Context)2 Intent (android.content.Intent)2 Bundle (android.os.Bundle)2 View (android.view.View)2 TextView (android.widget.TextView)2 NonNull (androidx.annotation.NonNull)2 Toolbar (androidx.appcompat.widget.Toolbar)2 ViewPager2 (androidx.viewpager2.widget.ViewPager2)2 Stream (com.annimon.stream.Stream)2 MultiTransformation (com.bumptech.glide.load.MultiTransformation)2 Transformation (com.bumptech.glide.load.Transformation)2 CircleCrop (com.bumptech.glide.load.resource.bitmap.CircleCrop)2 ArrayList (java.util.ArrayList)2 Collections (java.util.Collections)2 Objects (java.util.Objects)2 PassphraseRequiredActivity (org.thoughtcrime.securesms.PassphraseRequiredActivity)2 R (org.thoughtcrime.securesms.R)2