修改粉丝团
This commit is contained in:
parent
a50abb5b2c
commit
0f2fbeb114
@ -687,7 +687,7 @@ public class IMLoginModel extends BaseModel {
|
||||
* @return
|
||||
*/
|
||||
public boolean anchorUserType() {
|
||||
return TextUtils.equals("C", usersType);
|
||||
return !TextUtils.equals("C", usersType);
|
||||
}
|
||||
|
||||
public IMLoginModel setUsersType(String usersType) {
|
||||
|
@ -4,15 +4,15 @@ ext {
|
||||
buildToolsVersion: "28.0.3",
|
||||
minSdkVersion : 21,
|
||||
targetSdkVersion : 31,
|
||||
versionCode : 304,
|
||||
versionCode : 305,
|
||||
versionName : "6.4.4"
|
||||
]
|
||||
manifestPlaceholders = [
|
||||
//正式
|
||||
|
||||
// serverHost : "https://napi.yaoulive.com",
|
||||
serverHost : "https://napi.yaoulive.com",
|
||||
//測試
|
||||
serverHost : "https://ceshi.yaoulive.com",
|
||||
// serverHost : "https://ceshi.yaoulive.com",
|
||||
|
||||
//腾讯地图
|
||||
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",
|
||||
@ -27,6 +27,6 @@ ext {
|
||||
// true表示谷歌支付 false
|
||||
isGooglePlay : true,
|
||||
//是否上报异常日志
|
||||
isUploadLog : true
|
||||
isUploadLog : false
|
||||
]
|
||||
}
|
@ -280,7 +280,7 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
|
||||
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
if (levelBean != null) {
|
||||
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), false, new ImgLoader.DrawableCallback() {
|
||||
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
|
@ -37,6 +37,7 @@ import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.MsgModel;
|
||||
import com.yunbao.common.custom.VerticalImageSpan;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.BitmapUtil;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
@ -46,6 +47,14 @@ import com.yunbao.live.bean.LiveChatBean;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/10/11.
|
||||
*/
|
||||
@ -270,7 +279,7 @@ public class LiveTextRender {
|
||||
Drawable drawable = getMedalImage(bean);
|
||||
if (drawable != null) {
|
||||
builder.append(" ");
|
||||
drawable.setBounds(0, 0, DpUtil.dp2px(42), DpUtil.dp2px(14));
|
||||
drawable.setBounds(0, 0, DpUtil.dp2px(44), DpUtil.dp2px(17));
|
||||
builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
index += 2;
|
||||
}
|
||||
@ -380,36 +389,38 @@ public class LiveTextRender {
|
||||
});
|
||||
}
|
||||
|
||||
private ImgLoader.DrawableCallback mCallback;
|
||||
|
||||
/**
|
||||
* 等级设置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public void getLevelImage(Context mContext, int userLevel, boolean anchorUserType, ImgLoader.DrawableCallback callback) {
|
||||
|
||||
String imgUrl = anchorUserType ? "https://downs.yaoulive.com/level/anchor_lv1_bg.png" : "https://downs.yaoulive.com/level/user_lv1_bg.png";
|
||||
public void getLevelImage(Context mContext, int userLevel, ImgLoader.DrawableCallback callback) {
|
||||
mCallback = callback;
|
||||
String imgUrl = "https://downs.yaoulive.com/level/user_lv1_bg.png";
|
||||
if (0 < userLevel && userLevel < 10) {
|
||||
imgUrl = anchorUserType ? "https://downs.yaoulive.com/level/anchor_lv1_bg.png" : "https://downs.yaoulive.com/level/user_lv1_bg.png";
|
||||
imgUrl = "https://downs.yaoulive.com/level/user_lv1_bg.png";
|
||||
} else if (9 < userLevel && userLevel < 20) {
|
||||
imgUrl = anchorUserType ? "https://downs.yaoulive.com/level/anchor_lv10_bg.png" : "https://downs.yaoulive.com/level/user_lv10_bg.png";
|
||||
imgUrl = "https://downs.yaoulive.com/level/user_lv10_bg.png";
|
||||
} else if (19 < userLevel && userLevel < 30) {
|
||||
imgUrl = anchorUserType ? "https://downs.yaoulive.com/level/anchor_l20_bg.png" : "https://downs.yaoulive.com/level/user_lv20_bg.png";
|
||||
imgUrl = "https://downs.yaoulive.com/level/user_lv20_bg.png";
|
||||
} else if (29 < userLevel && userLevel < 40) {
|
||||
imgUrl = anchorUserType ? "https://downs.yaoulive.com/level/anchor_lv30_bg.png" : "https://downs.yaoulive.com/level/user_lv30_bg.png";
|
||||
imgUrl = "https://downs.yaoulive.com/level/user_lv30_bg.png";
|
||||
} else if (39 < userLevel && userLevel < 50) {
|
||||
imgUrl = anchorUserType ? "https://downs.yaoulive.com/level/anchor_lv40_bg.png" : "https://downs.yaoulive.com/level/user_lv40_bg.png";
|
||||
imgUrl = "https://downs.yaoulive.com/level/user_lv40_bg.png";
|
||||
} else if (49 < userLevel && userLevel < 60) {
|
||||
imgUrl = anchorUserType ? "https://downs.yaoulive.com/level/anchor_lv50_bg.png" : "https://downs.yaoulive.com/level/user_lv50_bg.png";
|
||||
imgUrl = "https://downs.yaoulive.com/level/user_lv50_bg.png";
|
||||
} else if (59 < userLevel && userLevel < 70) {
|
||||
imgUrl = anchorUserType ? "https://downs.yaoulive.com/level/anchor_lv60_bg.png" : "https://downs.yaoulive.com/level/user_lv60_bg.png";
|
||||
imgUrl = "https://downs.yaoulive.com/level/user_lv60_bg.png";
|
||||
} else if (69 < userLevel && userLevel < 80) {
|
||||
imgUrl = anchorUserType ? "https://downs.yaoulive.com/level/anchor_lv70_bg.png" : "https://downs.yaoulive.com/level/user_lv70_bg.png";
|
||||
imgUrl = "https://downs.yaoulive.com/level/user_lv70_bg.png";
|
||||
} else if (79 < userLevel && userLevel < 90) {
|
||||
imgUrl = anchorUserType ? "https://downs.yaoulive.com/level/anchor_lv80_bg.png" : "https://downs.yaoulive.com/level/user_lv80_bg.png";
|
||||
imgUrl = "https://downs.yaoulive.com/level/user_lv80_bg.png";
|
||||
} else if (89 < userLevel && userLevel < 100) {
|
||||
imgUrl = anchorUserType ? "https://downs.yaoulive.com/level/anchor_lv90_bg.png" : "https://downs.yaoulive.com/level/user_lv90_bg.png";
|
||||
imgUrl = "https://downs.yaoulive.com/level/user_lv90_bg.png";
|
||||
} else if (99 < userLevel && userLevel < 110) {
|
||||
imgUrl = anchorUserType ? "https://downs.yaoulive.com/level/anchor_lv100_bg.png" : "https://downs.yaoulive.com/level/user_lv100_bg.png";
|
||||
imgUrl = "https://downs.yaoulive.com/level/user_lv100_bg.png";
|
||||
} else if (109 < userLevel && userLevel < 120) {
|
||||
imgUrl = "https://downs.yaoulive.com/level/user_lv110_bg.png";
|
||||
} else if (userLevel == 120) {
|
||||
@ -418,11 +429,38 @@ public class LiveTextRender {
|
||||
Glide.with(mContext).asBitmap().load(imgUrl).into(new CustomTarget<Bitmap>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
|
||||
;
|
||||
BitmapDrawable drawable = new BitmapDrawable(AddTimeWatermark(resource, String.valueOf(userLevel)));
|
||||
if (callback != null) {
|
||||
callback.onLoadSuccess(drawable);
|
||||
}
|
||||
Observable.create(new ObservableOnSubscribe<Bitmap>() {
|
||||
@Override
|
||||
public void subscribe(ObservableEmitter<Bitmap> emitter) throws Exception {
|
||||
emitter.onNext(AddTimeWatermark(resource, String.valueOf(userLevel)));
|
||||
}
|
||||
}).subscribeOn(Schedulers.newThread())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<Bitmap>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(Bitmap bitmap) {
|
||||
BitmapDrawable drawable = new BitmapDrawable(bitmap);
|
||||
if (callback != null) {
|
||||
callback.onLoadSuccess(drawable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -434,6 +472,8 @@ public class LiveTextRender {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void renderTMP(Context context, final TextView textView, final LiveChatBean bean) {
|
||||
final LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
|
||||
@ -454,7 +494,7 @@ public class LiveTextRender {
|
||||
}
|
||||
} else {
|
||||
if (textView != null) {
|
||||
getLevelImage(context, bean.getLevel(), bean.isAnchor(), new ImgLoader.DrawableCallback() {
|
||||
getLevelImage(context, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
SpannableStringBuilder builder = createPrefix(drawable, bean);
|
||||
|
@ -120,12 +120,12 @@
|
||||
<ImageView
|
||||
android:id="@+id/sex"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="15dp" />
|
||||
android:layout_height="18dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/level"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="18dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_marginLeft="5dp" />
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user