Compare commits

...

8 Commits

Author SHA1 Message Date
18401019693
ee5d3bb028 送礼物更改 2022-11-22 14:52:49 +08:00
18401019693
1346a1de52 测试修改 2022-11-18 17:28:42 +08:00
18401019693
9fa0109c2e 测试更改 2022-11-18 10:50:40 +08:00
94a96ba91a 调整直播间礼物弹框高度 2022-11-18 10:40:11 +08:00
18401019693
5006b8414e 测试修改 2022-11-15 13:53:15 +08:00
18401019693
5eac127142 测试修改 2022-11-15 11:31:59 +08:00
18401019693
8e89fdfa65 测试修改 2022-11-15 10:24:37 +08:00
5f210af804 修复关闭小窗时部分机型闪退问题
修复热度加gif不播放问题
修复送礼主播会闪退问题(心愿单id冲突)
修复一处PK中的空指针问题
修复滑动直播间不显示离开图
2022-11-15 10:10:28 +08:00
28 changed files with 494 additions and 391 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="colorPrimary">#FF8D41</color>
<color name="colorPrimaryDark">#FF8D41</color>
<color name="colorAccent">#FF8D41</color>
<!--fulive demo 主配色-->
<color name="primary_background">#050F14</color>

View File

@ -68,7 +68,17 @@ 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消息

View File

