修改粉丝团

This commit is contained in:
18401019693 2022-11-02 14:20:25 +08:00
parent a50abb5b2c
commit 0f2fbeb114
5 changed files with 70 additions and 30 deletions

View File

@ -687,7 +687,7 @@ public class IMLoginModel extends BaseModel {
* @return * @return
*/ */
public boolean anchorUserType() { public boolean anchorUserType() {
return TextUtils.equals("C", usersType); return !TextUtils.equals("C", usersType);
} }
public IMLoginModel setUsersType(String usersType) { public IMLoginModel setUsersType(String usersType) {

View File

@ -4,15 +4,15 @@ ext {
buildToolsVersion: "28.0.3", buildToolsVersion: "28.0.3",
minSdkVersion : 21, minSdkVersion : 21,
targetSdkVersion : 31, targetSdkVersion : 31,
versionCode : 304, versionCode : 305,
versionName : "6.4.4" versionName : "6.4.4"
] ]
manifestPlaceholders = [ 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", txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",
@ -27,6 +27,6 @@ ext {
// true表示谷歌支付 false // true表示谷歌支付 false
isGooglePlay : true, isGooglePlay : true,
// //
isUploadLog : true isUploadLog : false
] ]
} }

View File

@ -280,7 +280,7 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex())); mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
if (levelBean != null) { if (levelBean != null) {
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), false, new ImgLoader.DrawableCallback() { new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() {
@Override @Override
public void onLoadSuccess(Drawable drawable) { public void onLoadSuccess(Drawable drawable) {
ImgLoader.display2(mContext, drawable, mLevel); ImgLoader.display2(mContext, drawable, mLevel);

View File

@ -37,6 +37,7 @@ import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.MsgModel; import com.yunbao.common.bean.MsgModel;
import com.yunbao.common.custom.VerticalImageSpan; import com.yunbao.common.custom.VerticalImageSpan;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.BitmapUtil;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
@ -46,6 +47,14 @@ import com.yunbao.live.bean.LiveChatBean;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; 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. * Created by cxf on 2018/10/11.
*/ */
@ -270,7 +279,7 @@ public class LiveTextRender {
Drawable drawable = getMedalImage(bean); Drawable drawable = getMedalImage(bean);
if (drawable != null) { if (drawable != null) {
builder.append(" "); 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); builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
index += 2; index += 2;
} }
@ -380,36 +389,38 @@ public class LiveTextRender {
}); });
} }
private ImgLoader.DrawableCallback mCallback;
/** /**
* 等级设置 * 等级设置
* *
* @return * @return
*/ */
public void getLevelImage(Context mContext, int userLevel, boolean anchorUserType, ImgLoader.DrawableCallback callback) { public void getLevelImage(Context mContext, int userLevel, ImgLoader.DrawableCallback callback) {
mCallback = callback;
String imgUrl = anchorUserType ? "https://downs.yaoulive.com/level/anchor_lv1_bg.png" : "https://downs.yaoulive.com/level/user_lv1_bg.png"; String imgUrl = "https://downs.yaoulive.com/level/user_lv1_bg.png";
if (0 < userLevel && userLevel < 10) { 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) { } 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) { } 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) { } 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) { } 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) { } 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) { } 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) { } 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) { } 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) { } 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) { } 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) { } else if (109 < userLevel && userLevel < 120) {
imgUrl = "https://downs.yaoulive.com/level/user_lv110_bg.png"; imgUrl = "https://downs.yaoulive.com/level/user_lv110_bg.png";
} else if (userLevel == 120) { } else if (userLevel == 120) {
@ -418,11 +429,38 @@ public class LiveTextRender {
Glide.with(mContext).asBitmap().load(imgUrl).into(new CustomTarget<Bitmap>() { Glide.with(mContext).asBitmap().load(imgUrl).into(new CustomTarget<Bitmap>() {
@Override @Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) { public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
; Observable.create(new ObservableOnSubscribe<Bitmap>() {
BitmapDrawable drawable = new BitmapDrawable(AddTimeWatermark(resource, String.valueOf(userLevel))); @Override
if (callback != null) { public void subscribe(ObservableEmitter<Bitmap> emitter) throws Exception {
callback.onLoadSuccess(drawable); 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 @Override
@ -434,6 +472,8 @@ public class LiveTextRender {
}); });
} }
private void renderTMP(Context context, final TextView textView, final LiveChatBean bean) { private void renderTMP(Context context, final TextView textView, final LiveChatBean bean) {
final LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel()); final LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
@ -454,7 +494,7 @@ public class LiveTextRender {
} }
} else { } else {
if (textView != null) { if (textView != null) {
getLevelImage(context, bean.getLevel(), bean.isAnchor(), new ImgLoader.DrawableCallback() { getLevelImage(context, bean.getLevel(), new ImgLoader.DrawableCallback() {
@Override @Override
public void onLoadSuccess(Drawable drawable) { public void onLoadSuccess(Drawable drawable) {
SpannableStringBuilder builder = createPrefix(drawable, bean); SpannableStringBuilder builder = createPrefix(drawable, bean);

View File

@ -120,12 +120,12 @@
<ImageView <ImageView
android:id="@+id/sex" android:id="@+id/sex"
android:layout_width="18dp" android:layout_width="18dp"
android:layout_height="15dp" /> android:layout_height="18dp" />
<ImageView <ImageView
android:id="@+id/level" android:id="@+id/level"
android:layout_width="30dp" android:layout_width="50dp"
android:layout_height="15dp" android:layout_height="18dp"
android:scaleType="fitXY" android:scaleType="fitXY"
android:layout_marginLeft="5dp" /> android:layout_marginLeft="5dp" />