|
|
@@ -94,6 +94,7 @@ public class AvatarHelper {
|
|
|
// return;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
public void displayRoomAvatar(String userId, final ImageView imageView, final boolean isThumb) {
|
|
|
final String url = getAvatarUrl(userId, isThumb);
|
|
|
if (TextUtils.isEmpty(url)) {
|
|
|
@@ -137,6 +138,7 @@ public class AvatarHelper {
|
|
|
display(url, imageView, isThumb);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
public void displayAvatar(String userId, final ImageView imageView, final boolean isThumb) {
|
|
|
final String url = getAvatarUrl(userId, isThumb);
|
|
|
if (TextUtils.isEmpty(url)) {
|
|
|
@@ -184,7 +186,7 @@ public class AvatarHelper {
|
|
|
|
|
|
public void displayAvatarPng(String userId, final ImageView imageView, final boolean isThumb) {
|
|
|
final String url = getAvatarUrlPng(userId, isThumb);
|
|
|
- Log.i("Arison","AvatarHelper:displayAvatar:140:"+url);
|
|
|
+ Log.i("Arison", "AvatarHelper:displayAvatar:140:" + url);
|
|
|
if (TextUtils.isEmpty(url)) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -280,12 +282,13 @@ public class AvatarHelper {
|
|
|
|
|
|
/**
|
|
|
* 图片的url 转 Bitmap对象
|
|
|
+ *
|
|
|
* @param userId
|
|
|
* @param isThumb
|
|
|
* @return
|
|
|
*/
|
|
|
- public static Bitmap returnBitmap(String userId,boolean isThumb){
|
|
|
- final String urlpath = getAvatarUrl(userId, isThumb);
|
|
|
+ public static Bitmap returnBitmap(String userId, boolean isThumb) {
|
|
|
+ final String urlpath = getAvatarUrl(userId, isThumb);
|
|
|
Bitmap mBitmap = null;
|
|
|
try {
|
|
|
URL url = new URL(urlpath);
|
|
|
@@ -302,10 +305,11 @@ public class AvatarHelper {
|
|
|
|
|
|
/**
|
|
|
* 图片的 Bitmap对象转 url
|
|
|
+ *
|
|
|
* @param bitmap
|
|
|
* @return
|
|
|
*/
|
|
|
- public static String doBitmapTurnToStringurl(Bitmap bitmap){
|
|
|
+ public static String doBitmapTurnToStringurl(Bitmap bitmap) {
|
|
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();// outputstream
|
|
|
bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos);
|
|
|
byte[] appicon = baos.toByteArray();// 转为byte数组
|
|
|
@@ -362,15 +366,17 @@ public class AvatarHelper {
|
|
|
display(url, imageAware, isThumb);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
public static String getRoomAvatarUrl(String userId, boolean isThumb) {
|
|
|
String url = null;
|
|
|
if (isThumb) {
|
|
|
- url = MyApplication.getInstance().getConfig().AVATAR_THUMB_PREFIX + "/" + "/" + userId + ".jpg";
|
|
|
+ url = MyApplication.getInstance().getConfig().AVATAR_THUMB_PREFIX + "/" + "/" + userId + ".jpg";
|
|
|
} else {
|
|
|
- url = MyApplication.getInstance().getConfig().AVATAR_ORIGINAL_PREFIX + "/" + "/" + userId + ".jpg";
|
|
|
+ url = MyApplication.getInstance().getConfig().AVATAR_ORIGINAL_PREFIX + "/" + "/" + userId + ".jpg";
|
|
|
}
|
|
|
return url;
|
|
|
}
|
|
|
+
|
|
|
public static String getAvatarUrl(String userId, boolean isThumb) {
|
|
|
if (TextUtils.isEmpty(userId)) {
|
|
|
return null;
|
|
|
@@ -421,7 +427,6 @@ public class AvatarHelper {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
// // 无用
|
|
|
// public void displayResumeAvatar(String userId, ImageView imageView, boolean isThumb) {
|
|
|
// String url = getResumeAvatar(userId, isThumb);
|