@ -7,6 +7,11 @@ 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;
@ -77,6 +82,15 @@ 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) {

View File

@ -72,7 +72,6 @@ public class ImgLoader {
.load(url)
.thumbnail(thumbnail)
.dontAnimate()
.placeholder(imageView.getDrawable());
if (width != -1 && height != -1) {
builder = builder.override(width, height);

View File

@ -6,9 +6,11 @@ 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;
@ -195,4 +197,24 @@ 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;
}
}

View File

@ -7,16 +7,17 @@ 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.live2.V2TXLivePlayer;
import com.tencent.live2.V2TXLivePlayerObserver;
import com.tencent.live2.impl.V2TXLivePlayerImpl;
import com.tencent.rtmp.ITXLivePlayListener;
import com.tencent.rtmp.TXLivePlayer;
import com.tencent.rtmp.ui.TXCloudVideoView;
import com.yunbao.common.R;
import com.yunbao.common.bean.LiveBean;
@ -24,6 +25,7 @@ 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;
@ -47,7 +49,7 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
private int mLiveTypeVal;
private FloatCallbacks.Builder builder;
private String TAG = "LiveFloatView";
private V2TXLivePlayer mPlayer;
private TXLivePlayer mPlayer;
public static LiveFloatView getInstance() {
if (instance == null) {
@ -68,30 +70,50 @@ 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 V2TXLivePlayerImpl(mContext);
mPlayer.setRenderView(videoView);
mPlayer.startPlay(url);
mPlayer.setObserver(new V2TXLivePlayerObserver() {
mPlayer = new TXLivePlayer(mContext);
mPlayer.setPlayerView(videoView);
mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV);
mPlayer.setPlayListener(new ITXLivePlayListener() {
@Override
public void onWarning(V2TXLivePlayer player, int code, String msg, Bundle extraInfo) {
super.onWarning(player, code, msg, extraInfo);
Log.e(TAG, msg + "==============" + code);
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 onError(V2TXLivePlayer player, int code, String msg, Bundle extraInfo) {
super.onError(player, code, msg, extraInfo);
Log.e(TAG, msg + "==============" + code);
public void onNetStatus(Bundle bundle) {
}
});
ViewClicksAntiShake.clicksAntiShake(magnetView.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
mPlayer.stopPlay();
mPlayer.stopPlay(true);
APPEasyFloat.getInstance().dismiss(mContext);
if (IMLoginManager.get(mContext).isHint2()) {
if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) {
HintDialog fragment = new HintDialog();
Bundle args = new Bundle();
args.putString("close", "1");
@ -100,8 +122,8 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
}
}
});
ViewClicksAntiShake.clicksAntiShake(magnetView, () -> {
mPlayer.stopPlay();
ViewClicksAntiShake.clicksAntiShake(videoView, () -> {
mPlayer.stopPlay(true);
APPEasyFloat.getInstance().dismiss(mContext);
new Handler().post(liveCheck);
@ -117,7 +139,7 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
@Override
public void dismiss() {
if (mPlayer != null)
mPlayer.stopPlay();
mPlayer.stopPlay(true);
}
})
.show(mContext);
@ -156,15 +178,14 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
callback.invoke(aBoolean);
}
builder.dismiss(() -> {
if (mPlayer != null && mPlayer.isPlaying() == 1) {
mPlayer.stopPlay();
if (mPlayer != null && mPlayer.isPlaying()) {
mPlayer.stopPlay(true);
}
return null;
});
builder.hide(view12 -> {
if (mPlayer != null && mPlayer.isPlaying() == 1) {
mPlayer.pauseAudio();
mPlayer.pauseVideo();
if (mPlayer != null && mPlayer.isPlaying()) {
mPlayer.pause();
}
return null;
});
@ -182,14 +203,49 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
@Override
public void invoke(View view) {
TXCloudVideoView videoView = view.findViewById(R.id.video_view);
mPlayer = new V2TXLivePlayerImpl(mContext);
mPlayer.setRenderView(videoView);
mPlayer.startPlay(url);
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) {
}
});
ViewClicksAntiShake.clicksAntiShake(view.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
mPlayer.stopPlay();
mPlayer.stopPlay(true);
EasyFloat.dismiss("LiveFloatView", true);
if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) {
HintDialog fragment = new HintDialog();
@ -202,7 +258,7 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
});
ViewClicksAntiShake.clicksAntiShake(view, () -> {
mPlayer.stopPlay();
mPlayer.stopPlay(true);
new Handler().post(liveCheck);

View File

@ -1,10 +1,11 @@
<?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="210dp"
android:layout_width="wrap_content"
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"

View File

@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<style name="AppTheme" parent="Base.Theme.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>

View File

@ -25,7 +25,7 @@ ext {
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
// true表示谷歌支付 false
isGooglePlay : true,
isGooglePlay : false,
//
isUploadLog : true
]

View File

@ -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

View File

@ -14,6 +14,8 @@ 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;
@ -21,21 +23,22 @@ 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.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.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
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;
@ -45,6 +48,7 @@ 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;
@ -55,12 +59,9 @@ 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;
@ -71,7 +72,6 @@ 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,6 +94,7 @@ 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;
@ -103,7 +104,6 @@ import io.rong.message.TextMessage;
import pl.droidsonroids.gif.GifImageView;
/**
* Created by cxf on 2018/10/7.
* 主播直播间
@ -142,7 +142,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
public static int backIndex = 0;//0=未判断1=已判断
@Override
protected int getLayoutId() {
return R.layout.activity_live_anchor;
@ -230,15 +229,6 @@ 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) {
@ -349,60 +339,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
openRedPackSendWindow();
break;
case Constants.LIVE_FUNC_ZSLK://暫時離開
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;
}
});
leaveLive();
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;
@ -434,6 +371,45 @@ 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) {
}
});
}
/**
* 打开心愿单窗口
@ -478,12 +454,9 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
if (mLiveReadyViewHolder != null) {
mLiveReadyViewHolder.hide();
}
if(mLiveRoomViewHolder!=null){
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.changeFaceUnityView();
}
/* LiveBeautyDialogFragment fragment = new LiveBeautyDialogFragment();
fragment.setiBeautyModule(BeautyManager.iBeautyModule, BeautyManager.iLookupModule, BeautyManager.iBeautyBodyModule);
fragment.show(getSupportFragmentManager(), "LiveBeautyDialogFragment");*/
}
/**
@ -491,7 +464,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
*/
public void light() {
if (mLiveRoomViewHolder != null) {
// mLiveRoomViewHolder.playLightAnim();
}
}
@ -548,7 +520,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
hasGame = mGameList.size() > 0;
}
bundle.putBoolean(Constants.HAS_GAME, hasGame);
bundle.putInt("leave",leave);
bundle.putInt("leave", leave);
bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen());
fragment.setArguments(bundle);
fragment.setFunctionClickListener(this);
@ -869,18 +841,18 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
protected void onDestroy() {
LiveHttpUtil.cancel(LiveHttpConsts.ANCHOR_CHECK_LIVE);
super.onDestroy();
if(mLivePushViewHolder!=null) {
if (mLivePushViewHolder != null) {
mLivePushViewHolder.onDestroy();
}
if(mLiveReadyViewHolder!=null){
if (mLiveReadyViewHolder != null) {
mLiveReadyViewHolder.onDestroy();
}
if(mLiveAnchorViewHolder!=null){
if (mLiveAnchorViewHolder != null) {
mLiveAnchorViewHolder.onDestroy();
}
mLivePushViewHolder=null;
mLiveReadyViewHolder=null;
mLiveAnchorViewHolder=null;
mLivePushViewHolder = null;
mLiveReadyViewHolder = null;
mLiveAnchorViewHolder = null;
L.e("LiveAnchorActivity-------onDestroy------->");
Bus.getOff(this);
}
@ -1269,6 +1241,7 @@ 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();

View File

@ -8,7 +8,6 @@ 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;
@ -22,19 +21,21 @@ 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;
@ -168,7 +169,6 @@ public class WebViewActivityMedal extends AbsActivity {
}
}
private LiveRoomCheckLivePresenter mCheckLivePresenter;
private void gotoLive(final String live_id) {
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
@ -177,22 +177,10 @@ public class WebViewActivityMedal extends AbsActivity {
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
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;
}
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
}
});
}
mCheckLivePresenter.checkLive(liveBean);
LiveAudienceActivity.forward(mContext, liveBean, 0, 0, "", 0, 0);
} else {
RouteUtil.forwardUserHome(mContext, live_id,0);
RouteUtil.forwardUserHome(mContext, String.valueOf(live_id), 0);
}
}
});

