mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
ShapeImageView can handle rounding images by itself, no need for Coil's CircleCropTransform
This commit is contained in:
parent
4ce5d989c5
commit
8794146df7
2 changed files with 3 additions and 8 deletions
|
|
@ -56,7 +56,6 @@ import coil.dispose
|
|||
import coil.imageLoader
|
||||
import coil.load
|
||||
import coil.request.ImageRequest
|
||||
import coil.transform.CircleCropTransformation
|
||||
import com.google.android.material.imageview.ShapeableImageView
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.coroutineScope
|
||||
|
|
@ -215,9 +214,7 @@ fun AppCompatTextView.setColor(@ColorRes color: Int) {
|
|||
fun ShapeableImageView.loadCircleFileWithCoil(file: String?) {
|
||||
Log.i("[Data Binding Utils] Loading file [$file] with coil")
|
||||
if (file != null) {
|
||||
load(file) {
|
||||
transformations(CircleCropTransformation())
|
||||
}
|
||||
load(file)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -314,7 +311,6 @@ private suspend fun loadContactPictureWithCoil(
|
|||
if (count == 1) {
|
||||
val image = images.firstOrNull()
|
||||
imageView.load(image) {
|
||||
transformations(CircleCropTransformation())
|
||||
error(
|
||||
coroutineScope {
|
||||
withContext(Dispatchers.IO) {
|
||||
|
|
@ -397,9 +393,7 @@ private suspend fun loadContactPictureWithCoil(
|
|||
)
|
||||
}
|
||||
|
||||
imageView.load(bitmap) {
|
||||
transformations(CircleCropTransformation())
|
||||
}
|
||||
imageView.load(bitmap)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@
|
|||
<item name="android:padding">1dp</item> <!-- half the size of the border @dimen/avatar_trust_border_width -->
|
||||
<item name="android:background">@drawable/shape_circle_light_blue_background</item>
|
||||
<item name="android:adjustViewBounds">true</item>
|
||||
<item name="android:scaleType">centerCrop</item>
|
||||
<item name="shapeAppearanceOverlay">@style/ShapeAppearance.CircularBorder</item>
|
||||
<item name="strokeColor">@color/transparent_color</item>
|
||||
<item name="strokeWidth">0dp</item>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue