File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
WordPressUtils/src/main/java/org/wordpress/android/util Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change 11package org .wordpress .android .util ;
22
3- import android .text .TextUtils ;
4-
53public class GravatarUtils {
64 /*
75 * see https://en.gravatar.com/site/implement/images/
86 */
9- public static String gravatarUrlFromEmail (final String email , int size ) {
10- if (TextUtils .isEmpty (email ))
11- return "" ;
12-
13- String url = "http://gravatar.com/avatar/"
14- + StringUtils .getMd5Hash (email )
15- + "?d=mm" ;
16-
17- if (size > 0 )
18- url += "&s=" + Integer .toString (size );
7+ public static String gravatarFromEmail (final String email , int size ) {
8+ return "http://gravatar.com/avatar/"
9+ + StringUtils .getMd5Hash (StringUtils .notNullStr (email ))
10+ + "?d=mm&size=" + Integer .toString (size );
11+ }
1912
20- return url ;
13+ public static String blavatarFromUrl (final String url , int size ) {
14+ return "http://gravatar.com/blavatar/"
15+ + StringUtils .getMd5Hash (UrlUtils .getDomainFromUrl (url ))
16+ + "?d=mm&size=" + Integer .toString (size );
2117 }
2218}
You can’t perform that action at this time.
0 commit comments