修复bug

This commit is contained in:
Martin 2024-08-27 18:29:00 +08:00
parent faa9adf69a
commit e3d04c9307
13 changed files with 89 additions and 43 deletions

View File

@ -118,7 +118,7 @@ public class EnterRoomInfoModel extends BaseModel {
@SerializedName("is_first_entry")
private String isFirstEntry;
@SerializedName("s_new_user")
@SerializedName("is_new_user")
private String isNewUser;
@SerializedName("is_com_all")
private String isComAll;

View File

@ -51,7 +51,7 @@ public class DateFormatUtil {
}
public static String getDiffInMilliseconds(String time1, String time2) {
return String.valueOf((Long.parseLong(time1) - Long.parseLong(time2)) / (60 * 1000));
return String.valueOf((Long.parseLong(time2) - Long.parseLong(time1)) / (60 * 1000));
}

View File

@ -21,6 +21,7 @@ import com.yunbao.common.bean.HttpCallbackModel;
import com.yunbao.common.bean.LiveAiRobotBean;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
@ -66,11 +67,12 @@ public class LiveRobotSettingCustomPopup extends BottomPopupView implements View
findViewById(R.id.automatic_greeting_setting).setOnClickListener(this);
robotNameText.setOnClickListener(this);
robotState.setOnClickListener(this);
robotNameSetting.setImeOptions(EditorInfo.IME_ACTION_DONE);
robotNameSetting.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
L.e("EditorInfo.IME_ACTION_DONE");
// 修改助手名字
LiveNetManager.get(getContext())
.setAiRobotDate("ai_name", robotNameSetting.getText().toString(), new HttpCallback<HttpCallbackModel>() {

View File

@ -1,12 +1,10 @@
package io.agora.beautyapi.faceunity.agora;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.text.TextUtils;
import android.view.SurfaceView;
import android.widget.FrameLayout;
@ -17,7 +15,6 @@ import com.yunbao.common.CommonAppContext;
import com.yunbao.common.bean.SwTokenModel;
import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.base.BaseCacheManager;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.StringUtil;
@ -151,7 +148,7 @@ public class SWManager extends BaseCacheManager {
cfg.frameRate = 20;
cfg.bitrate = 0;
//镜像
cfg.mirrorMode = VideoEncoderConfiguration.MIRROR_MODE_TYPE.MIRROR_MODE_ENABLED;
cfg.mirrorMode = VideoEncoderConfiguration.MIRROR_MODE_TYPE.MIRROR_MODE_DISABLED;
//设置竖屏
cfg.orientationMode = VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_FIXED_PORTRAIT;
@ -216,22 +213,27 @@ public class SWManager extends BaseCacheManager {
}
}
/**
* 设置镜像模式
*/
public void setMirrorMode() {
if (cfg != null && mRtcEngine != null) {
L.eSw("setMirrorMode设置镜像" + cfg.mirrorMode);
if (cfg.mirrorMode == VideoEncoderConfiguration.MIRROR_MODE_TYPE.MIRROR_MODE_ENABLED) {
cfg.mirrorMode = VideoEncoderConfiguration.MIRROR_MODE_TYPE.MIRROR_MODE_DISABLED; //取消镜像
if (cfg.mirrorMode == VideoEncoderConfiguration.MIRROR_MODE_TYPE.MIRROR_MODE_DISABLED) {
cfg.mirrorMode = VideoEncoderConfiguration.MIRROR_MODE_TYPE.MIRROR_MODE_AUTO; //设置镜像
} else {
cfg.mirrorMode = VideoEncoderConfiguration.MIRROR_MODE_TYPE.MIRROR_MODE_ENABLED; //设置镜像
cfg.mirrorMode = VideoEncoderConfiguration.MIRROR_MODE_TYPE.MIRROR_MODE_DISABLED; //取消镜像
}
L.eSw("setMirrorMode设置镜像" + cfg.mirrorMode);
mRtcEngine.setVideoEncoderConfiguration(cfg);
SurfaceView surfaceView = new SurfaceView(mContext);
anchorContainer.addView(surfaceView);
mRtcEngine.setupLocalVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid));
VideoCanvas videoCanvas =new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid);
if(cfg.mirrorMode == VideoEncoderConfiguration.MIRROR_MODE_TYPE.MIRROR_MODE_DISABLED){
videoCanvas.mirrorMode = Constants.VIDEO_MIRROR_MODE_DISABLED;
}else{
videoCanvas.mirrorMode = Constants.VIDEO_MIRROR_MODE_ENABLED;
}
mRtcEngine.setupLocalVideo(videoCanvas);
}
}

View File

@ -1017,7 +1017,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl
mLiveEndViewHolder.subscribeActivityLifeCycle();
mLiveEndViewHolder.addToParent();
mLiveEndViewHolder.showData(mLiveBean, mStream);
mLiveEndViewHolder.upData(datas.getString("votes"), datas.getString("length"), Long.parseLong(datas.getString("nums")),datas.getString("level"),datas.getString("votestotal"),datas.getString("level_up"),datas.getString("next_level_exp"),datas.getString("starttime"),datas.getString("endtime"),datas.getString("hot_strategy"));
mLiveEndViewHolder.upData(datas.getString("votes"), datas.getString("length"), Long.parseLong(datas.getString("nums")),datas.getString("level"),datas.getString("votestotal"),datas.getString("level_up"),datas.getString("next_level_exp"),datas.getString("starttime")+"000",datas.getString("endtime")+"000",datas.getString("hot_strategy"));
if (banEvent != null) {
mLiveEndViewHolder.showBanDownLive(banEvent);
banEvent = null;

View File

@ -729,12 +729,11 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
if (bean == null) {
return;
}
mList.remove(bean.getHeart());
notifyItemRemoved(bean.getHeart());
notifyItemRangeChanged(bean.getHeart(), getItemCount());
if(bean.getHeart()<mList.size()){//防止数组越界
mList.remove(bean.getHeart());
notifyItemRemoved(bean.getHeart());
notifyItemRangeChanged(bean.getHeart(), getItemCount());
}
}
public void scrollToBottom() {

View File

@ -38,6 +38,7 @@ import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DateFormatUtil;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.MicStatusManager;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.StringUtil;
@ -426,8 +427,10 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList
level_progress.post(new Runnable() {
@Override
public void run() {
level_progress.setMax(Integer.parseInt(level_up));
level_progress.setProgress(Integer.parseInt(votestotal));
if(level_up!=null&&votestotal!=null){
level_progress.setMax(Integer.parseInt(level_up));
level_progress.setProgress(Integer.parseInt(votestotal));
}
}
});
}

View File

@ -1009,23 +1009,23 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
firstFollowLookHandler.removeCallbacks(firstFollowLookRunnable);
firstFollowLookHandler.postDelayed(firstFollowLookRunnable, 7000);
notify_follow_layout.setVisibility(View.VISIBLE);
mDp500 = DpUtil.dp2px(-300);
mDp500 = DpUtil.dp2px(-400);
animatorFollowFirstLook(true);
}
public void animatorFollowFirstLook(boolean isIn) {
if (isIn) {
animator_follow_first_look = ObjectAnimator.ofFloat(notify_follow_layout, "translationX", mDp500, 0);
animator_follow_first_look.setDuration(800);
animator_follow_first_look.setDuration(1000);
} else {
animator_follow_first_look = ObjectAnimator.ofFloat(notify_follow_layout, "translationX", 0, mDp500);
animator_follow_first_look.setDuration(800);
animator_follow_first_look.setDuration(1000);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
notify_follow_layout.setVisibility(View.GONE);
}
}, 1000);
}, 2000);
}
animator_follow_first_look.setInterpolator(new LinearInterpolator());
animator_follow_first_look.start();
@ -1069,23 +1069,23 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
firstTaskDetailsHandler.removeCallbacks(firstTaskDetailsRunnable);
firstTaskDetailsHandler.postDelayed(firstTaskDetailsRunnable, 7000);
new_task_gift_notify.setVisibility(View.VISIBLE);
mDp500 = DpUtil.dp2px(-300);
mDp500 = DpUtil.dp2px(-400);
animatorTaskDetails(true);
}
public void animatorTaskDetails(boolean isIn) {
if (isIn) {
animator_first_task_details = ObjectAnimator.ofFloat(new_task_gift_notify, "translationX", mDp500, 0);
animator_first_task_details.setDuration(800);
animator_first_task_details.setDuration(1000);
} else {
animator_first_task_details = ObjectAnimator.ofFloat(new_task_gift_notify, "translationX", 0, mDp500);
animator_first_task_details.setDuration(800);
animator_first_task_details.setDuration(1000);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
new_task_gift_notify.setVisibility(View.GONE);
}
}, 1000);
}, 2000);
}
animator_first_task_details.setInterpolator(new LinearInterpolator());
animator_first_task_details.start();
@ -1129,23 +1129,23 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
firstTaskDetailsHandler1.removeCallbacks(firstTaskDetailsRunnable1);
firstTaskDetailsHandler1.postDelayed(firstTaskDetailsRunnable1, 7000);
new_task_gift_notify1.setVisibility(View.VISIBLE);
mDp500 = DpUtil.dp2px(-300);
mDp500 = DpUtil.dp2px(-400);
animatorTaskDetails1(true);
}
public void animatorTaskDetails1(boolean isIn) {
if (isIn) {
animator_first_task_details1 = ObjectAnimator.ofFloat(new_task_gift_notify1, "translationX", mDp500, 0);
animator_first_task_details1.setDuration(800);
animator_first_task_details1.setDuration(1000);
} else {
animator_first_task_details1 = ObjectAnimator.ofFloat(new_task_gift_notify1, "translationX", 0, mDp500);
animator_first_task_details1.setDuration(800);
animator_first_task_details1.setDuration(1000);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
new_task_gift_notify1.setVisibility(View.GONE);
}
}, 1000);
}, 2000);
}
animator_first_task_details1.setInterpolator(new LinearInterpolator());
animator_first_task_details1.start();
@ -1192,23 +1192,23 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
sendGiftTaskHandler.removeCallbacks(sendGiftTaskRunnable);
sendGiftTaskHandler.postDelayed(sendGiftTaskRunnable, 10000);
new_task_send_gift_notify.setVisibility(View.VISIBLE);
mDp500 = DpUtil.dp2px(-300);
mDp500 = DpUtil.dp2px(-400);
animatorSendGiftTask(true);
}
public void animatorSendGiftTask(boolean isIn) {
if (isIn) {
animator_send_gift_task = ObjectAnimator.ofFloat(new_task_send_gift_notify, "translationX", mDp500, 0);
animator_send_gift_task.setDuration(800);
animator_send_gift_task.setDuration(1000);
} else {
animator_send_gift_task = ObjectAnimator.ofFloat(new_task_send_gift_notify, "translationX", 0, mDp500);
animator_send_gift_task.setDuration(800);
animator_send_gift_task.setDuration(1000);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
new_task_send_gift_notify.setVisibility(View.GONE);
}
}, 1000);
}, 2000);
}
animator_send_gift_task.setInterpolator(new LinearInterpolator());
animator_send_gift_task.start();
@ -1218,7 +1218,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void showH5Dialog() {
Bundle bundle = new Bundle();
bundle.putString("url", CommonAppConfig.HOST + "/h5/activity/pdlNewUes/index.html?1=1");
bundle.putString("url", CommonAppConfig.HOST + "/h5/activity/pdlNewUes/index.html?uid="+CommonAppConfig.getInstance().getUid()+"&token="+CommonAppConfig.getInstance().getToken());
LiveHDDialogFragment fragment = new LiveHDDialogFragment();
fragment.setArguments(bundle);
fragment.show(((LiveActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
@ -2283,20 +2283,44 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
initPrankAdapter();
notify_follow_layout = findViewById(R.id.notify_follow_layout);
notify_follow_layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
L.e("其他區域");
}
});
notify_follow_coin = findViewById(R.id.notify_follow_coin);
notify_follow_name = findViewById(R.id.notify_follow_name);
follow_first_look = findViewById(R.id.follow_first_look);
close_first_look_follow = findViewById(R.id.close_first_look_follow);
new_task_gift_notify = findViewById(R.id.new_task_gift_notify);
new_task_gift_notify.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
L.e("其他區域");
}
});
new_task_gift_details = findViewById(R.id.new_task_gift_details);
close_task_receive_close = findViewById(R.id.close_task_receive_close);
new_task_gift_notify1 = findViewById(R.id.new_task_gift_notify1);
new_task_gift_notify1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
L.e("其他區域");
}
});
new_task_gift_details1 = findViewById(R.id.new_task_gift_details1);
close_task_receive_close1 = findViewById(R.id.close_task_receive_close1);
new_task_send_gift_notify = findViewById(R.id.new_task_send_gift_notify);
new_task_send_gift_notify.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
L.e("其他區域");
}
});
new_task_send_gift_details = findViewById(R.id.new_task_send_gift_details);
close_task_send_gift_close = findViewById(R.id.close_task_send_gift_close);

