Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-android
Commits
95fcf7b9
Commit
95fcf7b9
authored
Sep 27, 2021
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
avatar: handle null bitmap
Change-Id: Ibc4601b40dbcd7c2ade6df360a5ff76fc88a07ae
parent
eaddf85b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ring-android/app/src/main/java/cx/ring/views/AvatarFactory.kt
+3
-3
3 additions, 3 deletions
...-android/app/src/main/java/cx/ring/views/AvatarFactory.kt
with
3 additions
and
3 deletions
ring-android/app/src/main/java/cx/ring/views/AvatarFactory.kt
+
3
−
3
View file @
95fcf7b9
...
...
@@ -96,7 +96,7 @@ object AvatarFactory {
.
map
{
d
->
BitmapUtils
.
drawableToBitmap
(
d
,
size
)
}
}
private
fun
getDrawable
(
context
:
Context
,
photo
:
Bitmap
,
profileName
:
String
?,
username
:
String
?,
id
:
String
):
Drawable
{
private
fun
getDrawable
(
context
:
Context
,
photo
:
Bitmap
?
,
profileName
:
String
?,
username
:
String
?,
id
:
String
):
Drawable
{
return
AvatarDrawable
.
Builder
()
.
withPhoto
(
photo
)
.
withName
(
if
(
TextUtils
.
isEmpty
(
profileName
))
username
else
profileName
)
...
...
@@ -107,12 +107,12 @@ object AvatarFactory {
fun
clearCache
()
{}
private
fun
<
T
>
getGlideRequest
(
context
:
Context
,
request
:
RequestBuilder
<
T
>,
photo
:
Bitmap
,
profileName
:
String
?,
username
:
String
?,
id
:
String
):
RequestBuilder
<
T
>
{
private
fun
<
T
>
getGlideRequest
(
context
:
Context
,
request
:
RequestBuilder
<
T
>,
photo
:
Bitmap
?
,
profileName
:
String
?,
username
:
String
?,
id
:
String
):
RequestBuilder
<
T
>
{
return
request
.
load
(
getDrawable
(
context
,
photo
,
profileName
,
username
,
id
))
}
private
fun
getGlideAvatar
(
context
:
Context
,
manager
:
RequestManager
,
contact
:
Contact
):
RequestBuilder
<
Drawable
>
{
return
getGlideRequest
(
context
,
manager
.
asDrawable
(),
contact
.
photo
as
Bitmap
,
contact
.
profileName
,
contact
.
username
,
contact
.
primaryNumber
)
return
getGlideRequest
(
context
,
manager
.
asDrawable
(),
contact
.
photo
as
Bitmap
?
,
contact
.
profileName
,
contact
.
username
,
contact
.
primaryNumber
)
}
private
fun
getGlideAvatar
(
context
:
Context
,
contact
:
Contact
):
RequestBuilder
<
Drawable
>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment