mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Merge pull request #4002 from vector-im/feature/bma/fix_check_result
Fix annoying issue detected by lint (CheckResult)
This commit is contained in:
commit
60004f02c3
@ -47,6 +47,7 @@
|
|||||||
<issue id="Recycle" severity="error" />
|
<issue id="Recycle" severity="error" />
|
||||||
<issue id="KotlinPropertyAccess" severity="error" />
|
<issue id="KotlinPropertyAccess" severity="error" />
|
||||||
<issue id="DefaultLocale" severity="error" />
|
<issue id="DefaultLocale" severity="error" />
|
||||||
|
<issue id="CheckResult" severity="error" />
|
||||||
|
|
||||||
<issue id="InvalidPackage">
|
<issue id="InvalidPackage">
|
||||||
<!-- Ignore error from HtmlCompressor lib -->
|
<!-- Ignore error from HtmlCompressor lib -->
|
||||||
|
@ -138,13 +138,13 @@ class AvatarRenderer @Inject constructor(private val activeSessionHolder: Active
|
|||||||
target: Target<Drawable>) {
|
target: Target<Drawable>) {
|
||||||
val placeholder = getPlaceholderDrawable(matrixItem)
|
val placeholder = getPlaceholderDrawable(matrixItem)
|
||||||
glideRequests.loadResolvedUrl(matrixItem.avatarUrl)
|
glideRequests.loadResolvedUrl(matrixItem.avatarUrl)
|
||||||
.apply {
|
.let {
|
||||||
when (matrixItem) {
|
when (matrixItem) {
|
||||||
is MatrixItem.SpaceItem -> {
|
is MatrixItem.SpaceItem -> {
|
||||||
transform(MultiTransformation(CenterCrop(), RoundedCorners(dimensionConverter.dpToPx(8))))
|
it.transform(MultiTransformation(CenterCrop(), RoundedCorners(dimensionConverter.dpToPx(8))))
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
apply(RequestOptions.circleCropTransform())
|
it.apply(RequestOptions.circleCropTransform())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -157,13 +157,13 @@ class AvatarRenderer @Inject constructor(private val activeSessionHolder: Active
|
|||||||
fun shortcutDrawable(glideRequests: GlideRequests, matrixItem: MatrixItem, iconSize: Int): Bitmap {
|
fun shortcutDrawable(glideRequests: GlideRequests, matrixItem: MatrixItem, iconSize: Int): Bitmap {
|
||||||
return glideRequests
|
return glideRequests
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.apply {
|
.let {
|
||||||
val resolvedUrl = resolvedUrl(matrixItem.avatarUrl)
|
val resolvedUrl = resolvedUrl(matrixItem.avatarUrl)
|
||||||
if (resolvedUrl != null) {
|
if (resolvedUrl != null) {
|
||||||
load(resolvedUrl)
|
it.load(resolvedUrl)
|
||||||
} else {
|
} else {
|
||||||
val avatarColor = matrixItemColorProvider.getColor(matrixItem)
|
val avatarColor = matrixItemColorProvider.getColor(matrixItem)
|
||||||
load(TextDrawable.builder()
|
it.load(TextDrawable.builder()
|
||||||
.beginConfig()
|
.beginConfig()
|
||||||
.bold()
|
.bold()
|
||||||
.endConfig()
|
.endConfig()
|
||||||
|
@ -60,9 +60,11 @@ abstract class RoomDirectoryItem : VectorEpoxyModel<RoomDirectoryItem.Holder>()
|
|||||||
// Avatar
|
// Avatar
|
||||||
GlideApp.with(holder.avatarView)
|
GlideApp.with(holder.avatarView)
|
||||||
.load(directoryAvatarUrl)
|
.load(directoryAvatarUrl)
|
||||||
.apply {
|
.let {
|
||||||
if (!includeAllNetworks) {
|
if (!includeAllNetworks) {
|
||||||
placeholder(R.drawable.network_matrix)
|
it.placeholder(R.drawable.network_matrix)
|
||||||
|
} else {
|
||||||
|
it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.into(holder.avatarView)
|
.into(holder.avatarView)
|
||||||
|
@ -312,6 +312,7 @@ class RoomSettingsViewModel @AssistedInject constructor(@Assisted initialState:
|
|||||||
_viewEvents.post(RoomSettingsViewEvents.Failure(it))
|
_viewEvents.post(RoomSettingsViewEvents.Failure(it))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
.disposeOnClear()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun postLoading(isLoading: Boolean) {
|
private fun postLoading(isLoading: Boolean) {
|
||||||
|
Loading…
Reference in New Issue
Block a user