View File

@ -2,6 +2,7 @@ package com.yunbao.live.views;
import static com.yunbao.live.activity.LiveActivity.isSw;
import static com.yunbao.live.activity.LiveActivity.mLiveUid;
import static com.yunbao.live.activity.LiveActivity.mStream;
import static com.yunbao.live.activity.LiveSwAnchorActivity.PKing;
import static com.yunbao.live.activity.LiveSwAnchorActivity.pk_nub;
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.START_MESSAGE;
@ -52,6 +53,7 @@ import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.activity.LiveSwAnchorActivity;
import com.yunbao.live.activity.ZhuangBanActivity;
import com.yunbao.live.bean.WishlistModel;
import com.yunbao.live.dialog.LiveDataInfoDialog;
import com.yunbao.live.dialog.LiveHDDialogFragment;
import com.yunbao.live.dialog.LiveTaskDialog;
import com.yunbao.live.event.LiveAudienceEvent;
@ -244,6 +246,12 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
new XPopup.Builder(mContext).asCustom(new LiveAnchorMessageCustomPopup(mContext, mLiveUid)).show();
}
});
findViewById(R.id.live_time).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new LiveDataInfoDialog(mContext,mLiveUid, mStream).showDialog();
}
});
}
private Map<String, String> yaoqing = new HashMap<>();

