mirror of
https://github.com/nextcloud/talk-android
synced 2025-02-02 04:32:02 +00:00
Fix a crash with resources being null
This commit is contained in:
parent
35fd4d36a9
commit
fafca26572
@ -447,21 +447,25 @@ public class CallNotificationController extends BaseController {
|
|||||||
script.forEach(output);
|
script.forEach(output);
|
||||||
output.copyTo(resource);
|
output.copyTo(resource);
|
||||||
|
|
||||||
incomingTextRelativeLayout.setBackground(getResources().getDrawable(R.drawable
|
if (getResources() != null) {
|
||||||
.incoming_gradient));
|
incomingTextRelativeLayout.setBackground(getResources().getDrawable(R.drawable
|
||||||
constraintLayout.setBackground(new BitmapDrawable(resource));
|
.incoming_gradient));
|
||||||
|
constraintLayout.setBackground(new BitmapDrawable(resource));
|
||||||
|
}
|
||||||
} else if (AvatarStatusCodeHolder.getInstance().getStatusCode() == 201) {
|
} else if (AvatarStatusCodeHolder.getInstance().getStatusCode() == 201) {
|
||||||
Palette palette = Palette.from(resource).generate();
|
Palette palette = Palette.from(resource).generate();
|
||||||
int color = palette.getDominantColor(getResources().getColor(R.color.grey950));
|
if (getResources() != null) {
|
||||||
|
int color = palette.getDominantColor(getResources().getColor(R.color.grey950));
|
||||||
|
|
||||||
if (color != getResources().getColor(R.color.grey950)) {
|
if (color != getResources().getColor(R.color.grey950)) {
|
||||||
float[] hsv = new float[3];
|
float[] hsv = new float[3];
|
||||||
Color.colorToHSV(color, hsv);
|
Color.colorToHSV(color, hsv);
|
||||||
hsv[2] *= 0.75f;
|
hsv[2] *= 0.75f;
|
||||||
color = Color.HSVToColor(hsv);
|
color = Color.HSVToColor(hsv);
|
||||||
|
}
|
||||||
|
|
||||||
|
constraintLayout.setBackgroundColor(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
constraintLayout.setBackgroundColor(color);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user