View File

@ -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 = WindowManager.LayoutParams.WRAP_CONTENT;
params.height = DpUtil.dp2px(355);
params.gravity = Gravity.BOTTOM;
window.setAttributes(params);
}
@ -251,7 +251,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
mVipGoldTitle = mRootView.findViewById(R.id.vipGoldTitle);
mVipGoldDesc = mRootView.findViewById(R.id.vipGoldDesc);
mVipGold.setOnClickListener(this);
mGiftPackage= mRootView.findViewById(R.id.btn_gift_package);
mGiftPackage = mRootView.findViewById(R.id.btn_gift_package);
mGiftPackage.setOnClickListener(this);
mRootView.findViewById(R.id.live_gift_download_all).setOnClickListener(this);
mHandler = new Handler() {
@ -295,7 +295,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
JSONObject user = JSONObject.parseObject(info[0]);
int nobleId = user.getIntValue("noble_id");
int resId = NobleUtil.nobleIdToImageResId(nobleId);
if(resId!=-1){
if (resId != -1) {
mVipGoldIcon.setImageResource(resId);
mVipGoldTitle.setText(user.getString("noble_name"));
mVipGoldDesc.setText(R.string.live_gift_buy_gold_desc_to);
@ -385,7 +385,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
String giftJson = obj.getString("giftlist");
List<LiveGiftBean> list = JSON.parseArray(giftJson, LiveGiftBean.class);
GiftCacheUtil.getInstance().addDownloadList(list);
if(!GiftCacheUtil.getInstance().isDownloading()){
if (!GiftCacheUtil.getInstance().isDownloading()) {
GiftCacheUtil.getInstance().downloadAllGift();
}
if (list.size() == 0) {
@ -405,7 +405,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
}
private void showGiftList(List<LiveGiftBean> list) {
if (bean1!=null&&IMLoginManager.get(mContext).isNewUserGif() && (type_name.equals("熱門") || type_name.equals("Hot"))) {
if (bean1 != null && IMLoginManager.get(mContext).isNewUserGif() && (type_name.equals("熱門") || type_name.equals("Hot"))) {
list.add(0, bean1);
if (mWishGiftId == null) {
mWishGiftId = "" + bean1.getId();
@ -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();
forwardMyCoin(0);
} else if (i == R.id.goldCoin) {
forwardMyCoin();
forwardMyCoin(2);
} else if (i == R.id.go_charge) {
forwardMyCoin();
forwardMyCoin(0);
} 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() {
private void forwardMyCoin(int page) {
dismiss();
//我们的
ARouter.getInstance().build(PATH_COIN).withInt("p", 1).navigation();
ARouter.getInstance().build(PATH_COIN).withInt("p", page).navigation();
}
/**
@ -709,6 +709,7 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
/**
* 收到礼物下载完成的通知
*
* @param status
*/
@Subscribe(threadMode = ThreadMode.MAIN)

View File

@ -21,6 +21,7 @@ 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;
@ -130,6 +131,7 @@ public class VoiceDialog extends AbsDialogFragment {
* 上划取消
*/
public void withdraw() {
mIat.stopListening();
if (!isDetached()) {
voiceFluctuations.setVisibility(View.GONE);
gifView.setVisibility(View.GONE);
@ -143,6 +145,7 @@ public class VoiceDialog extends AbsDialogFragment {
* 上划取消
*/
public void notWithdraw() {
startRecognize();
if (!isDetached()) {
if (TextUtils.isEmpty(sendMessage())) {
if (gifView.getVisibility() != View.VISIBLE)
@ -284,7 +287,8 @@ public class VoiceDialog extends AbsDialogFragment {
endOfSpeech();
}
builder.append(text);
voiceChat.setText(builder);
voiceChat.setText(WordsTypeUtil.changeTraditional(builder.toString()));
} catch (JSONException e) {
e.printStackTrace();
}

View File

@ -12,6 +12,7 @@ import com.yunbao.common.http.JsonBean;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.MD5Util;
import com.yunbao.common.utils.VersionUtil;
import java.io.File;
@ -40,6 +41,7 @@ public class LiveHttpUtil {
.params("stream", stream)
.params("type", type)
.params("p", p)
.params("version", "" + VersionUtil.getVersion())
.execute(callback);
}

View File

@ -525,18 +525,22 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
//1. 设置自适应合流布局模式
config.setLayoutMode(RCRTCMixConfig.MixLayoutMode.ADAPTIVE);
//2. 合流画布设置
rcrtcLiveInfo.setMixConfig(config, new IRCRTCResultCallback() {
@Override
public void onSuccess() {
Log.e("ry", "混成功" + u.getId());
}
if(rcrtcLiveInfo!=null) {
rcrtcLiveInfo.setMixConfig(config, new IRCRTCResultCallback() {
@Override
public void onSuccess() {
Log.e("ry", "混成功" + u.getId());
}
@Override
public void onFailed(RTCErrorCode errorCode) {
Log.e("ry", "混失败" + errorCode);
@Override
public void onFailed(RTCErrorCode errorCode) {
Log.e("ry", "混失败" + errorCode);
}
});
}
});
}else{
Log.w("PkDebug", "PK合流失败,rcrtcLiveInfo为空" );
}
}
}

View File

@ -1127,7 +1127,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
htmlUrl.append(CommonAppConfig.HOST)
.append("/")
.append(bean.getModel().getActivityUrl())
.append("&nickname=")
.append(bean.getModel().getActivityUrl().contains("?") ? "&nickname=" : "?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("&nickname=")
.append(bean.getModel().getActivityUrl().contains("?") ? "&nickname=" : "?nickname=")
.append(userInfo.getUserNicename())
.append("&token=")
.append(userInfo.getToken())
@ -1405,7 +1405,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
wishListLayout.setVisibility(View.GONE);
}
((Activity) mContext).runOnUiThread(() -> {
wishListFlipper = (ViewFlipper) findViewById(R.id.wish_list);
wishListFlipper = (ViewFlipper) findViewById(R.id.wish_list_vf);
for (int i = 0; i < wishlist.size(); i++) {
View wish = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
wish.setTag(wishlist.get(i).getId());

View File

@ -10,6 +10,7 @@ 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;

View File

@ -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,10 +1197,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.startRequestTimeCharge();
}
}
if (TextUtils.equals(obj.getString("isleave"), "1")) {
if (LivePlayKsyViewHolder.leave != null) {
LivePlayKsyViewHolder.leave.setVisibility(View.VISIBLE);
if (leave==1) {
if (LivePlayRyViewHolder.leave != null) {
LivePlayRyViewHolder.leave.setVisibility(View.VISIBLE);
}
}
//判断是否有连麦要显示连麦窗口
@ -1596,7 +1595,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder
.showStart(
new StarChallengeStatusModel(activityUrl)
new StarChallengeStatusModel(msgModel.getActivityUrl())
.setTaskNum(msgModel.getTaskNum())
.setTaskName1(msgModel.getTaskName1())
.setTaskName2(msgModel.getTaskName2())

View File

@ -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" android:height="306dp">
<item android:width="360dp" >
<shape android:shape="rectangle">
<solid android:color="#E6000000" />
<gradient android:type="linear" android:useLevel="true" android:startColor="#ff181a34" android:endColor="#ff080a1b" android:angle="0" />

View File

@ -2,181 +2,196 @@
<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="wrap_content"
android:layout_height="350dp"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/live_gift_download_all"
android:layout_width="155dp"
android:layout_height="32dp"
android:layout_marginStart="12dp"
android:layout_alignParentStart="true"
android:background="@drawable/bg_live_gift_download_all"
android:gravity="center"
android:visibility="invisible"
android:orientation="horizontal">
<ImageView
android:layout_width="19dp"
android:layout_height="19dp"
android:layout_marginEnd="7dp"
android:src="@mipmap/icon_small_download" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:visibility="visible"
android:text="一鍵下載所有禮物動畫"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/btn_luck_gift_tip"
android:layout_width="105.27dp"
android:layout_alignParentEnd="true"
android:layout_height="32dp"
android:layout_marginEnd="12dp"
android:background="@drawable/bg_live_vip_blue"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/vipGoldIcon"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginEnd="7dp"
android:scaleType="centerCrop"
android:src="@mipmap/icon_vip_gold" />
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:gravity="start"
android:layout_height="wrap_content">
android:id="@+id/live_gift_download_all"
android:layout_width="155dp"
android:layout_height="32dp"
android:layout_alignParentStart="true"
android:layout_marginStart="12dp"
android:background="@drawable/bg_live_gift_download_all"
android:gravity="center"
android:orientation="horizontal"
android:visibility="invisible">
<ImageView
android:layout_width="19dp"
android:layout_height="19dp"
android:layout_marginEnd="7dp"
android:src="@mipmap/icon_small_download" />
<TextView
android:id="@+id/vipGoldTitle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
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:textColor="#999999"
android:text="@string/live_gift_buy_gold_desc"
android:textSize="7.68sp" />
android:gravity="center"
android:text="一鍵下載所有禮物動畫"
android:textSize="10sp"
android:visibility="visible" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/btn_luck_gift_tip"
android:layout_width="105.27dp"
android:layout_height="32dp"
android:layout_alignParentEnd="true"
android:layout_marginEnd="12dp"
android:background="@drawable/bg_live_vip_blue"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/vipGoldIcon"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginEnd="7dp"
android:scaleType="centerCrop"
android:src="@mipmap/icon_vip_gold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start"
android:orientation="vertical">
<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: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: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:layout_height="50dp">
android:orientation="horizontal">
<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_marginEnd="5dp"
android:layout_weight="1" />
<ImageView
android:layout_marginEnd="15dp"
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"
android:layout_height="36dp"
android:layout_marginEnd="10dp"
android:drawablePadding="2dp"
android:gravity="center_vertical"
android:text="@string/live_wrap"
android:textColor="#FFFFFF"
android:textSize="12sp"
app:dt_left_height="23dp"
app:dt_left_width="1.3dp" />
<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" />
<com.yunbao.common.custom.DrawableTextView
android:id="@+id/btn_gift_package"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginEnd="10dp"
android:drawablePadding="2dp"
android:gravity="center_vertical"
android:text="@string/live_wrap"
android:textColor="#FFFFFF"
android:textSize="12sp"
app:dt_left_height="23dp"
app:dt_left_width="1.3dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/group"
android:layout_width="match_parent"
android:layout_height="300dp"
android:gravity="bottom"
android:layout_below="@id/gift_tab_layout"
android:gravity="bottom"
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_marginBottom="8dp"/>
android:layout_weight="1" />
<androidx.viewpager.widget.ViewPager
android:id="@+id/vpWrapList"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginTop="5dp"
android:layout_marginBottom="8dp"
android:layout_marginBottom="3dp"
android:layout_weight="1"
android:visibility="gone" />
<RadioGroup
android:id="@+id/radio_group"
android:layout_width="wrap_content"
android:layout_height="6dp"
android:layout_marginEnd="30dp"
android:layout_gravity="end"
android:orientation="horizontal" />
<RadioGroup
android:id="@+id/radio_group_wrap"
android:layout_width="wrap_content"
android:layout_height="6dp"
android:layout_gravity="center_horizontal"
android:orientation="horizontal"
android:visibility="gone" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="66dp"
android:layout_weight="0"
android:paddingLeft="10dp"
android:paddingRight="10dp">
android:layout_weight="0">
<RadioGroup
android:id="@+id/radio_group"
android:layout_width="wrap_content"
android:layout_height="6dp"
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:orientation="horizontal"
android:visibility="visible" />
<RelativeLayout
android:id="@+id/btn_send_group"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp">
<TextView
android:id="@+id/btn_send"
android:layout_width="60dp"
android:layout_height="30dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/bg_live_gift_send_2"
android:enabled="false"
android:gravity="center"
@ -188,7 +203,8 @@
android:id="@+id/btn_choose"
android:layout_width="60dp"
android:layout_height="30dp"
android:layout_centerVertical="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:layout_toLeftOf="@id/btn_send"
android:background="@drawable/bg_live_gift_choose"
android:gravity="center"
@ -202,31 +218,35 @@
android:id="@+id/arrow"
android:layout_width="13dp"
android:layout_height="7dp"
android:layout_centerVertical="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="5dp"
android:layout_marginBottom="22dp"
android:layout_toLeftOf="@id/btn_send"
android:src="@mipmap/icon_live_gift_2"
app:tint="@color/global"
android:visibility="invisible" />
android:visibility="invisible"
app:tint="@color/global" />
</RelativeLayout>
<LinearLayout
android:orientation="horizontal"
android:gravity="bottom"
android:layout_marginBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:layout_marginBottom="5dp"
android:gravity="bottom"
android:layout_marginStart="20dp"
android:orientation="horizontal">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">
<com.yunbao.common.custom.DrawableTextView
android:id="@+id/goldCoin"
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawablePadding="4dp"
android:gravity="center_vertical"
android:textColor="@color/white"
@ -253,16 +273,17 @@
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"

View File

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<com.yunbao.common.custom.MyFrameLayout2
xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout 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="wrap_content"
app:mfl_ratio="1.1"
android:layout_height="92dp"
android:background="@drawable/bg_live_gift_items"
>
app:mfl_ratio="1">
<com.yunbao.common.custom.MyRadioButton
android:id="@+id/radioButton"
@ -14,15 +12,14 @@
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_marginRight="1dp"
android:layout_marginTop="1dp"/>
android:layout_marginTop="1dp"
android:layout_marginRight="1dp" />
<RelativeLayout
android:layout_width="45dp"
@ -34,20 +31,21 @@
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"/>
android:layout_centerHorizontal="true"
android:layout_centerVertical="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:textSize="8sp"/>
android:background="#D996cff0"
android:gravity="center"
android:textColor="@color/color_white"
android:textSize="8sp"
android:visibility="gone" />
</RelativeLayout>
@ -56,21 +54,22 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center"
android:gravity="center"
android:layout_marginBottom="8dp"
android:gravity="center"
android:orientation="horizontal">
<ImageView android:id="@+id/pay_ico"
<ImageView
android:id="@+id/pay_ico"
android:layout_width="10dp"
android:layout_height="10dp"/>
android:layout_height="10dp" />
<TextView
android:id="@+id/price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/gray3"
android:layout_marginLeft="5dp"
android:textSize="11sp"/>
android:textColor="@color/gray3"
android:textSize="11sp" />
</LinearLayout>
@ -78,18 +77,17 @@
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:layout_gravity="bottom"
/>
android:textSize="12sp" />
<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"
@ -98,7 +96,8 @@
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:textColor="@color/white"
android:textSize="10sp" />
android:textSize="10sp"
android:visibility="gone" />
<LinearLayout
android:id="@+id/gift_loading_layout"
@ -117,4 +116,4 @@
</LinearLayout>
</com.yunbao.common.custom.MyFrameLayout2>
</FrameLayout>

View File

@ -372,7 +372,7 @@
android:src="@mipmap/live_icon_wishlist" />
<ViewFlipper
android:id="@+id/wish_list"
android:id="@+id/wish_list_vf"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_marginStart="6dp"

View File

@ -41,7 +41,7 @@ import com.google.firebase.messaging.FirebaseMessaging;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.jakewharton.rxbinding3.view.RxView;
import com.lzf.easyfloat.interfaces.OnPermissionResult;
import com.lzf.easyfloat.EasyFloat;
import com.lzf.easyfloat.permission.PermissionUtils;
import com.tencent.imsdk.v2.V2TIMCallback;
import com.tencent.imsdk.v2.V2TIMManager;
@ -88,8 +88,8 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.VersionUtil;
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;
@ -202,7 +202,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
CommonHttpUtil.getConfig(mContext, new CommonCallback<ConfigBean>() {
@Override
public void callback(ConfigBean bean) {
if(bean==null){
if (bean == null) {
return;
}
//是否需要老用户回归弹窗
@ -628,25 +628,22 @@ 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;
}
int i = v.getId();
if (i == R.id.btn_start) {
showStartDialog();
} else if (i == R.id.btn_search) {
SearchActivity.forward(mContext);
} else if (i == R.id.btn_follow) {
//关注
FollowActivity.forward(mContext, CommonAppConfig.getInstance().getUid(), 0);
} else if (i == R.id.img_trophy) {
MainListActivity.forward(mContext, 0);
}
}
});
if (!canClick()) {
return;
}
int i = v.getId();
if (i == R.id.btn_start) {
showStartDialog();
} else if (i == R.id.btn_search) {
SearchActivity.forward(mContext);
} else if (i == R.id.btn_follow) {
//关注
FollowActivity.forward(mContext, CommonAppConfig.getInstance().getUid(), 0);
} else if (i == R.id.img_trophy) {
MainListActivity.forward(mContext, 0);
}
}
@ -729,7 +726,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
bundle.putString("send_exp", obj.getString("send_exp"));
bundle.putString("sign_day", obj.getString("sign_day"));
fragment.setArguments(bundle);
if(!getSupportFragmentManager().isStateSaved()) {
if (!getSupportFragmentManager().isStateSaved()) {
fragment.show(getSupportFragmentManager(), "SigninDialog");
}
}
@ -948,6 +945,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
ToastUtil.show(R.string.main_click_next_exit);
return;
}
APPEasyFloat.getInstance().dismiss(mContext);
//判断是否有直播悬浮窗有直接关闭
if (EasyFloat.isShow("LiveFloatView")) {
EasyFloat.dismiss("LiveFloatView", true);
}
super.onBackPressed();
}
}

View File

@ -23,10 +23,9 @@ 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.ToastUtil;
import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.main.R;
import com.yunbao.main.bean.ListBean;
@ -69,51 +68,51 @@ 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;
if (model.isHide()) {
ToastUtil.show(R.string.can_not_go);
} else {
mOnItemClickListener.onItemClick(model, 0);
}
Object tag = v.getTag();
if (tag != null && mOnItemClickListener != null) {
ListBean model = (ListBean) tag;
if (model.isHide()) {
ToastUtil.show(R.string.can_not_go);
} else {
mOnItemClickListener.onItemClick(model, 0);
}
});
}
}
};
mFollowClickListener1 = new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewClicksAntiShake.clicksAntiShake(v, () -> {
if (!canClick()) {
return;
}
Object tag = v.getTag();
if (tag != null) {
final ListBean bean = (ListBean) tag;
CommonHttpUtil.setAttention(bean.getUid(), null);
}
});
if (!canClick()) {
return;
}
Object tag = v.getTag();
if (tag != null) {
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;
}
Object tag = v.getTag();
if (tag != null) {
final int position = (int) tag;
final ListBean bean = mList.get(position);
CommonHttpUtil.setAttention(bean.getUid(), null);
}
});
if (!canClick()) {
return;
}
Object tag = v.getTag();
if (tag != null) {
final int position = (int) tag;
final ListBean bean = mList.get(position);
CommonHttpUtil.setAttention(bean.getUid(), null);
}
}
};
@ -288,7 +287,7 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
public void onComplete(SVGAVideoEntity videoItem) {
SVGADrawable drawable = new SVGADrawable(videoItem);
svga1.setImageDrawable(drawable);
SVGAViewUtils.playEndClear(svga1,false);
SVGAViewUtils.playEndClear(svga1, false);
}
@Override
@ -365,7 +364,7 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
public void onComplete(SVGAVideoEntity videoItem) {
SVGADrawable drawable = new SVGADrawable(videoItem);
svga2.setImageDrawable(drawable);
SVGAViewUtils.playEndClear(svga2,false);
SVGAViewUtils.playEndClear(svga2, false);
}
@Override
@ -441,7 +440,7 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
public void onComplete(SVGAVideoEntity videoItem) {
SVGADrawable drawable = new SVGADrawable(videoItem);
svga3.setImageDrawable(drawable);
SVGAViewUtils.playEndClear(svga3,false);
SVGAViewUtils.playEndClear(svga3, false);
}
@Override
@ -544,7 +543,7 @@ public class MainListAdapter extends RefreshAdapter<ListBean> {
public void onComplete(SVGAVideoEntity videoItem) {
SVGADrawable drawable = new SVGADrawable(videoItem);
svga.setImageDrawable(drawable);
SVGAViewUtils.playEndClear(svga,false);
SVGAViewUtils.playEndClear(svga, false);
}
@Override

View File

@ -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);
}
}
});
}
};

View File

@ -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);
}
});

View File

@ -92,10 +92,17 @@
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="5dp"
android:layout_weight="1"
android:gravity="right">