View File

@ -906,6 +906,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
//初始化整蠱列表
mLiveRoomViewHolder.initPrankProgress(isShowPrank?1:2);
mLiveRoomViewHolder.setComAll(data.getEnterRoomInfo().getIsComAll().equals("1"));
L.e("getIsFirstEntry:"+data.getEnterRoomInfo().getIsFirstEntry());
L.e("getIsNewUser:"+data.getEnterRoomInfo().getIsNewUser());
L.e("getIsattention:"+data.getEnterRoomInfo().getIsattention());
//检测是否是首次观看该直播间
if(data.getEnterRoomInfo().getIsFirstEntry().equals("1")&&data.getEnterRoomInfo().getIsNewUser().equals("1")&&data.getEnterRoomInfo().getIsattention().equals("0")){
mLiveRoomViewHolder.firstLookLiveNotify();

View File

@ -3265,7 +3265,6 @@
android:layout_alignParentBottom="true"
android:layout_marginStart="35dp"
android:layout_marginEnd="65dp"
android:layout_toEndOf="@+id/notify_gift_receive_icon"
android:ellipsize="marquee"
android:scrollHorizontally="true"
android:layout_marginBottom="5dp"

View File

@ -10,7 +10,7 @@
android:id="@+id/live_time"
android:layout_width="wrap_content"
android:layout_height="23dp"
android:layout_marginTop="90dp"
android:layout_marginTop="88dp"
android:layout_gravity="end"
android:layout_centerVertical="true"
android:layout_marginEnd="10dp"

View File

@ -339,6 +339,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
SVGADrawable drawable = new SVGADrawable(videoItem);
gift_svga.setImageDrawable(drawable);
SVGAViewUtils.playEndClear(gift_svga, false);
gift_svga.setVisibility(View.VISIBLE);
}
@Override
@ -349,7 +350,12 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
e.printStackTrace();
}
} else {
ImgLoader.display(mContext, u.getDress().getAvatar_frame(), gift_svga);
if(StringUtil.isEmpty(u.getDress().getAvatar_frame())){
gift_svga.setVisibility(View.GONE);
}else{
gift_svga.setVisibility(View.VISIBLE);
ImgLoader.display(mContext, u.getDress().getAvatar_frame(), gift_svga);
}
}
}