|
@@ -97,8 +97,7 @@ public class TextDrawable extends Drawable {
|
|
|
*/
|
|
|
@NonNull
|
|
|
@NextcloudServer(max = 12)
|
|
|
- public static TextDrawable createAvatar(String accountName, float radiusInDp) throws
|
|
|
- UnsupportedEncodingException, NoSuchAlgorithmException {
|
|
|
+ public static TextDrawable createAvatar(String accountName, float radiusInDp) {
|
|
|
String username = AccountUtils.getAccountUsername(accountName);
|
|
|
return createNamedAvatar(username, radiusInDp);
|
|
|
}
|
|
@@ -115,8 +114,7 @@ public class TextDrawable extends Drawable {
|
|
|
*/
|
|
|
@NonNull
|
|
|
@NextcloudServer(max = 12)
|
|
|
- public static TextDrawable createAvatarByUserId(String userId, float radiusInDp) throws
|
|
|
- UnsupportedEncodingException, NoSuchAlgorithmException {
|
|
|
+ public static TextDrawable createAvatarByUserId(String userId, float radiusInDp) {
|
|
|
return createNamedAvatar(userId, radiusInDp);
|
|
|
}
|
|
|
|
|
@@ -127,8 +125,6 @@ public class TextDrawable extends Drawable {
|
|
|
* @param name the name
|
|
|
* @param radiusInDp the circle's radius
|
|
|
* @return the avatar as a TextDrawable
|
|
|
- * @throws UnsupportedEncodingException if the charset is not supported when calculating the color values
|
|
|
- * @throws NoSuchAlgorithmException if the specified algorithm is not available when calculating the color values
|
|
|
*/
|
|
|
@NonNull
|
|
|
public static TextDrawable createNamedAvatar(String name, float radiusInDp) {
|
|
@@ -146,7 +142,7 @@ public class TextDrawable extends Drawable {
|
|
|
* @param canvas The canvas to draw into
|
|
|
*/
|
|
|
@Override
|
|
|
- public void draw(Canvas canvas) {
|
|
|
+ public void draw(@NonNull Canvas canvas) {
|
|
|
canvas.drawCircle(mRadius, mRadius, mRadius, mBackground);
|
|
|
canvas.drawText(mText, mRadius, mRadius - ((mTextPaint.descent() + mTextPaint.ascent()) / 2), mTextPaint);
|
|
|
}
|