mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-21 12:39:58 +01:00
- Updated api with getContextForChatMessages - Added ContextChatCompose for viewing the context of messages - Added ComposeChatAdapter, a reimplementation of chat adapter - Helper functions - Added new date header - Added a better Shimmer Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
39 lines
1.2 KiB
Kotlin
39 lines
1.2 KiB
Kotlin
/*
|
|
* Nextcloud Talk - Android Client
|
|
*
|
|
* SPDX-FileCopyrightText: 2024 Sowjanya Kota <sowjanya.kch@email.com>
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
|
|
package com.nextcloud.talk.contacts
|
|
|
|
import android.content.Context
|
|
import androidx.compose.runtime.Composable
|
|
import coil.request.ImageRequest
|
|
import coil.size.Size
|
|
import coil.transform.CircleCropTransformation
|
|
import coil.transform.RoundedCornersTransformation
|
|
|
|
@Composable
|
|
fun loadImage(imageUri: String?, context: Context, errorPlaceholderImage: Int): ImageRequest {
|
|
val imageRequest = ImageRequest.Builder(context)
|
|
.data(imageUri)
|
|
.transformations(CircleCropTransformation())
|
|
.error(errorPlaceholderImage)
|
|
.placeholder(errorPlaceholderImage)
|
|
.build()
|
|
return imageRequest
|
|
}
|
|
|
|
@Composable
|
|
fun load(imageUri: String?, context: Context, errorPlaceholderImage: Int): ImageRequest {
|
|
val imageRequest = ImageRequest.Builder(context)
|
|
.data(imageUri)
|
|
.size(Size.ORIGINAL)
|
|
.transformations(RoundedCornersTransformation())
|
|
.error(errorPlaceholderImage)
|
|
.placeholder(errorPlaceholderImage)
|
|
.build()
|
|
return imageRequest
|
|
}
|