侧边栏修改,直播关播页面BUg修改

This commit is contained in:
18401019693 2022-11-16 17:22:34 +08:00
parent 38f6f2f451
commit 1d50f8e4f5
21 changed files with 132 additions and 75 deletions

View File

@ -100,6 +100,7 @@ public class RouteUtil {
}
Constants.myUrl = url + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&t=" + System.currentTimeMillis();
ARouter.getInstance().build(PATH_MYWEBVIEWACTIVTITY)
.withString(Constants.URL,url)
.navigation();
}
@ -118,7 +119,8 @@ public class RouteUtil {
*/
public static void forwardZhuangBanActivity(String url, boolean isFull) {
ARouter.getInstance().build(PATH_ZHUANGBANACTIVITY)
.withString("title", "")
.withString("url", url)
.withBoolean("isFull", isFull)
.navigation();
}

View File

@ -44,7 +44,7 @@ public class DrawerRecommendChildViewHolder extends RecyclerView.ViewHolder {
IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo();
StringBuffer htmlUrl = new StringBuffer();
if (model.getSrc().contains("?")) {
htmlUrl.append(model.getSrc())
htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc())
.append("&uid=")
.append(userInfo.getId())
.append("&token=")

View File

@ -52,7 +52,7 @@ public class DrawerRecommendViewHolder extends RecyclerView.ViewHolder {
if (TextUtils.equals(model.getSrc(), "recharge")) {
htmlUrl.append("recharge");
} else if (model.getSrc().contains("?")) {
htmlUrl.append(model.getSrc())
htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc())
.append("&uid=")
.append(userInfo.getId())
.append("&token=")

View File

@ -38,7 +38,25 @@ public class DrawerTaskChildViewHolder extends RecyclerView.ViewHolder {
}
public void setData(CustomSidebarChildModel model, int index) {
ImgLoader.display2(itemView.getContext(), model.getIcon(), icon);
int iconImg = R.mipmap.icon_012x;
switch (model.getFlag()) {
case "send_coin_gift":
iconImg = R.mipmap.icon_012x;
break;
case "send_gold_gift":
iconImg = R.mipmap.icon_022x;
break;
case "attention":
iconImg = R.mipmap.icon_032x;
break;
case "bullet_screen":
iconImg = R.mipmap.icon_042x;
break;
case "illumine":
iconImg = R.mipmap.icon_052x;
break;
}
ImgLoader.display(itemView.getContext(), iconImg, icon);
StringBuffer titleBuffer = new StringBuffer();
titleBuffer
.append(model.getTitle())
@ -70,7 +88,6 @@ public class DrawerTaskChildViewHolder extends RecyclerView.ViewHolder {
public void onViewClicks() {
if (TextUtils.equals(model.getStatus(), "2")) {
LiveNetManager.get(itemView.getContext())
.sendTaskGift(model.getFlag(), new HttpCallback<String>() {

View File

@ -52,7 +52,7 @@ public class DrawerTaskViewHolder extends RecyclerView.ViewHolder {
IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo();
StringBuffer htmlUrl = new StringBuffer();
if (model.getSrc().contains("?")) {
htmlUrl.append(model.getSrc())
htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc())
.append("&uid=")
.append(userInfo.getId())
.append("&token=")

View File

@ -54,7 +54,7 @@ public class FunGamesChildViewHolder extends RecyclerView.ViewHolder {
IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo();
StringBuffer htmlUrl = new StringBuffer();
if (model.getSrc().contains("?")) {
htmlUrl.append(model.getSrc())
htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc())
.append("&uid=")
.append(userInfo.getId())
.append("&token=")

View File

@ -62,7 +62,7 @@ public class FunGamesViewHolder extends RecyclerView.ViewHolder {
IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo();
StringBuffer htmlUrl = new StringBuffer();
if (model.getSrc().contains("?")) {
htmlUrl.append(model.getSrc())
htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc())
.append("&uid=")
.append(userInfo.getId())
.append("&token=")

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -10,9 +10,9 @@ ext {
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",

View File

@ -640,6 +640,9 @@ public class LiveAudienceActivity extends LiveActivity {
public void onLiveRoomChangeEvent(LiveRoomChangeEvent e) {
if (verticalViewPager.ismEnableScroll()) {
LiveBean liveBean = e.getLiveBean();
if (e.isLiveEnd()) {
manager.removeLiveEnd();
}
if (liveBean != null) {
LiveHttpUtil.cancel(LiveHttpConsts.CHECK_LIVE);
LiveHttpUtil.cancel(LiveHttpConsts.ENTER_ROOM);

View File

@ -31,6 +31,7 @@ import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.event.JavascriptInterfaceEvent;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.JavascriptInterfaceUtils;
import com.yunbao.common.utils.L;
@ -66,6 +67,7 @@ public class WebViewActivityMedal extends AbsActivity {
@Override
protected void main() {
Bus.getOn(this);
String url = getIntent().getStringExtra(Constants.URL);
L.e("H5---3>" + url);
LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView);
@ -300,6 +302,7 @@ public class WebViewActivityMedal extends AbsActivity {
@Override
protected void onDestroy() {
Bus.getOff(this);
if (mWebView != null) {
ViewGroup parent = (ViewGroup) mWebView.getParent();
if (parent != null) {

View File

@ -1,5 +1,6 @@
package com.yunbao.live.dialog;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.text.SpannableStringBuilder;
@ -52,16 +53,16 @@ public class VoiceDialog extends AbsDialogFragment {
@Override
public void onStop() {
super.onStop();
}
public String sendMessage() {
if (mIat != null) {
mIat.cancel();
mIat.destroy();
mIat = null;
}
}
public String sendMessage() {
return WordsTypeUtil.changeTraditional(builder.toString());
}
@ -88,12 +89,6 @@ public class VoiceDialog extends AbsDialogFragment {
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
params.gravity = Gravity.CENTER;
window.setAttributes(params);
handler.postDelayed(new Runnable() {
@Override
public void run() {
}
}, 30000);
}
@Override
@ -111,7 +106,6 @@ public class VoiceDialog extends AbsDialogFragment {
voiceChat = (TextView) findViewById(R.id.voice_chat);
fingersSlide = (TextView) findViewById(R.id.fingers_slide);
gifView = (GifImageView) findViewById(R.id.gif_view);
startRecognize();
iconWithdraw.setVisibility(View.GONE);
gifView.setVisibility(View.GONE);
voiceFluctuations.setVisibility(View.VISIBLE);
@ -131,6 +125,7 @@ public class VoiceDialog extends AbsDialogFragment {
* 上划取消
*/
public void withdraw() {
if (mIat != null) {
mIat.stopListening();
if (!isDetached()) {
voiceFluctuations.setVisibility(View.GONE);
@ -141,11 +136,13 @@ public class VoiceDialog extends AbsDialogFragment {
}
}
}
/**
* 上划取消
*/
public void notWithdraw() {
startRecognize();
public void notWithdraw(Context context) {
startRecognize(context);
if (!isDetached()) {
if (TextUtils.isEmpty(sendMessage())) {
if (gifView.getVisibility() != View.VISIBLE)
@ -227,9 +224,9 @@ public class VoiceDialog extends AbsDialogFragment {
/**
* 开始识别
*/
public void startRecognize() {
public void startRecognize(Context context) {
if (null == mIat) {
mIat = SpeechRecognizer.createRecognizer(getContext(), mInitListener);
mIat = SpeechRecognizer.createRecognizer(context, mInitListener);
}
if (mIat.isListening()) {
return;

View File

@ -11,6 +11,16 @@ public class LiveRoomChangeEvent {
private LiveBean mLiveBean;
private int mLiveType;//直播间的类型 普通 密码 门票 计时等
private int mLiveTypeVal;//收费价格,计时收费每次扣费的值
private boolean isLiveEnd = false;
public boolean isLiveEnd() {
return isLiveEnd;
}
public LiveRoomChangeEvent setLiveEnd(boolean liveEnd) {
isLiveEnd = liveEnd;
return this;
}
public LiveRoomChangeEvent(LiveBean bean, int liveType, int liveTypeVal) {
mLiveBean = bean;

View File

@ -311,6 +311,10 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
if (mProcessResultUtil.checkPermissions(new String[]{Manifest.permission.RECORD_AUDIO})) {
//按下
handler.postDelayed(mLongPressed, 500);
if (voiceDialog == null) {
voiceDialog = new VoiceDialog();
voiceDialog.startRecognize(mContext);
}
} else {
mProcessResultUtil.requestPermissions(new String[]{Manifest.permission.RECORD_AUDIO}, new Runnable() {
@Override
@ -328,7 +332,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
}
if ((downY - moveY < 100) && (downY - moveY > 30)) {
if (voiceDialog != null && voiceDialog.isAdded())
voiceDialog.notWithdraw();
voiceDialog.notWithdraw(mContext);
}
} else if (event.getAction() == MotionEvent.ACTION_UP) {
//松开
@ -360,8 +364,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
Vibrator vibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
vibrator.vibrate(100);//震动时间(ms)
if (voiceDialog == null) {
voiceDialog = new VoiceDialog();
voiceDialog.setListener(new VoiceDialog.VoiceListener() {
@Override
public void timeout() {
@ -381,7 +384,6 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
}
}
});
}
voiceDialog.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "VoiceDialog");
Bus.get().post(new LiveAudienceEvent()
.setVoicePress(true)

View File

@ -17,6 +17,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSON;
import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.bean.SetAttentsModel;
import com.yunbao.common.event.CloseEvent;
import com.yunbao.common.glide.ImgLoader;
@ -34,12 +35,13 @@ import com.yunbao.live.activity.LiveAnchorActivity;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.adapter.SearchRecommendBodyAdapter;
import com.yunbao.common.bean.LiveBean;
import com.yunbao.live.event.JumpUserHomeEvent;
import com.yunbao.live.event.LiveRoomChangeEvent;
import com.yunbao.live.http.LiveHttpConsts;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
@ -317,15 +319,7 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList
if (liveBean == null) {
return;
}
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
if (mContext instanceof LiveAnchorActivity) {
((LiveAnchorActivity) mContext).superBackPressed();
} else if (mContext instanceof LiveAudienceActivity) {
((LiveAudienceActivity) mContext).exitLiveRoom();
} else if (mContext instanceof LiveRyAnchorActivity) {
((LiveRyAnchorActivity) mContext).superBackPressed();
}
EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal).setLiveEnd(true));
}
});

View File

@ -11,7 +11,6 @@ import android.content.Intent;
import android.content.res.Configuration;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
@ -321,6 +320,36 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
public void removeLiveEnd() {
if (mLiveAudienceViewHolder != null) {
mLiveAudienceViewHolder.removeFromParent();
mLiveAudienceViewHolder.removeCallbacks();
mLiveAudienceViewHolder.release();
}
//结束播放
if (mLivePlayViewHolder != null) {
mLivePlayViewHolder.removeFromParent();
mLivePlayViewHolder.stopPlay();
mLivePlayViewHolder.release();
}
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.removeFromParent();
mLiveRoomViewHolder.clearData();
mLiveRoomViewHolder.countDownTimerTrickery = null;
}
if (mLiveEndViewHolder != null) {
mLiveEndViewHolder.removeFromParent();
mLiveEndViewHolder.release();
}
mLiveEndViewHolder = null;
mLiveAudienceViewHolder = null;
mLivePlayViewHolder = null;
mLiveRoomViewHolder = null;
mLiveLinkMicPresenter = null;
mLiveLinkMicAnchorPresenter = null;
mLiveRyLinkMicPkPresenter = null;
}
@Override
public void onRemove(boolean isQuit) {
LiveHttpUtil.cancel(LiveHttpConsts.CHECK_LIVE);
@ -379,10 +408,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveEndViewHolder.removeFromParent();
mLiveEndViewHolder.release();
}
mLiveEndViewHolder = null;
mLiveAudienceViewHolder = null;
mLivePlayViewHolder = null;
mLiveRoomViewHolder = null;
mLiveEndViewHolder = null;
mLiveLinkMicPresenter = null;
mLiveLinkMicAnchorPresenter = null;
mLiveRyLinkMicPkPresenter = null;

View File

@ -215,7 +215,6 @@
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:layout_marginTop="14dp"
android:text=":"
android:textColor="#70ffffff"
android:textSize="13.33sp" />
@ -224,7 +223,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="7dp"
android:layout_marginTop="17dp"
android:layout_marginTop="14dp"
android:textColor="#70ffffff"
android:textSize="13.33sp" />
@ -400,6 +399,7 @@
android:id="@+id/live_duration_anchor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="0"
android:textColor="@color/white"
android:textSize="16sp"