session-android/src/org/thoughtcrime/securesms/loki/JazzIdenticonContactPhoto.kt
2019-11-27 13:17:31 +11:00

22 lines
No EOL
891 B
Kotlin

package org.thoughtcrime.securesms.loki
import android.content.Context
import android.graphics.drawable.Drawable
import android.support.v7.content.res.AppCompatResources
import network.loki.messenger.R
import org.thoughtcrime.securesms.contacts.avatars.FallbackContactPhoto
class JazzIdenticonContactPhoto(val hexEncodedPublicKey: String) : FallbackContactPhoto {
override fun asDrawable(context: Context, color: Int): Drawable {
return asDrawable(context, color, false)
}
override fun asDrawable(context: Context, color: Int, inverted: Boolean): Drawable {
val targetSize = context.resources.getDimensionPixelSize(R.dimen.contact_photo_target_size)
return JazzIdenticonDrawable(targetSize, targetSize, hexEncodedPublicKey)
}
override fun asCallCard(context: Context): Drawable? {
return AppCompatResources.getDrawable(context, R.drawable.ic_person_large)
}
}