Compare commits
16 Commits
6.4.4
...
change_liv
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c57486b69c | ||
|
|
0f2fbeb114 | ||
|
|
a50abb5b2c | ||
|
|
2102acd9e5 | ||
|
|
b8ee197e52 | ||
|
|
ba81a46e2f | ||
|
|
6841f47ac3 | ||
| a2fef0990a | |||
| 9e411ecd71 | |||
| 7e9b794c7f | |||
|
|
e70a5e09f6 | ||
| 3e8db9ec7e | |||
| 34f70bb4cd | |||
|
|
12f78dc3b8 | ||
| 89a54276b3 | |||
| 73fb523ddc |
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#FF8D41</color>
|
||||
<color name="colorPrimaryDark">#FF8D41</color>
|
||||
<color name="colorAccent">#FF8D41</color>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
|
||||
<!--fulive demo 主配色-->
|
||||
<color name="primary_background">#050F14</color>
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyCharacterMap;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
@@ -358,4 +359,15 @@ public abstract class AbsActivity extends AppCompatActivity {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTrimMemory(int level) {
|
||||
super.onTrimMemory(level);
|
||||
Log.i("memory", "onTrimMemory: " + level);
|
||||
switch (level) {
|
||||
case TRIM_MEMORY_RUNNING_CRITICAL://内存低值危险值
|
||||
break;
|
||||
case TRIM_MEMORY_RUNNING_LOW://内存过低
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,8 +62,12 @@ public class CrashSaveBean {
|
||||
public String getActivitySize() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (WeakReference<Activity> activity : activities) {
|
||||
try {
|
||||
if (activity.get() != null) {
|
||||
builder.append(activity.get()).append(",");
|
||||
builder.append(activity.get().getClass().getSimpleName()).append(",");
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
return builder.toString();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
@@ -679,6 +681,15 @@ public class IMLoginModel extends BaseModel {
|
||||
return usersType;
|
||||
}
|
||||
|
||||
/**
|
||||
* usersType ==C 是主播身份
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean anchorUserType() {
|
||||
return !TextUtils.equals("C", usersType);
|
||||
}
|
||||
|
||||
public IMLoginModel setUsersType(String usersType) {
|
||||
this.usersType = usersType;
|
||||
return this;
|
||||
|
||||
@@ -68,17 +68,7 @@ public class MsgModel extends BaseModel {
|
||||
private String taskName1;
|
||||
@SerializedName("taskName2")
|
||||
private String taskName2;
|
||||
@SerializedName("activityUrl")
|
||||
private String activityUrl;
|
||||
|
||||
public String getActivityUrl() {
|
||||
return activityUrl;
|
||||
}
|
||||
|
||||
public MsgModel setActivityUrl(String activityUrl) {
|
||||
this.activityUrl = activityUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 星级挑战成功IM消息
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* 新用户等级牌
|
||||
*/
|
||||
public class NewLevelModel extends BaseModel {
|
||||
|
||||
@SerializedName("id")
|
||||
private String id;
|
||||
@SerializedName("levemin")
|
||||
private String levemin;
|
||||
@SerializedName("levemax")
|
||||
private String levemax;
|
||||
@SerializedName("thumb")
|
||||
private String thumb;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public NewLevelModel setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLevemin() {
|
||||
return levemin;
|
||||
}
|
||||
|
||||
public int getLeveMin() {
|
||||
return Integer.parseInt(levemin);
|
||||
}
|
||||
|
||||
public int getLeveMax() {
|
||||
return Integer.parseInt(levemax);
|
||||
}
|
||||
|
||||
public NewLevelModel setLevemin(String levemin) {
|
||||
this.levemin = levemin;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLevemax() {
|
||||
return levemax;
|
||||
}
|
||||
|
||||
public NewLevelModel setLevemax(String levemax) {
|
||||
this.levemax = levemax;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getThumb() {
|
||||
return thumb;
|
||||
}
|
||||
|
||||
public NewLevelModel setThumb(String thumb) {
|
||||
this.thumb = thumb;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,6 @@ import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
@@ -82,15 +77,6 @@ public class HintDialog extends AbsDialogFragment {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show(@NonNull FragmentManager manager, @Nullable String tag) {
|
||||
try {
|
||||
super.show(manager, tag);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private HintListener listener;
|
||||
|
||||
public HintDialog setListener(HintListener listener) {
|
||||
|
||||
@@ -72,6 +72,7 @@ public class ImgLoader {
|
||||
.load(url)
|
||||
|
||||
.thumbnail(thumbnail)
|
||||
.dontAnimate()
|
||||
.placeholder(imageView.getDrawable());
|
||||
if (width != -1 && height != -1) {
|
||||
builder = builder.override(width, height);
|
||||
@@ -94,6 +95,20 @@ public class ImgLoader {
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
public static void display2(Context context, Drawable drawable, ImageView imageView) {
|
||||
if (!contextIsExist(context)) {
|
||||
return;
|
||||
}
|
||||
Glide.with(context)
|
||||
.asDrawable()
|
||||
.load(drawable)
|
||||
.thumbnail(thumbnail)
|
||||
.placeholder(imageView.getDrawable())
|
||||
.dontAnimate()
|
||||
.skipMemoryCache(SKIP_MEMORY_CACHE)
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
public static void displayWithError(Context context, String url, ImageView imageView, int errorRes) {
|
||||
displayWithError(context, url, imageView, errorRes, -1, -1);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.util.Log;
|
||||
|
||||
import com.adjust.sdk.Adjust;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
@@ -18,6 +19,7 @@ import com.yunbao.common.bean.ConfigBean;
|
||||
import com.yunbao.common.event.FollowEvent;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MD5Util;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
@@ -190,6 +192,10 @@ public class CommonHttpUtil {
|
||||
if (obj.containsKey("is_chat")) {
|
||||
IMLoginManager.get(context).initChat(String.valueOf(obj.getInteger("is_chat")));
|
||||
}
|
||||
if (obj.containsKey("level_new")) {//缓存等级数据
|
||||
JSONArray levelArray = obj.getJSONArray("level_new");
|
||||
new NewLevelManager(context).UpDataLevel(levelArray.toJSONString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage();
|
||||
ErrorActivity.forward("GetConfig接口返回数据异常", error);
|
||||
|
||||
@@ -7,8 +7,10 @@ import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.cosmos.baseutil.app.AppContext;
|
||||
import com.google.gson.Gson;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.event.DataUserInfoEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
@@ -25,18 +27,18 @@ import org.greenrobot.eventbus.EventBus;
|
||||
* 登录者信息管理
|
||||
*/
|
||||
public class IMLoginManager extends BaseCacheManager {
|
||||
private final static String KEY_USER_INFO = "keyUserInfo";
|
||||
private final String KEY_USER_INFO = "keyUserInfo";
|
||||
private static IMLoginManager manager;
|
||||
private IMLoginModel userInfo;
|
||||
private final static String isNewUserGif = "isNewUserGif";
|
||||
private final static String isNewUserOne = "isNewUserOne";
|
||||
private final static String GiftEffect = "giftEffect";
|
||||
private final static String MountEffect = "mountEffect";
|
||||
private final static String IS_CHAT = "isChat";
|
||||
private final static String IS_SLIDE = "isSlide";
|
||||
private final static String IS_FLOAT = "is_float";
|
||||
private final static String IS_HINT = "is_hint";
|
||||
private final static String IS_HINT2 = "is_hint2";
|
||||
private final String isNewUserGif = "isNewUserGif";
|
||||
private final String isNewUserOne = "isNewUserOne";
|
||||
private final String GiftEffect = "giftEffect";
|
||||
private final String MountEffect = "mountEffect";
|
||||
private final String IS_CHAT = "isChat";
|
||||
private final String IS_SLIDE = "isSlide";
|
||||
private final String IS_FLOAT = "is_float";
|
||||
private final String IS_HINT = "is_hint";
|
||||
private final String IS_HINT2 = "is_hint2";
|
||||
|
||||
|
||||
public boolean isHint() {
|
||||
@@ -151,7 +153,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
*/
|
||||
public static IMLoginManager get(Context context) {
|
||||
if (null == manager) {
|
||||
manager = new IMLoginManager(context);
|
||||
manager = new IMLoginManager(CommonAppContext.sInstance.getBaseContext());
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.yunbao.common.manager;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.manager.base.BaseCacheManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新粉丝牌管理
|
||||
*/
|
||||
public class NewLevelManager extends BaseCacheManager {
|
||||
private final String KEY_USER_LEVEL = "keyUserLevel";
|
||||
private List<NewLevelModel> newLevelModels = new ArrayList<>();
|
||||
|
||||
public NewLevelManager(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存等级图标
|
||||
*
|
||||
* @param json
|
||||
*/
|
||||
public void UpDataLevel(String json) {
|
||||
newLevelModels = new Gson().fromJson(json, new TypeToken<List<NewLevelModel>>() {
|
||||
}.getType());
|
||||
put(KEY_USER_LEVEL, newLevelModels);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取等级数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<NewLevelModel> getNewLevelModels() {
|
||||
return getList(KEY_USER_LEVEL, new TypeToken<List<NewLevelModel>>() {
|
||||
}.getType());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,11 +6,9 @@ import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffXfermode;
|
||||
import android.graphics.Rect;
|
||||
import android.provider.MediaStore;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
@@ -197,24 +195,4 @@ public class BitmapUtil {
|
||||
canvas.drawBitmap(bitmap, 0, 0, paint);
|
||||
return bm;
|
||||
}
|
||||
|
||||
/**
|
||||
* 镜像Bitmap
|
||||
*
|
||||
* @param bitmap
|
||||
* @return
|
||||
*/
|
||||
public Bitmap convertMirror(Bitmap bitmap) {
|
||||
int w = bitmap.getWidth();
|
||||
int h = bitmap.getHeight();
|
||||
Bitmap newb = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);// 创建一个新的和SRC长度宽度一样的位图
|
||||
Canvas cv = new Canvas(newb);
|
||||
Matrix m = new Matrix();
|
||||
//m.postScale(1, -1); //镜像垂直翻转
|
||||
m.postScale(-1, 1); //镜像水平翻转
|
||||
//m.postRotate(-90); //旋转-90度
|
||||
Bitmap new2 = Bitmap.createBitmap(bitmap, 0, 0, w, h, m, true);
|
||||
cv.drawBitmap(new2, new Rect(0, 0, new2.getWidth(), new2.getHeight()), new Rect(0, 0, w, h), null);
|
||||
return newb;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
@@ -69,4 +70,14 @@ public class DeviceUtils {
|
||||
return "0";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前是否处于低内存状态
|
||||
*/
|
||||
public static boolean isLowMemory(Context context) {
|
||||
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
|
||||
am.getMemoryInfo(mi);
|
||||
return mi.lowMemory;// 将获取的内存大小规格化
|
||||
}
|
||||
}
|
||||
@@ -7,17 +7,16 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.lzf.easyfloat.enums.ShowPattern;
|
||||
import com.lzf.easyfloat.interfaces.FloatCallbacks;
|
||||
import com.lzf.easyfloat.interfaces.OnInvokeView;
|
||||
import com.tencent.rtmp.ITXLivePlayListener;
|
||||
import com.tencent.rtmp.TXLivePlayer;
|
||||
import com.tencent.live2.V2TXLivePlayer;
|
||||
import com.tencent.live2.V2TXLivePlayerObserver;
|
||||
import com.tencent.live2.impl.V2TXLivePlayerImpl;
|
||||
import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
@@ -25,7 +24,6 @@ import com.yunbao.common.dialog.HintDialog;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.views.floatingview.APPEasyFloat;
|
||||
import com.yunbao.common.views.floatingview.FloatingMagnetView;
|
||||
@@ -49,7 +47,7 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
|
||||
private int mLiveTypeVal;
|
||||
private FloatCallbacks.Builder builder;
|
||||
private String TAG = "LiveFloatView";
|
||||
private TXLivePlayer mPlayer;
|
||||
private V2TXLivePlayer mPlayer;
|
||||
|
||||
public static LiveFloatView getInstance() {
|
||||
if (instance == null) {
|
||||
@@ -70,48 +68,28 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
|
||||
.setMagnetViewListener(new MagnetViewListener() {
|
||||
@Override
|
||||
public void invoke(FloatingMagnetView magnetView) {
|
||||
CardView layout = magnetView.findViewById(R.id.layout);
|
||||
RelativeLayout.LayoutParams cardParams = (RelativeLayout.LayoutParams) layout.getLayoutParams();
|
||||
if (mLiveBean.getLandscape() == 1) {
|
||||
cardParams.height = DpUtil.dp2px(130);
|
||||
cardParams.width = DpUtil.dp2px(230);
|
||||
} else {
|
||||
cardParams.height = DpUtil.dp2px(224);
|
||||
cardParams.width = DpUtil.dp2px(126);
|
||||
}
|
||||
TXCloudVideoView videoView = magnetView.findViewById(R.id.video_view);
|
||||
mPlayer = new TXLivePlayer(mContext);
|
||||
mPlayer.setPlayerView(videoView);
|
||||
mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV);
|
||||
mPlayer.setPlayListener(new ITXLivePlayListener() {
|
||||
mPlayer = new V2TXLivePlayerImpl(mContext);
|
||||
mPlayer.setRenderView(videoView);
|
||||
mPlayer.startPlay(url);
|
||||
mPlayer.setObserver(new V2TXLivePlayerObserver() {
|
||||
@Override
|
||||
public void onPlayEvent(int event, Bundle param) {
|
||||
float videoWidth = param.getInt("EVT_PARAM1", 0);
|
||||
float videoHeight = param.getInt("EVT_PARAM2", 0);
|
||||
Log.e("视频流有", "videoWidth:" + videoWidth + " videoHeight:" + videoHeight);
|
||||
if (mLiveBean.getLandscape() != 1){
|
||||
if (videoWidth > 720) {
|
||||
cardParams.height = DpUtil.dp2px(130);
|
||||
cardParams.width = DpUtil.dp2px(230);
|
||||
} else {
|
||||
cardParams.height = DpUtil.dp2px(224);
|
||||
cardParams.width = DpUtil.dp2px(126);
|
||||
}
|
||||
layout.setLayoutParams(cardParams);
|
||||
}
|
||||
|
||||
public void onWarning(V2TXLivePlayer player, int code, String msg, Bundle extraInfo) {
|
||||
super.onWarning(player, code, msg, extraInfo);
|
||||
Log.e(TAG, msg + "==============" + code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNetStatus(Bundle bundle) {
|
||||
public void onError(V2TXLivePlayer player, int code, String msg, Bundle extraInfo) {
|
||||
super.onError(player, code, msg, extraInfo);
|
||||
Log.e(TAG, msg + "==============" + code);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(magnetView.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
mPlayer.stopPlay(true);
|
||||
mPlayer.stopPlay();
|
||||
APPEasyFloat.getInstance().dismiss(mContext);
|
||||
if (IMLoginManager.get(mContext).isHint2()&& !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) {
|
||||
HintDialog fragment = new HintDialog();
|
||||
@@ -123,7 +101,7 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(videoView, () -> {
|
||||
mPlayer.stopPlay(true);
|
||||
mPlayer.stopPlay();
|
||||
APPEasyFloat.getInstance().dismiss(mContext);
|
||||
new Handler().post(liveCheck);
|
||||
|
||||
@@ -139,7 +117,7 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
|
||||
@Override
|
||||
public void dismiss() {
|
||||
if (mPlayer != null)
|
||||
mPlayer.stopPlay(true);
|
||||
mPlayer.stopPlay();
|
||||
}
|
||||
})
|
||||
.show(mContext);
|
||||
@@ -178,14 +156,15 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
|
||||
callback.invoke(aBoolean);
|
||||
}
|
||||
builder.dismiss(() -> {
|
||||
if (mPlayer != null && mPlayer.isPlaying()) {
|
||||
mPlayer.stopPlay(true);
|
||||
if (mPlayer != null && mPlayer.isPlaying() == 1) {
|
||||
mPlayer.stopPlay();
|
||||
}
|
||||
return null;
|
||||
});
|
||||
builder.hide(view12 -> {
|
||||
if (mPlayer != null && mPlayer.isPlaying()) {
|
||||
mPlayer.pause();
|
||||
if (mPlayer != null && mPlayer.isPlaying() == 1) {
|
||||
mPlayer.pauseAudio();
|
||||
mPlayer.pauseVideo();
|
||||
}
|
||||
return null;
|
||||
});
|
||||
@@ -203,49 +182,14 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
|
||||
@Override
|
||||
public void invoke(View view) {
|
||||
TXCloudVideoView videoView = view.findViewById(R.id.video_view);
|
||||
CardView layout = view.findViewById(R.id.layout);
|
||||
RelativeLayout.LayoutParams cardParams = (RelativeLayout.LayoutParams) layout.getLayoutParams();
|
||||
if (mLiveBean.getLandscape() == 1) {
|
||||
cardParams.height = DpUtil.dp2px(130);
|
||||
cardParams.width = DpUtil.dp2px(230);
|
||||
} else {
|
||||
cardParams.height = DpUtil.dp2px(224);
|
||||
cardParams.width = DpUtil.dp2px(126);
|
||||
}
|
||||
layout.setLayoutParams(cardParams);
|
||||
mPlayer = new TXLivePlayer(mContext);
|
||||
mPlayer.setPlayerView(videoView);
|
||||
mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV);
|
||||
mPlayer.setPlayListener(new ITXLivePlayListener() {
|
||||
@Override
|
||||
public void onPlayEvent(int event, Bundle param) {
|
||||
float videoWidth = param.getInt("EVT_PARAM1", 0);
|
||||
float videoHeight = param.getInt("EVT_PARAM2", 0);
|
||||
Log.e("视频流有", "videoWidth:" + videoWidth + " videoHeight:" + videoHeight);
|
||||
if (mLiveBean.getLandscape() != 1){
|
||||
if (videoWidth > 720) {
|
||||
cardParams.height = DpUtil.dp2px(130);
|
||||
cardParams.width = DpUtil.dp2px(230);
|
||||
} else {
|
||||
cardParams.height = DpUtil.dp2px(224);
|
||||
cardParams.width = DpUtil.dp2px(126);
|
||||
}
|
||||
layout.setLayoutParams(cardParams);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNetStatus(Bundle bundle) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mPlayer = new V2TXLivePlayerImpl(mContext);
|
||||
mPlayer.setRenderView(videoView);
|
||||
mPlayer.startPlay(url);
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(view.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
mPlayer.stopPlay(true);
|
||||
mPlayer.stopPlay();
|
||||
EasyFloat.dismiss("LiveFloatView", true);
|
||||
if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) {
|
||||
HintDialog fragment = new HintDialog();
|
||||
@@ -258,7 +202,7 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(view, () -> {
|
||||
|
||||
mPlayer.stopPlay(true);
|
||||
mPlayer.stopPlay();
|
||||
new Handler().post(liveCheck);
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/layout"
|
||||
android:layout_width="230dp"
|
||||
android:layout_height="130dp"
|
||||
android:layout_marginStart="25dp"
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="AppTheme" parent="Base.Theme.NoActionBar">
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:colorBackground">@color/background</item>
|
||||
<item name="android:windowAnimationStyle">@style/Animation</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" >@color/colorPrimary</item>
|
||||
</style>
|
||||
|
||||
<style name="dialog" parent="AppTheme">
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
|
||||
@@ -4,15 +4,15 @@ ext {
|
||||
buildToolsVersion: "28.0.3",
|
||||
minSdkVersion : 21,
|
||||
targetSdkVersion : 31,
|
||||
versionCode : 302,
|
||||
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",
|
||||
@@ -25,8 +25,8 @@ ext {
|
||||
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
||||
|
||||
// true表示谷歌支付 false
|
||||
isGooglePlay : false,
|
||||
isGooglePlay : true,
|
||||
//是否上报异常日志
|
||||
isUploadLog : true
|
||||
isUploadLog : false
|
||||
]
|
||||
}
|
||||
@@ -32,6 +32,7 @@ import com.yunbao.common.event.FollowEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.KeyBoardHeightChangeListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.KeyBoardHeightUtil2;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.ProcessImageUtil;
|
||||
@@ -77,7 +78,6 @@ import com.yunbao.live.socket.SocketClient;
|
||||
import com.yunbao.live.socket.SocketMessageListener;
|
||||
import com.yunbao.live.socket.SocketRyChatUtil;
|
||||
import com.yunbao.live.socket.SocketRyClient;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
import com.yunbao.live.utils.LoadDian9TuUtil;
|
||||
import com.yunbao.live.utils.UnzipFromAssets;
|
||||
import com.yunbao.live.views.AbsLiveViewHolder;
|
||||
@@ -159,7 +159,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
EventBus.getDefault().register(this);
|
||||
mDialogFragmentSet = new HashSet<>();
|
||||
//解压 美颜模型
|
||||
/*try {
|
||||
try {
|
||||
CommonAppConfig.VIDEO_TIE_MODEl_PATH = getFilesDir().getAbsolutePath() + "/model";//app安装路径
|
||||
File model = new File(CommonAppConfig.VIDEO_TIE_MODEl_PATH);
|
||||
if (model.exists() && Objects.requireNonNull(model.listFiles()).length > 0) {
|
||||
@@ -169,7 +169,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.i("log", "beauty e=" + e);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -949,7 +949,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
}
|
||||
}
|
||||
int guardType = mLiveGuardInfo != null ? mLiveGuardInfo.getMyGuardType() : Constants.GUARD_TYPE_NONE;
|
||||
SocketRyChatUtil.sendChatMessage(mLiveUid, content, mIsAnchor, mSocketUserType, guardType, atUserID, atUserName);
|
||||
SocketRyChatUtil.sendChatMessage(mLiveUid, content, IMLoginManager.get(mContext).getUserInfo().anchorUserType(), mSocketUserType, guardType, atUserID, atUserName);
|
||||
|
||||
}
|
||||
|
||||
@@ -1522,12 +1522,9 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
mLiveContributeViewHolder = null;
|
||||
mLiveMedalRankViewHolder = null;
|
||||
mLiveLuckGiftTipViewHolder = null;
|
||||
// mMobShareUtil = null;
|
||||
mImageUtil = null;
|
||||
SVGAViewUtils.clearSVGA();
|
||||
LiveTextRender.clear();
|
||||
L.e("LiveActivity--------release------>");
|
||||
|
||||
Constants.isSend = "0";
|
||||
}
|
||||
|
||||
|
||||
@@ -657,7 +657,6 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
super.onResume();
|
||||
manager.onResume();
|
||||
GiftCacheUtil.getInstance().restart();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,8 +14,6 @@ import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_start_dr_pk_view;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -23,22 +21,21 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.lzy.okgo.callback.Callback;
|
||||
import com.lzy.okgo.model.Progress;
|
||||
import com.lzy.okgo.model.Response;
|
||||
import com.lzy.okgo.request.base.Request;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.tencent.trtc.TRTCCloudDef;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.NotCancelableDialog;
|
||||
import com.yunbao.common.event.LoginInvalidEvent;
|
||||
@@ -48,7 +45,6 @@ import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.http.JsonBean;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.BitmapUtil;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DateFormatUtil;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
@@ -59,9 +55,12 @@ import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.bean.LiveGuardInfo;
|
||||
import com.yunbao.live.bean.LiveKsyConfigBean;
|
||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||
import com.yunbao.live.bean.WishlistModel;
|
||||
import com.yunbao.live.dialog.LiveBeautyDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveLinkMicListDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveNewFunctionDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveNewWishListDialogFragment;
|
||||
@@ -72,6 +71,7 @@ import com.yunbao.live.http.LiveHttpConsts;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.interfaces.LiveFunctionClickListener;
|
||||
import com.yunbao.live.interfaces.LivePushListener;
|
||||
import com.yunbao.live.momo.BeautyManager;
|
||||
import com.yunbao.live.music.LiveMusicDialogFragment;
|
||||
import com.yunbao.live.presenter.LiveLinkMicAnchorPresenter;
|
||||
import com.yunbao.live.presenter.LiveLinkMicPresenter;
|
||||
@@ -94,7 +94,6 @@ import java.util.List;
|
||||
|
||||
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
|
||||
import cn.rongcloud.rtc.base.RCRTCRect;
|
||||
import cn.rongcloud.rtc.base.RTCErrorCode;
|
||||
import io.rong.imlib.IRongCallback;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
@@ -104,6 +103,7 @@ import io.rong.message.TextMessage;
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/10/7.
|
||||
* 主播直播间
|
||||
@@ -142,6 +142,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
public static int backIndex = 0;//0=未判断,1=已判断
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_live_anchor;
|
||||
@@ -229,6 +230,15 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
break;
|
||||
case Constants.LIVE_FUNC_MIC://語音
|
||||
ToastUtil.show("開發中,敬請期待");
|
||||
/* //连麦说是有问题,暂时隐藏
|
||||
LiveMicUserDialogFragment fragment = new LiveMicUserDialogFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putString(Constants.STREAM, mStream);
|
||||
bundle.putString("By", "1");
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveUserMoreDialogFragment");
|
||||
LiveMicUserDialogFragment.activity = ((LiveRyAnchorActivity) mContext);*/
|
||||
break;
|
||||
case Constants.LIVE_FUNC_DR://多人PK
|
||||
if (isDRPK != 1) {
|
||||
@@ -339,7 +349,60 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
openRedPackSendWindow();
|
||||
break;
|
||||
case Constants.LIVE_FUNC_ZSLK://暫時離開
|
||||
leaveLive();
|
||||
if (leave == 0) {
|
||||
leave = 1;
|
||||
mLivePushViewHolder.leave.setVisibility(View.VISIBLE);
|
||||
sendSystemMessage(WordUtil.getString(R.string.live_anchor_leave));
|
||||
} else {
|
||||
leave = 0;
|
||||
mLivePushViewHolder.leave.setVisibility(View.GONE);
|
||||
sendSystemMessage(WordUtil.getString(R.string.live_anchor_come_back));
|
||||
}
|
||||
HttpClient.getInstance().get("Live.isLeave", "Live.isLeave")
|
||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||
.params("isleave", leave)
|
||||
.params("token", CommonAppConfig.getInstance().getToken())
|
||||
.execute(new Callback<JsonBean>() {
|
||||
@Override
|
||||
public void onStart(Request<JsonBean, ? extends Request> request) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(Response<JsonBean> response) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCacheSuccess(Response<JsonBean> response) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Response<JsonBean> response) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadProgress(Progress progress) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadProgress(Progress progress) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonBean convertResponse(okhttp3.Response response) throws Throwable {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case Constants.LIVE_FUNC_WKS:
|
||||
String url = CommonAppConfig.HOST + "/h5/activity/weekStar/index.html?&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
|
||||
@@ -371,45 +434,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 主播展示离开直播间
|
||||
*/
|
||||
private void leaveLive() {
|
||||
RCRTCRect rect = new RCRTCRect(0f, 0f, 1.0f);
|
||||
if (leave == 0) {
|
||||
leave = 1;
|
||||
Glide.with(mContext).asBitmap().load(R.mipmap.zslk).into(new CustomTarget<Bitmap>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
|
||||
|
||||
boolean ret = RCRTCEngine.getInstance().getDefaultVideoStream().setWatermark(BitmapUtil.getInstance().convertMirror(resource), rect);
|
||||
sendSystemMessage(WordUtil.getString(R.string.live_anchor_leave));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadCleared(@Nullable Drawable placeholder) {
|
||||
|
||||
}
|
||||
});
|
||||
} else if (leave == 1) {
|
||||
leave = 0;
|
||||
// 清除水印
|
||||
boolean ret = RCRTCEngine.getInstance().getDefaultVideoStream().setWatermark(null, rect);
|
||||
sendSystemMessage(WordUtil.getString(R.string.live_anchor_come_back));
|
||||
}
|
||||
|
||||
HttpClient.getInstance().get("Live.isLeave", "Live.isLeave")
|
||||
.params("uid", CommonAppConfig.getInstance().getUid())
|
||||
.params("isleave", leave)
|
||||
.params("token", CommonAppConfig.getInstance().getToken())
|
||||
.execute(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 打开心愿单窗口
|
||||
@@ -457,6 +481,9 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
if(mLiveRoomViewHolder!=null){
|
||||
mLiveRoomViewHolder.changeFaceUnityView();
|
||||
}
|
||||
/* LiveBeautyDialogFragment fragment = new LiveBeautyDialogFragment();
|
||||
fragment.setiBeautyModule(BeautyManager.iBeautyModule, BeautyManager.iLookupModule, BeautyManager.iBeautyBodyModule);
|
||||
fragment.show(getSupportFragmentManager(), "LiveBeautyDialogFragment");*/
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -464,6 +491,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
*/
|
||||
public void light() {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
// mLiveRoomViewHolder.playLightAnim();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1241,7 +1269,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
L.e(TAG, content);
|
||||
LogUtil.print(mLogFile, content);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onOpenDrawer(LiveAudienceEvent event) {
|
||||
Bundle bundle = new Bundle();
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -21,21 +22,19 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.HtmlConfig;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.dialog.LiveUserDialogFragment;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
@@ -169,6 +168,7 @@ public class WebViewActivityMedal extends AbsActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private LiveRoomCheckLivePresenter mCheckLivePresenter;
|
||||
|
||||
private void gotoLive(final String live_id) {
|
||||
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
|
||||
@@ -177,10 +177,22 @@ public class WebViewActivityMedal extends AbsActivity {
|
||||
if (code == 0 && info.length > 0) {
|
||||
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
|
||||
|
||||
LiveAudienceActivity.forward(mContext, liveBean, 0, 0, "", 0, 0);
|
||||
} else {
|
||||
if (mCheckLivePresenter == null) {
|
||||
mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() {
|
||||
@Override
|
||||
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
|
||||
if (liveBean == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
RouteUtil.forwardUserHome(mContext, String.valueOf(live_id), 0);
|
||||
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
mCheckLivePresenter.checkLive(liveBean);
|
||||
} else {
|
||||
RouteUtil.forwardUserHome(mContext, live_id,0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -333,23 +333,23 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
||||
} else if (bean.getType() == RECOMMEND_CARD_NOTIFY) {
|
||||
//加载.9图聊天气泡
|
||||
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getBubble(), 1);
|
||||
LiveTextRender.recommendCardNotify(mContext, mTextView, bean);
|
||||
new LiveTextRender().recommendCardNotify(mContext, mTextView, bean);
|
||||
} else if (bean.getType() == AI_AUTOMATIC_SPEECH) {
|
||||
//加载.9图聊天气泡
|
||||
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getAiAutomaticSpeechModel().getSystemBubble(), 1);
|
||||
LiveTextRender.aiAutomaticSpeech(mContext, mTextView, bean.getAiAutomaticSpeechModel());
|
||||
new LiveTextRender().aiAutomaticSpeech(mContext, mTextView, bean.getAiAutomaticSpeechModel());
|
||||
} else if (bean.getType() == STAR_CHALLENGE_UPGRADE_NOTIFY) {
|
||||
//加载.9图聊天气泡
|
||||
if (!TextUtils.isEmpty(bean.getMsgModel().getSystemBubble())) {
|
||||
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getMsgModel().getSystemBubble(), 1);
|
||||
LiveTextRender.starChallengeUpgradeNotify(mContext, mTextView, bean.getMsgModel());
|
||||
new LiveTextRender().starChallengeUpgradeNotify(mContext, mTextView, bean.getMsgModel());
|
||||
}
|
||||
} else if (bean.getType() == LUCKY_ANGEL) {
|
||||
if (!TextUtils.isEmpty(bean.getMsgModel().getSystem_bubble())) {
|
||||
bean.setId(bean.getMsgModel().getUserId());
|
||||
itemView.setTag(bean);
|
||||
LoadDian9TuUtil.loadDian9Tu(mContext, mBg, bean.getMsgModel().getSystem_bubble(), 1);
|
||||
LiveTextRender.luckyAngel(mContext, mTextView, bean.getMsgModel());
|
||||
new LiveTextRender().luckyAngel(mContext, mTextView, bean.getMsgModel());
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -365,7 +365,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
||||
mTextView.setTextColor(0xffffffff);
|
||||
}
|
||||
|
||||
LiveTextRender.render(mContext, mTextView, bean);
|
||||
new LiveTextRender().render(mContext, mTextView, bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.bean.LiveUserGiftBean;
|
||||
import com.yunbao.live.dialog.LiveUserMoreDialogFragment;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
@@ -279,7 +280,18 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
|
||||
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
if (bean.isHide() && (type.equals("5") || type.equals("4"))) {
|
||||
mName.setText(R.string.mystery_man);
|
||||
|
||||
@@ -148,7 +148,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
params.height = DpUtil.dp2px(355);
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.gravity = Gravity.BOTTOM;
|
||||
window.setAttributes(params);
|
||||
}
|
||||
@@ -503,11 +503,11 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
} else if (i == R.id.btn_choose) {
|
||||
showGiftCount();
|
||||
} else if (i == R.id.coin) {
|
||||
forwardMyCoin(0);
|
||||
forwardMyCoin();
|
||||
} else if (i == R.id.goldCoin) {
|
||||
forwardMyCoin(2);
|
||||
forwardMyCoin();
|
||||
} else if (i == R.id.go_charge) {
|
||||
forwardMyCoin(0);
|
||||
forwardMyCoin();
|
||||
} else if (i == R.id.btn_luck_gift_tip) {
|
||||
dismiss();
|
||||
((LiveActivity) mContext).openLuckGiftTip();
|
||||
@@ -556,10 +556,10 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
/**
|
||||
* 跳转到我的钻石
|
||||
*/
|
||||
private void forwardMyCoin(int page) {
|
||||
private void forwardMyCoin() {
|
||||
dismiss();
|
||||
//我们的
|
||||
ARouter.getInstance().build(PATH_COIN).withInt("p", page).navigation();
|
||||
ARouter.getInstance().build(PATH_COIN).withInt("p", 1).navigation();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -709,7 +709,6 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
|
||||
|
||||
/**
|
||||
* 收到礼物下载完成的通知
|
||||
*
|
||||
* @param status
|
||||
*/
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
|
||||
@@ -460,10 +460,10 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
mLevelAnchorText.setText(String.valueOf(levelAnchor));
|
||||
mLevelText.setText(String.valueOf(level));
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(obj.getIntValue("sex")));
|
||||
mFollow.setText(LiveTextRender.renderLiveUserDialogData(obj.getLongValue("follows")));
|
||||
mFans.setText(LiveTextRender.renderLiveUserDialogData(obj.getLongValue("fans")));
|
||||
mConsume.setText(LiveTextRender.renderLiveUserDialogData(obj.getLongValue("consumption")));
|
||||
mVotes.setText(LiveTextRender.renderLiveUserDialogData(obj.getLongValue("votestotal")));
|
||||
mFollow.setText(new LiveTextRender().renderLiveUserDialogData(obj.getLongValue("follows")));
|
||||
mFans.setText(new LiveTextRender().renderLiveUserDialogData(obj.getLongValue("fans")));
|
||||
mConsume.setText(new LiveTextRender().renderLiveUserDialogData(obj.getLongValue("consumption")));
|
||||
mVotes.setText(new LiveTextRender().renderLiveUserDialogData(obj.getLongValue("votestotal")));
|
||||
mConsumeTip.setText(WordUtil.getString(R.string.live_user_send) + appConfig.getCoinName());
|
||||
mVotesTip.setText(WordUtil.getString(R.string.live_user_get) + appConfig.getVotesName());
|
||||
if (mType == TYPE_AUD_ANC) {
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.iflytek.cloud.SpeechConstant;
|
||||
import com.iflytek.cloud.SpeechError;
|
||||
import com.iflytek.cloud.SpeechRecognizer;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.utils.WordsTypeUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
|
||||
@@ -131,7 +130,6 @@ public class VoiceDialog extends AbsDialogFragment {
|
||||
* 上划取消
|
||||
*/
|
||||
public void withdraw() {
|
||||
mIat.stopListening();
|
||||
if (!isDetached()) {
|
||||
voiceFluctuations.setVisibility(View.GONE);
|
||||
gifView.setVisibility(View.GONE);
|
||||
@@ -145,7 +143,6 @@ public class VoiceDialog extends AbsDialogFragment {
|
||||
* 上划取消
|
||||
*/
|
||||
public void notWithdraw() {
|
||||
startRecognize();
|
||||
if (!isDetached()) {
|
||||
if (TextUtils.isEmpty(sendMessage())) {
|
||||
if (gifView.getVisibility() != View.VISIBLE)
|
||||
@@ -287,8 +284,7 @@ public class VoiceDialog extends AbsDialogFragment {
|
||||
endOfSpeech();
|
||||
}
|
||||
builder.append(text);
|
||||
|
||||
voiceChat.setText(WordsTypeUtil.changeTraditional(builder.toString()));
|
||||
voiceChat.setText(builder);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ public class LiveEnterRoomAnimPresenter {
|
||||
if (u.getVipType() != 0 || liveChatBean.getGuardType() != Constants.GUARD_TYPE_NONE) {
|
||||
needAnim = true;
|
||||
ImgLoader.displayAvatar(mContext, bean.getUserBean().getAvatar(), mAvatar);
|
||||
LiveTextRender.renderEnterRoom(mContext, mName, liveChatBean);
|
||||
new LiveTextRender().renderEnterRoom(mContext, mName, liveChatBean);
|
||||
mBgAnimator1.start();
|
||||
mUserAnimator1.start();
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener {
|
||||
private String mPkUid;//正在连麦的对方主播的uid
|
||||
private TextView mLinkMicWaitText;
|
||||
private int mLinkMicWaitCount;//连麦弹窗等待倒计时
|
||||
private static final int LINK_MIC_COUNT_MAX = 10;
|
||||
private final int LINK_MIC_COUNT_MAX = 10;
|
||||
private String mLinkMicWaitString;
|
||||
private PopupWindow mLinkMicPopWindow;
|
||||
private Handler mHandler;
|
||||
@@ -326,23 +326,10 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener {
|
||||
}
|
||||
if (mLiveSdk == Constants.LIVE_SDK_TX) {
|
||||
mLiveLinkMicPlayViewHolder = new LiveLinkMicPlayTxViewHolder(mContext, mRightContainer);
|
||||
} else {
|
||||
// mLiveLinkMicPlayViewHolder = new LiveLinkMicPlayKsyViewHolder(mContext, mRightContainer);
|
||||
}
|
||||
mLiveLinkMicPlayViewHolder.setOnCloseListener(mIsAnchor ? this : null);
|
||||
mLiveLinkMicPlayViewHolder.addToParent();
|
||||
mLiveLinkMicPlayViewHolder.play(playUrl);
|
||||
// if (mIsAnchor){
|
||||
// try {
|
||||
// int index=playUrl.indexOf("?");
|
||||
// String subUrl= playUrl.substring(0,index);
|
||||
// Log.d("subUrl",playUrl+" "+subUrl);
|
||||
// mLiveLinkMicPlayViewHolder.play(subUrl);
|
||||
// }catch (Exception e){e.printStackTrace();}
|
||||
// }else {
|
||||
// mLiveLinkMicPlayViewHolder.play(playUrl);
|
||||
// }
|
||||
|
||||
if (mIsAnchor) {
|
||||
ToastUtil.show(R.string.link_mic_anchor_accept_2);
|
||||
((LiveAnchorActivity) mContext).setPkBtnVisible(true);
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.BannerBean;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
@@ -58,7 +57,6 @@ import com.yunbao.live.interfaces.ILiveLinkMicViewHolder;
|
||||
import com.yunbao.live.interfaces.LivePushListener;
|
||||
import com.yunbao.live.socket.SocketClient;
|
||||
import com.yunbao.live.socket.SocketLinkMicUtil;
|
||||
import com.yunbao.live.utils.CountDownView;
|
||||
import com.yunbao.live.views.AbsLiveLinkMicPlayViewHolder;
|
||||
import com.yunbao.live.views.AbsLiveLinkMicPushViewHolder;
|
||||
import com.yunbao.live.views.LiveLinkMicPlayTxViewHolder;
|
||||
@@ -95,7 +93,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
private boolean mAcceptLinkMic;//是否接受连麦
|
||||
private String mLinkMicWaitString;
|
||||
private int mLinkMicWaitCount;//连麦弹窗等待倒计时
|
||||
private static final int LINK_MIC_COUNT_MAX = 10;
|
||||
private final int LINK_MIC_COUNT_MAX = 10;
|
||||
private PopupWindow mLinkMicPopWindow;
|
||||
private Handler mHandler;
|
||||
private AbsLiveLinkMicPlayViewHolder mLiveLinkMicPlayViewHolder;//连麦播放小窗口
|
||||
@@ -113,9 +111,6 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
private List<BannerBean> mBannerList3 = new ArrayList<>();
|
||||
|
||||
|
||||
public static CountDownView date;
|
||||
|
||||
public static String link = "";
|
||||
String gold, experience;
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@@ -225,7 +220,6 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public LiveLinkMicPresenter(Context context, ILiveLinkMicViewHolder linkMicViewHolder, boolean isAnchor, int liveSdk, View root) {
|
||||
mContext = context;
|
||||
EventBus.getDefault().register(this);
|
||||
@@ -244,7 +238,6 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
btnTurnTable.setOnClickListener(this);
|
||||
|
||||
|
||||
|
||||
//周星
|
||||
BannerBean bannerBean = new BannerBean();
|
||||
bannerBean.setImageUrl("https://downs.yaoulive.com/img/BTN_WEEKSTAR%20%281%29.png");
|
||||
@@ -252,8 +245,6 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
mBannerList1.add(bannerBean);
|
||||
|
||||
|
||||
|
||||
|
||||
btn_onecz_event = root.findViewById(R.id.btn_onecz_event);
|
||||
btn_onecz_event.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -625,7 +616,6 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
}
|
||||
|
||||
|
||||
|
||||
//获取活动
|
||||
private void getEvent() {
|
||||
if (btn_onecz_event != null) {
|
||||
|
||||
@@ -525,7 +525,6 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
//1. 设置自适应合流布局模式
|
||||
config.setLayoutMode(RCRTCMixConfig.MixLayoutMode.ADAPTIVE);
|
||||
//2. 合流画布设置
|
||||
if(rcrtcLiveInfo!=null) {
|
||||
rcrtcLiveInfo.setMixConfig(config, new IRCRTCResultCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
@@ -538,9 +537,6 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
Log.w("PkDebug", "PK合流失败,rcrtcLiveInfo为空" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.yunbao.live.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -20,16 +22,23 @@ import android.view.View.MeasureSpec;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.AiAutomaticSpeechModel;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.MsgModel;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.custom.VerticalImageSpan;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
@@ -37,27 +46,36 @@ import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LiveChatBean;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
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.
|
||||
*/
|
||||
|
||||
public class LiveTextRender {
|
||||
|
||||
private static StyleSpan sBoldSpan;
|
||||
private static StyleSpan sNormalSpan;
|
||||
private static ForegroundColorSpan sWhiteColorSpan;
|
||||
private static ForegroundColorSpan sGlobalColorSpan;
|
||||
private static AbsoluteSizeSpan sFontSizeSpan;
|
||||
private static AbsoluteSizeSpan sFontSizeSpan2;
|
||||
private static AbsoluteSizeSpan sFontSizeSpan3;
|
||||
private static final Map<LiveChatBean, Drawable> mDrawableMedalMap = new HashMap<>();
|
||||
private static final Map<LiveChatBean, Drawable> gzDrawablesMap = new HashMap<>();
|
||||
private static final Map<LiveChatBean, Drawable> ryxzDrawablesMap = new HashMap<>();
|
||||
private static final Map<LiveChatBean, Drawable> nhDrawablesMap = new HashMap<>();
|
||||
private StyleSpan sBoldSpan;
|
||||
private StyleSpan sNormalSpan;
|
||||
private ForegroundColorSpan sWhiteColorSpan;
|
||||
private ForegroundColorSpan sGlobalColorSpan;
|
||||
private AbsoluteSizeSpan sFontSizeSpan;
|
||||
private AbsoluteSizeSpan sFontSizeSpan2;
|
||||
private AbsoluteSizeSpan sFontSizeSpan3;
|
||||
private final Map<LiveChatBean, Drawable> mDrawableMedalMap = new HashMap<>();
|
||||
private final Map<LiveChatBean, Drawable> gzDrawablesMap = new HashMap<>();
|
||||
private final Map<LiveChatBean, Drawable> ryxzDrawablesMap = new HashMap<>();
|
||||
private final Map<LiveChatBean, Drawable> nhDrawablesMap = new HashMap<>();
|
||||
|
||||
static {
|
||||
public LiveTextRender() {
|
||||
sBoldSpan = new StyleSpan(Typeface.BOLD);
|
||||
sNormalSpan = new StyleSpan(Typeface.NORMAL);
|
||||
sWhiteColorSpan = new ForegroundColorSpan(0xffffffff);
|
||||
@@ -73,7 +91,7 @@ public class LiveTextRender {
|
||||
* @param textView
|
||||
* @param bean
|
||||
*/
|
||||
public static void recommendCardNotify(Context context, TextView textView, LiveChatBean bean) {
|
||||
public void recommendCardNotify(Context context, TextView textView, LiveChatBean bean) {
|
||||
String recommend;
|
||||
Drawable drawable;
|
||||
if (TextUtils.equals(bean.getMsgModel().getRecommendCardType(), "1")) {
|
||||
@@ -107,7 +125,7 @@ public class LiveTextRender {
|
||||
* @param textView
|
||||
* @param model
|
||||
*/
|
||||
public static void starChallengeUpgradeNotify(Context activity, TextView textView, MsgModel model) {
|
||||
public void starChallengeUpgradeNotify(Context activity, TextView textView, MsgModel model) {
|
||||
String star = activity.getString(R.string.star);
|
||||
String starString = String.format(activity.getString(R.string.star_success), model.getAncherName(), model.getCompetitionArea(), model.getStar());
|
||||
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
|
||||
@@ -126,7 +144,7 @@ public class LiveTextRender {
|
||||
/**
|
||||
* 幸运天使
|
||||
*/
|
||||
public static void luckyAngel(Context mContext, TextView mTextView, MsgModel msgModel) {
|
||||
public void luckyAngel(Context mContext, TextView mTextView, MsgModel msgModel) {
|
||||
String msg = mContext.getString(R.string.lucky_angel);
|
||||
msg = String.format(msg, msgModel.getUserName(), msgModel.getGiftName());
|
||||
int unameIndexOf = msg.indexOf(msgModel.getUserName());
|
||||
@@ -140,7 +158,7 @@ public class LiveTextRender {
|
||||
mTextView.setText(builder);
|
||||
}
|
||||
|
||||
public static void aiAutomaticSpeech(Context activity, TextView textView, AiAutomaticSpeechModel model) {
|
||||
public void aiAutomaticSpeech(Context activity, TextView textView, AiAutomaticSpeechModel model) {
|
||||
ImgLoader.displayDrawable(activity, model.getIcon(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
@@ -207,13 +225,13 @@ public class LiveTextRender {
|
||||
/**
|
||||
* 生成前缀
|
||||
*/
|
||||
private static SpannableStringBuilder createPrefix(Drawable levelDrawable, LiveChatBean bean) {
|
||||
private SpannableStringBuilder createPrefix(Drawable levelDrawable, LiveChatBean bean) {
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||
int index = 0;
|
||||
|
||||
if (levelDrawable != null) {
|
||||
builder.append(" ");
|
||||
levelDrawable.setBounds(0, 0, DpUtil.dp2px(28), DpUtil.dp2px(14));
|
||||
levelDrawable.setBounds(0, 0, DpUtil.dp2px(32), DpUtil.dp2px(14));
|
||||
builder.setSpan(new VerticalImageSpan(levelDrawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
index += 2;
|
||||
}
|
||||
@@ -263,8 +281,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(50), DpUtil.dp2px(20));//切图为138*38
|
||||
drawable.setBounds(0, 0, DpUtil.dp2px(44), DpUtil.dp2px(17));
|
||||
builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
index += 2;
|
||||
}
|
||||
@@ -296,22 +313,20 @@ public class LiveTextRender {
|
||||
return builder;
|
||||
}
|
||||
|
||||
private static Drawable getMedalImage(final LiveChatBean bean) {
|
||||
private Drawable getMedalImage(final LiveChatBean bean) {
|
||||
View view = LayoutInflater.from(CommonAppContext.sInstance).inflate(R.layout.live_medal_icon, null, false);
|
||||
final ImageView iv = view.findViewById(R.id.ivIcon);
|
||||
if (mDrawableMedalMap.containsKey(bean))
|
||||
iv.setImageDrawable(mDrawableMedalMap.get(bean));
|
||||
TextView tv = view.findViewById(R.id.tvName);
|
||||
tv.setText(bean.getMedalNmae());
|
||||
//字体加粗
|
||||
// tv.setTextSize(TypedValue.COMPLEX_UNIT_SP,13);
|
||||
tv.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
Bitmap bitmap = convertViewToBitmap(view);
|
||||
Drawable drawable = new BitmapDrawable(bitmap);
|
||||
return drawable;
|
||||
}
|
||||
|
||||
public static Bitmap convertViewToBitmap(View view) {
|
||||
public Bitmap convertViewToBitmap(View view) {
|
||||
view.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
|
||||
view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredWidth() / 3);
|
||||
// 153 72
|
||||
@@ -321,7 +336,7 @@ public class LiveTextRender {
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
public static void render(final Context context, final TextView textView, final LiveChatBean bean) {
|
||||
public void render(final Context context, final TextView textView, final LiveChatBean bean) {
|
||||
ImgLoader.displayDrawable(context, bean.getMedalLevelImageUrl(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
@@ -337,7 +352,7 @@ public class LiveTextRender {
|
||||
}
|
||||
|
||||
|
||||
public static void ryxz(final Context context, final TextView textView, final LiveChatBean bean) {
|
||||
public void ryxz(final Context context, final TextView textView, final LiveChatBean bean) {
|
||||
ImgLoader.displayDrawable(context, bean.getMedal_honor(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
@@ -352,7 +367,7 @@ public class LiveTextRender {
|
||||
});
|
||||
}
|
||||
|
||||
public static void nh(final Context context, final TextView textView, final LiveChatBean bean) {
|
||||
public void nh(final Context context, final TextView textView, final LiveChatBean bean) {
|
||||
if (bean.getGood_nub() != null && !bean.getGood_nub().equals("")) {
|
||||
nhDrawablesMap.put(bean, ContextCompat.getDrawable(CommonAppContext.sInstance, R.mipmap.good_nub));
|
||||
renderTMP(context, textView, bean);
|
||||
@@ -361,7 +376,7 @@ public class LiveTextRender {
|
||||
}
|
||||
}
|
||||
|
||||
public static void gz(final Context context, final TextView textView, final LiveChatBean bean) {
|
||||
public void gz(final Context context, final TextView textView, final LiveChatBean bean) {
|
||||
ImgLoader.displayDrawable(context, TextUtils.isEmpty(bean.getMedal_new()) ? bean.getMedal() : bean.getMedal_new(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
@@ -376,7 +391,71 @@ public class LiveTextRender {
|
||||
});
|
||||
}
|
||||
|
||||
private static void renderTMP(Context context, final TextView textView, final LiveChatBean bean) {
|
||||
private ImgLoader.DrawableCallback mCallback;
|
||||
|
||||
/**
|
||||
* 等级设置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public void getLevelImage(Context mContext, int userLevel, ImgLoader.DrawableCallback callback) {
|
||||
mCallback = callback;
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewLevelModels();
|
||||
String imgUrl = "https://downs.yaoulive.com/level/user_lv1_bg.png";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= userLevel && userLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getThumb();
|
||||
}
|
||||
}
|
||||
|
||||
Glide.with(mContext).asBitmap().load(imgUrl).into(new CustomTarget<Bitmap>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
|
||||
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
|
||||
public void onLoadCleared(@Nullable Drawable placeholder) {
|
||||
if (callback != null) {
|
||||
callback.onLoadFailed();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void renderTMP(Context context, final TextView textView, final LiveChatBean bean) {
|
||||
final LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
|
||||
if (levelBean == null) {
|
||||
@@ -395,10 +474,10 @@ public class LiveTextRender {
|
||||
textView.setText(builder);
|
||||
}
|
||||
} else {
|
||||
ImgLoader.displayDrawable(context, levelBean.getThumb(), new ImgLoader.DrawableCallback() {
|
||||
if (textView != null) {
|
||||
getLevelImage(context, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
if (textView != null) {
|
||||
SpannableStringBuilder builder = createPrefix(drawable, bean);
|
||||
int color = 0;
|
||||
if (bean.isAnchor()) {
|
||||
@@ -420,17 +499,19 @@ public class LiveTextRender {
|
||||
}
|
||||
textView.setText(builder);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
if (textView != null) {
|
||||
SpannableStringBuilder builder = createPrefix(null, bean);
|
||||
int color = 0;
|
||||
if (bean.isAnchor()) {
|
||||
color = 0xffffdd00;
|
||||
} else {
|
||||
try {
|
||||
color = Color.parseColor(levelBean.getColor());
|
||||
} catch (Exception e) {
|
||||
color = Color.parseColor("#ffffff");
|
||||
}
|
||||
}
|
||||
switch (bean.getType()) {
|
||||
case LiveChatBean.GIFT:
|
||||
@@ -442,17 +523,43 @@ public class LiveTextRender {
|
||||
}
|
||||
textView.setText(builder);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* bitmap添加文字
|
||||
*
|
||||
* @param mBitmap
|
||||
* @return
|
||||
*/
|
||||
private Bitmap AddTimeWatermark(Bitmap mBitmap, String level) {
|
||||
//获取原始图片与水印图片的宽与高
|
||||
int mBitmapWidth = mBitmap.getWidth();
|
||||
int mBitmapHeight = mBitmap.getHeight();
|
||||
Bitmap mNewBitmap = Bitmap.createBitmap(mBitmapWidth, mBitmapHeight, Bitmap.Config.ARGB_8888);
|
||||
Canvas mCanvas = new Canvas(mNewBitmap);
|
||||
//向位图中开始画入MBitmap原始图片
|
||||
mCanvas.drawBitmap(mBitmap, 0, 0, null);
|
||||
//添加文字
|
||||
Paint mPaint = new Paint();
|
||||
Typeface font = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD);
|
||||
mPaint.setColor(Color.WHITE);
|
||||
mPaint.setTextSize(50);
|
||||
mPaint.setTypeface(font);
|
||||
//水印的位置坐标
|
||||
mCanvas.drawText(level, 80, 53, mPaint);
|
||||
mCanvas.save();
|
||||
mCanvas.restore();
|
||||
return mNewBitmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染普通聊天消息
|
||||
*/
|
||||
private static SpannableStringBuilder renderChat(int color, SpannableStringBuilder builder, LiveChatBean bean) {
|
||||
private SpannableStringBuilder renderChat(int color, SpannableStringBuilder builder, LiveChatBean bean) {
|
||||
int length = builder.length();
|
||||
String name = bean.getUserNiceName();
|
||||
if (bean.getType() != LiveChatBean.ENTER_ROOM) {//产品规定,进场消息不允许加冒号
|
||||
@@ -487,7 +594,7 @@ public class LiveTextRender {
|
||||
/**
|
||||
* 渲染送礼物消息
|
||||
*/
|
||||
private static SpannableStringBuilder renderGift(int color, SpannableStringBuilder builder, LiveChatBean bean) {
|
||||
private SpannableStringBuilder renderGift(int color, SpannableStringBuilder builder, LiveChatBean bean) {
|
||||
int length = builder.length();
|
||||
String name = bean.getUserNiceName() + ":";
|
||||
builder.append(name);
|
||||
@@ -503,7 +610,7 @@ public class LiveTextRender {
|
||||
/**
|
||||
* 渲染用户进入房间消息
|
||||
*/
|
||||
public static void renderEnterRoom(final Context context, final TextView textView, final LiveChatBean bean) {
|
||||
public void renderEnterRoom(final Context context, final TextView textView, final LiveChatBean bean) {
|
||||
ImgLoader.displayDrawable(context, bean.getMedalLevelImageUrl(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
@@ -519,7 +626,7 @@ public class LiveTextRender {
|
||||
|
||||
}
|
||||
|
||||
private static void renderEnterRoomTMP(Context context, final TextView textView, final LiveChatBean bean) {
|
||||
private void renderEnterRoomTMP(Context context, final TextView textView, final LiveChatBean bean) {
|
||||
final LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean == null) {
|
||||
return;
|
||||
@@ -532,10 +639,6 @@ public class LiveTextRender {
|
||||
int start = builder.length();
|
||||
String name = bean.getUserNiceName() + " ";
|
||||
builder.append(name);
|
||||
//int end = start + name.length();
|
||||
//builder.setSpan(sWhiteColorSpan, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
//builder.setSpan(sFontSizeSpan, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
//builder.setSpan(sBoldSpan, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
builder.append(bean.getContent());
|
||||
textView.setText(builder);
|
||||
}
|
||||
@@ -548,11 +651,6 @@ public class LiveTextRender {
|
||||
int start = builder.length();
|
||||
String name = bean.getUserNiceName() + " ";
|
||||
builder.append(name);
|
||||
// int end = start + name.length();
|
||||
// builder.setSpan(sWhiteColorSpan, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
// builder.setSpan(sFontSizeSpan, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
// builder.setSpan(sBoldSpan, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
// builder.append(bean.getContent());
|
||||
textView.setText(builder);
|
||||
}
|
||||
}
|
||||
@@ -561,7 +659,7 @@ public class LiveTextRender {
|
||||
}
|
||||
|
||||
|
||||
public static SpannableStringBuilder renderGiftInfo2(String giftName) {
|
||||
public SpannableStringBuilder renderGiftInfo2(String giftName) {
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||
String s1 = WordUtil.getString(R.string.live_send_gift_1);
|
||||
String content = s1 + " " + giftName;
|
||||
@@ -571,7 +669,7 @@ public class LiveTextRender {
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static SpannableStringBuilder renderGiftInfo(int giftCount, String giftName) {
|
||||
public SpannableStringBuilder renderGiftInfo(int giftCount, String giftName) {
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||
String s1 = WordUtil.getString(R.string.live_send_gift_1);
|
||||
String s2 = WordUtil.getString(R.string.live_send_gift_2) + giftName;
|
||||
@@ -585,7 +683,7 @@ public class LiveTextRender {
|
||||
}
|
||||
|
||||
|
||||
public static SpannableStringBuilder renderGiftCount(int count) {
|
||||
public SpannableStringBuilder renderGiftCount(int count) {
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||
String s = String.valueOf(count);
|
||||
builder.append(s);
|
||||
@@ -606,7 +704,7 @@ public class LiveTextRender {
|
||||
/**
|
||||
* 渲染直播间用户弹窗数据
|
||||
*/
|
||||
public static CharSequence renderLiveUserDialogData(long num) {
|
||||
public CharSequence renderLiveUserDialogData(long num) {
|
||||
if (num < 10000) {
|
||||
return String.valueOf(num);
|
||||
}
|
||||
@@ -622,7 +720,7 @@ public class LiveTextRender {
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
public void clear() {
|
||||
mDrawableMedalMap.clear();
|
||||
gzDrawablesMap.clear();
|
||||
ryxzDrawablesMap.clear();
|
||||
|
||||
@@ -389,11 +389,11 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
||||
}
|
||||
};
|
||||
|
||||
public static Handler handler = new Handler();
|
||||
public static Runnable runnable;
|
||||
public Handler handler = new Handler();
|
||||
public Runnable runnable;
|
||||
|
||||
public static Handler handler1 = new Handler();
|
||||
public static Runnable runnable1;
|
||||
public Handler handler1 = new Handler();
|
||||
public Runnable runnable1;
|
||||
|
||||
|
||||
public void removeCallbacks() {
|
||||
|
||||
@@ -83,7 +83,7 @@ public class LiveGiftViewHolder extends AbsViewHolder {
|
||||
}
|
||||
if (mGiftCount != null && mGiftCount.getVisibility() != View.VISIBLE) {
|
||||
mGiftCount.setVisibility(View.VISIBLE);
|
||||
mGiftCount.setText(LiveTextRender.renderGiftCount(mLianCount));
|
||||
mGiftCount.setText(new LiveTextRender().renderGiftCount(mLianCount));
|
||||
}
|
||||
if (mGiftCount != null) {
|
||||
mGiftCount.clearAnimation();
|
||||
@@ -152,7 +152,7 @@ public class LiveGiftViewHolder extends AbsViewHolder {
|
||||
}
|
||||
if (TextUtils.isEmpty(mLastGiftKey) || !mLastGiftKey.equals(bean.getKey())) {
|
||||
ImgLoader.display(mContext, bean.getGiftIcon(), mGiftIcon);
|
||||
mContent.setText(LiveTextRender.renderGiftInfo2(bean.getGiftName()));
|
||||
mContent.setText(new LiveTextRender().renderGiftInfo2(bean.getGiftName()));
|
||||
if (bean.getGiftCount() > 1) {
|
||||
mGiftGroupCount.setText("x" + bean.getGiftCount());
|
||||
mMulSign.setText(R.string.live_gift_send_lian_3);
|
||||
@@ -174,7 +174,7 @@ public class LiveGiftViewHolder extends AbsViewHolder {
|
||||
mLianCount = bean.getLianCount();
|
||||
}
|
||||
if (mGiftCount != null && mGiftCount.getVisibility() == View.VISIBLE) {
|
||||
mGiftCount.setText(LiveTextRender.renderGiftCount(mLianCount));
|
||||
mGiftCount.setText(new LiveTextRender().renderGiftCount(mLianCount));
|
||||
}
|
||||
mLastGiftKey = bean.getKey();
|
||||
if (lian && mGiftCount != null && mAnimation != null) {
|
||||
|
||||
@@ -1127,7 +1127,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
htmlUrl.append(CommonAppConfig.HOST)
|
||||
.append("/")
|
||||
.append(bean.getModel().getActivityUrl())
|
||||
.append(bean.getModel().getActivityUrl().contains("?") ? "&nickname=" : "?nickname=")
|
||||
.append("&nickname=")
|
||||
.append(userInfo.getUserNicename())
|
||||
.append("&token=")
|
||||
.append(userInfo.getToken())
|
||||
@@ -1186,7 +1186,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
htmlUrl.append(CommonAppConfig.HOST)
|
||||
.append("/")
|
||||
.append(bean.getModel().getActivityUrl())
|
||||
.append(bean.getModel().getActivityUrl().contains("?") ? "&nickname=" : "?nickname=")
|
||||
.append("&nickname=")
|
||||
.append(userInfo.getUserNicename())
|
||||
.append("&token=")
|
||||
.append(userInfo.getToken())
|
||||
|
||||
@@ -10,7 +10,6 @@ import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
@@ -96,12 +96,9 @@ public class LuckLiveGiftViewHolder extends AbsViewHolder {
|
||||
if (mBg != null) {
|
||||
mBg.setTranslationX(-mDp214);
|
||||
}
|
||||
// if (mStar != null && mStar.getVisibility() == View.VISIBLE) {
|
||||
// mStar.setVisibility(View.INVISIBLE);
|
||||
// }
|
||||
if (mGiftCount != null && mGiftCount.getVisibility() != View.VISIBLE) {
|
||||
mGiftCount.setVisibility(View.VISIBLE);
|
||||
mGiftCount.setText(LiveTextRender.renderGiftCount(mLianCount));
|
||||
mGiftCount.setText(new LiveTextRender().renderGiftCount(mLianCount));
|
||||
}
|
||||
if (mGiftCount != null) {
|
||||
mGiftCount.clearAnimation();
|
||||
@@ -204,7 +201,7 @@ public class LuckLiveGiftViewHolder extends AbsViewHolder {
|
||||
}
|
||||
if (TextUtils.isEmpty(mLastGiftKey) || !mLastGiftKey.equals(bean.getKey())) {
|
||||
ImgLoader.display(mContext, bean.getGiftIcon(), mGiftIcon);
|
||||
mContent.setText(LiveTextRender.renderGiftInfo2(bean.getGiftName()));
|
||||
mContent.setText(new LiveTextRender().renderGiftInfo2(bean.getGiftName()));
|
||||
if (bean.getGiftCount() > 1) {
|
||||
mGiftGroupCount.setText("x" + bean.getGiftCount());
|
||||
mMulSign.setText(R.string.live_gift_send_lian_3);
|
||||
@@ -226,7 +223,7 @@ public class LuckLiveGiftViewHolder extends AbsViewHolder {
|
||||
mLianCount = bean.getLianCount();
|
||||
}
|
||||
if (mGiftCount != null && mGiftCount.getVisibility() == View.VISIBLE) {
|
||||
mGiftCount.setText(LiveTextRender.renderGiftCount(mLianCount));
|
||||
mGiftCount.setText(new LiveTextRender().renderGiftCount(mLianCount));
|
||||
}
|
||||
mLastGiftKey = bean.getKey();
|
||||
if (lian && mGiftCount != null && mAnimation != null) {
|
||||
|
||||
@@ -172,13 +172,13 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
private boolean mCoinNotEnough;//余额不足
|
||||
private boolean mFirstConnectSocket;//是否是第一次连接成功socket
|
||||
private int liveBg = -1;
|
||||
private int leave=-1;//是否正在休息 1为休息 0为直播
|
||||
private LiveImDeletUtil liveImDeletUtil;
|
||||
private List<String> greetings = new ArrayList<>();
|
||||
private Handler liveHandler = new Handler();
|
||||
//公共參數
|
||||
private OpenParametersModel openParametersModel = null;
|
||||
//星级活动地址
|
||||
private String activityUrl = "";
|
||||
//标记是调用正常退出还是手动切后台
|
||||
private boolean isQuitF = false;
|
||||
|
||||
@@ -1069,7 +1069,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mChatLevel = obj.getIntValue("speak_limit");
|
||||
mDanMuLevel = obj.getIntValue("barrage_limit");
|
||||
liveBg = obj.getIntValue("live_bg");
|
||||
leave = obj.getInteger("isleave");
|
||||
|
||||
if (obj.containsKey("greetings")) {
|
||||
greetings = JSONArray.parseArray(obj.getJSONArray("greetings").toJSONString(), String.class);
|
||||
}
|
||||
@@ -1197,9 +1197,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mLiveRoomViewHolder.startRequestTimeCharge();
|
||||
}
|
||||
}
|
||||
if (leave==1) {
|
||||
if (LivePlayRyViewHolder.leave != null) {
|
||||
LivePlayRyViewHolder.leave.setVisibility(View.VISIBLE);
|
||||
|
||||
if (TextUtils.equals(obj.getString("isleave"), "1")) {
|
||||
if (LivePlayKsyViewHolder.leave != null) {
|
||||
LivePlayKsyViewHolder.leave.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
//判断是否有连麦,要显示连麦窗口
|
||||
@@ -1595,7 +1596,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
|
||||
mLiveRoomViewHolder
|
||||
.showStart(
|
||||
new StarChallengeStatusModel(msgModel.getActivityUrl())
|
||||
new StarChallengeStatusModel(activityUrl)
|
||||
.setTaskNum(msgModel.getTaskNum())
|
||||
.setTaskName1(msgModel.getTaskName1())
|
||||
.setTaskName2(msgModel.getTaskName2())
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="360dp" >
|
||||
<item android:width="360dp" android:height="306dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#E6000000" />
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#ff181a34" android:endColor="#ff080a1b" android:angle="0" />
|
||||
|
||||
@@ -2,25 +2,24 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="350dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/live_gift_download_all"
|
||||
android:layout_width="155dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:background="@drawable/bg_live_gift_download_all"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="invisible">
|
||||
android:visibility="invisible"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="19dp"
|
||||
@@ -32,17 +31,16 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:visibility="visible"
|
||||
android:text="一鍵下載所有禮物動畫"
|
||||
android:textSize="10sp"
|
||||
android:visibility="visible" />
|
||||
android:textSize="10sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btn_luck_gift_tip"
|
||||
android:layout_width="105.27dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:background="@drawable/bg_live_vip_blue"
|
||||
android:gravity="center"
|
||||
@@ -55,63 +53,56 @@
|
||||
android:layout_marginEnd="7dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/icon_vip_gold" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start"
|
||||
android:orientation="vertical">
|
||||
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/vipGoldTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:text="@string/live_gift_buy_gold"
|
||||
android:textColor="#FFFFFF"
|
||||
android:text="@string/live_gift_buy_gold"
|
||||
android:textSize="11.52sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/vipGoldDesc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/live_gift_buy_gold_desc"
|
||||
android:textColor="#999999"
|
||||
android:text="@string/live_gift_buy_gold_desc"
|
||||
android:textSize="7.68sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_live_gift">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/gift_tab_layout"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
android:layout_height="50dp">
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/items"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_weight="1" />
|
||||
android:layout_marginEnd="5dp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="23dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@drawable/bg_live_gift_package_line" />
|
||||
|
||||
android:layout_width="wrap_content"
|
||||
android:src="@drawable/bg_live_gift_package_line"
|
||||
android:layout_gravity="center"
|
||||
android:layout_height="23dp"/>
|
||||
<com.yunbao.common.custom.DrawableTextView
|
||||
android:id="@+id/btn_gift_package"
|
||||
android:layout_width="36dp"
|
||||
@@ -130,68 +121,62 @@
|
||||
android:id="@+id/group"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="300dp"
|
||||
android:layout_below="@id/gift_tab_layout"
|
||||
android:gravity="bottom"
|
||||
android:layout_below="@id/gift_tab_layout"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/viewPager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1" />
|
||||
android:layout_marginBottom="1dp"/>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/vpWrapList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="66dp"
|
||||
android:layout_weight="0">
|
||||
<RadioGroup
|
||||
android:id="@+id/radio_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="6dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="3.5dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radio_group_wrap"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_height="6dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="3.5dp"
|
||||
android:gravity="end"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible" />
|
||||
android:visibility="gone" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:layout_weight="0"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/btn_send_group"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp">
|
||||
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_send"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/bg_live_gift_send_2"
|
||||
android:enabled="false"
|
||||
android:gravity="center"
|
||||
@@ -203,8 +188,7 @@
|
||||
android:id="@+id/btn_choose"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@id/btn_send"
|
||||
android:background="@drawable/bg_live_gift_choose"
|
||||
android:gravity="center"
|
||||
@@ -218,35 +202,31 @@
|
||||
android:id="@+id/arrow"
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="7dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginBottom="22dp"
|
||||
android:layout_toLeftOf="@id/btn_send"
|
||||
android:src="@mipmap/icon_live_gift_2"
|
||||
android:visibility="invisible"
|
||||
app:tint="@color/global" />
|
||||
|
||||
app:tint="@color/global"
|
||||
android:visibility="invisible" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="bottom"
|
||||
android:layout_marginStart="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.yunbao.common.custom.DrawableTextView
|
||||
android:id="@+id/goldCoin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/white"
|
||||
@@ -273,17 +253,16 @@
|
||||
app:dt_right_width="14dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.yunbao.common.custom.DrawableTextView
|
||||
android:id="@+id/go_charge"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="22dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:background="@drawable/bg_live_gift_buy"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/charge"
|
||||
android:background="@drawable/bg_live_gift_buy"
|
||||
android:textColor="@color/yellow5"
|
||||
android:textSize="12sp"
|
||||
app:dt_left_height="20dp"
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.yunbao.common.custom.MyFrameLayout2
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="92dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:mfl_ratio="1"
|
||||
android:background="@drawable/bg_live_gift_items"
|
||||
app:mfl_ratio="1">
|
||||
>
|
||||
|
||||
<com.yunbao.common.custom.MyRadioButton
|
||||
android:id="@+id/radioButton"
|
||||
@@ -12,14 +14,15 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_live_gift_item"
|
||||
android:button="@null"
|
||||
android:checked="true" />
|
||||
android:checked="true"
|
||||
/>
|
||||
|
||||
<com.yunbao.live.custom.GiftMarkView
|
||||
android:id="@+id/mark"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginRight="1dp" />
|
||||
android:layout_marginRight="1dp"
|
||||
android:layout_marginTop="1dp"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="45dp"
|
||||
@@ -31,21 +34,20 @@
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerVertical="true" />
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/expire"
|
||||
<TextView android:id="@+id/expire"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:textColor="@color/color_white"
|
||||
android:gravity="center"
|
||||
android:background="#D996cff0"
|
||||
android:visibility="gone"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:background="#D996cff0"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="8sp"
|
||||
android:visibility="gone" />
|
||||
android:textSize="8sp"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -54,12 +56,11 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|center"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/pay_ico"
|
||||
<ImageView android:id="@+id/pay_ico"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"/>
|
||||
|
||||
@@ -67,8 +68,8 @@
|
||||
android:id="@+id/price"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:textColor="@color/gray3"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:textSize="11sp"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -77,17 +78,18 @@
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginBottom="23dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp" />
|
||||
|
||||
android:textSize="12sp"
|
||||
android:layout_gravity="bottom"
|
||||
/>
|
||||
<TextView
|
||||
android:visibility="gone"
|
||||
android:layout_gravity="right"
|
||||
android:id="@+id/tvRedpoint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="14dp"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/bg_red_point"
|
||||
android:gravity="center"
|
||||
@@ -96,8 +98,7 @@
|
||||
android:paddingLeft="3dp"
|
||||
android:paddingRight="3dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
android:visibility="gone" />
|
||||
android:textSize="10sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/gift_loading_layout"
|
||||
@@ -116,4 +117,4 @@
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
</com.yunbao.common.custom.MyFrameLayout2>
|
||||
@@ -120,12 +120,13 @@
|
||||
<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" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -2,22 +2,22 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivIcon"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvName"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="主播"
|
||||
android:layout_gravity="center"
|
||||
android:paddingLeft="13dp"
|
||||
android:text="主播"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
/>
|
||||
android:textSize="10sp" />
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
@@ -42,6 +42,7 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.jakewharton.rxbinding3.view.RxView;
|
||||
import com.lzf.easyfloat.EasyFloat;
|
||||
import com.lzf.easyfloat.interfaces.OnPermissionResult;
|
||||
import com.lzf.easyfloat.permission.PermissionUtils;
|
||||
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
@@ -90,6 +91,7 @@ import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.AbsMainViewHolder;
|
||||
import com.yunbao.common.views.floatingview.APPEasyFloat;
|
||||
import com.yunbao.common.views.weight.LiveFloatView;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.live.http.LiveHttpConsts;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
@@ -628,7 +630,9 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
// });
|
||||
|
||||
public void mainClick(View v) {
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(v, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (!canClick()) {
|
||||
return;
|
||||
}
|
||||
@@ -643,7 +647,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
} else if (i == R.id.img_trophy) {
|
||||
MainListActivity.forward(mContext, 0);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,10 @@ import com.yunbao.common.custom.MyRadioButton;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.bean.ListBean;
|
||||
|
||||
@@ -68,7 +69,7 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
||||
mItemClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(v, () -> {
|
||||
Object tag = v.getTag();
|
||||
if (tag != null && mOnItemClickListener != null) {
|
||||
ListBean model = (ListBean) tag;
|
||||
@@ -79,14 +80,14 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
mFollowClickListener1 = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(v, () -> {
|
||||
if (!canClick()) {
|
||||
return;
|
||||
}
|
||||
@@ -95,14 +96,14 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
||||
final ListBean bean = (ListBean) tag;
|
||||
CommonHttpUtil.setAttention(bean.getUid(), null);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
mFollowClickListener2 = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(v, () -> {
|
||||
if (!canClick()) {
|
||||
return;
|
||||
}
|
||||
@@ -112,7 +113,7 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
|
||||
final ListBean bean = mList.get(position);
|
||||
CommonHttpUtil.setAttention(bean.getUid(), null);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -45,7 +45,7 @@ public class SettingAdapter extends RecyclerView.Adapter {
|
||||
mOnClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(v, () -> {
|
||||
Object tag = v.getTag();
|
||||
if (tag != null) {
|
||||
int position = (int) tag;
|
||||
@@ -54,7 +54,7 @@ public class SettingAdapter extends RecyclerView.Adapter {
|
||||
mOnItemClickListener.onItemClick(bean, position);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -452,7 +452,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(v, () -> {
|
||||
int i = v.getId();
|
||||
if (i == R.id.lt_name) {
|
||||
mContext.startActivity(new Intent(mContext, EditProfileActivity.class));
|
||||
@@ -477,7 +477,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
|
||||
String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid();
|
||||
ZhuangBanActivity.forward(mContext, url, false);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user