@@ -10,8 +10,6 @@ import android.util.AttributeSet;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.skin.support.IMogoSkinCompatSupportable;
|
||||
import com.mogo.skin.support.helper.MogoSkinCompatBackgroundHelperDelegate;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
@@ -20,12 +18,11 @@ import com.mogo.skin.support.helper.MogoSkinCompatBackgroundHelperDelegate;
|
||||
* desc :
|
||||
* version: 1.0
|
||||
*/
|
||||
public class RoundConstraintLayout extends ConstraintLayout implements IMogoSkinCompatSupportable {
|
||||
public class RoundConstraintLayout extends ConstraintLayout {
|
||||
|
||||
private float roundLayoutRadius = 14f;
|
||||
private Path roundPath;
|
||||
private RectF rectF;
|
||||
private MogoSkinCompatBackgroundHelperDelegate mBackgroundTintHelper;
|
||||
|
||||
public RoundConstraintLayout(Context context) {
|
||||
this(context, null);
|
||||
@@ -42,8 +39,6 @@ public class RoundConstraintLayout extends ConstraintLayout implements IMogoSkin
|
||||
|
||||
public RoundConstraintLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
mBackgroundTintHelper = new MogoSkinCompatBackgroundHelperDelegate(this);
|
||||
mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
|
||||
@@ -80,11 +75,4 @@ public class RoundConstraintLayout extends ConstraintLayout implements IMogoSkin
|
||||
super.draw(canvas);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applySkin() {
|
||||
if (mBackgroundTintHelper != null) {
|
||||
mBackgroundTintHelper.applySkin();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,8 +9,6 @@ import android.util.AttributeSet;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.skin.support.IMogoSkinCompatSupportable;
|
||||
import com.mogo.skin.support.helper.MogoSkinCompatBackgroundHelperDelegate;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
@@ -19,11 +17,10 @@ import com.mogo.skin.support.helper.MogoSkinCompatBackgroundHelperDelegate;
|
||||
* desc :
|
||||
* version: 1.0
|
||||
*/
|
||||
public class RoundLayout extends RelativeLayout implements IMogoSkinCompatSupportable {
|
||||
public class RoundLayout extends RelativeLayout {
|
||||
private float roundLayoutRadius = 14f;
|
||||
private Path roundPath;
|
||||
private RectF rectF;
|
||||
private MogoSkinCompatBackgroundHelperDelegate mBackgroundTintHelper;
|
||||
|
||||
public RoundLayout(Context context) {
|
||||
this(context, null);
|
||||
@@ -42,8 +39,6 @@ public class RoundLayout extends RelativeLayout implements IMogoSkinCompatSuppor
|
||||
|
||||
init();
|
||||
|
||||
mBackgroundTintHelper = new MogoSkinCompatBackgroundHelperDelegate(this);
|
||||
mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
|
||||
@@ -80,19 +75,5 @@ public class RoundLayout extends RelativeLayout implements IMogoSkinCompatSuppor
|
||||
super.draw(canvas);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBackgroundResource(int resId) {
|
||||
super.setBackgroundResource(resId);
|
||||
if (mBackgroundTintHelper != null) {
|
||||
mBackgroundTintHelper.onSetBackgroundResource(resId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applySkin() {
|
||||
if (mBackgroundTintHelper != null) {
|
||||
mBackgroundTintHelper.applySkin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.module.v2x.view;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.PorterDuff;
|
||||
@@ -16,13 +18,10 @@ import androidx.core.content.ContextCompat;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.module.common.entity.MarkerCarInfo;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceConstants;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
import com.mogo.skin.support.IMogoSkinCompatSupportable;
|
||||
import com.mogo.skin.support.helper.MogoSkinCompatBackgroundHelperDelegate;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.tencent.rtmp.ITXLivePlayListener;
|
||||
@@ -31,8 +30,6 @@ import com.tencent.rtmp.TXLivePlayConfig;
|
||||
import com.tencent.rtmp.TXLivePlayer;
|
||||
import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
@@ -40,7 +37,7 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
* desc :
|
||||
* version: 1.0
|
||||
*/
|
||||
public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatSupportable {
|
||||
public class V2XLiveGSYVideoView extends RoundLayout {
|
||||
private final String TAG = "V2XLiveGSYVideoView";
|
||||
|
||||
private TXCloudVideoView mTxcVideoView;
|
||||
@@ -48,8 +45,6 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS
|
||||
private TXLivePlayer mLivePlayer;
|
||||
private ConstraintLayout mClLoadError;
|
||||
|
||||
private final MogoSkinCompatBackgroundHelperDelegate mBackgroundTintHelper;
|
||||
|
||||
private MarkerCarInfo.CarLiveInfo mCarLiveInfo;
|
||||
// 重新刷新直播流
|
||||
private final V2XVoiceCallbackListener v2XVoiceCallbackRefreshListener = new V2XVoiceCallbackListener() {
|
||||
@@ -75,14 +70,12 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS
|
||||
super(context, attrs, defStyleAttr);
|
||||
initView(context);
|
||||
|
||||
mBackgroundTintHelper = new MogoSkinCompatBackgroundHelperDelegate(this);
|
||||
mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
private void initView(Context context) {
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_video_layout_normal, this);
|
||||
//mPlayerView 即 step1 中添加的界面 view
|
||||
//mPlayerView 即 step1 中添加的界面 view
|
||||
mTxcVideoView = findViewById(R.id.txcVideoView);
|
||||
//创建 player 对象
|
||||
mLivePlayer = new TXLivePlayer(context);
|
||||
@@ -145,10 +138,10 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS
|
||||
mLivePlayer.setPlayListener(new ITXLivePlayListener() {
|
||||
@Override
|
||||
public void onPlayEvent(int event, Bundle bundle) {
|
||||
// Logger.i(MODULE_NAME,
|
||||
// "直播信息= " + GsonUtil.jsonFromObject(carLiveInfo) +
|
||||
// "\n播放器:onPlayEvent==" + event +
|
||||
// "\nbundle===" + bundle);
|
||||
// Logger.i(MODULE_NAME,
|
||||
// "直播信息= " + GsonUtil.jsonFromObject(carLiveInfo) +
|
||||
// "\n播放器:onPlayEvent==" + event +
|
||||
// "\nbundle===" + bundle);
|
||||
if (event == TXLiveConstants.PLAY_EVT_PLAY_LOADING) {
|
||||
mLoading.setVisibility(VISIBLE);
|
||||
mClLoadError.setVisibility(GONE);
|
||||
@@ -171,7 +164,7 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS
|
||||
|
||||
@Override
|
||||
public void onNetStatus(Bundle bundle) {
|
||||
// Logger.i(MODULE_NAME, "播放器:onNetStatus===bundle===" + bundle);
|
||||
// Logger.i(MODULE_NAME, "播放器:onNetStatus===bundle===" + bundle);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -192,24 +185,24 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS
|
||||
mLivePlayer.stopPlay(true);
|
||||
mTxcVideoView.onDestroy();
|
||||
|
||||
// if (carLiveInfo.getVideoUrl() != null) {
|
||||
// return;
|
||||
// }
|
||||
// if (carLiveInfo.getVideoUrl() != null) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// 停止推流
|
||||
// V2XServiceManager
|
||||
// .getV2XRefreshModel()
|
||||
// .livePush(new V2XRefreshCallback<V2XLivePushVoRes>() {
|
||||
// @Override
|
||||
// public void onSuccess(V2XLivePushVoRes result) {
|
||||
// Logger.d(MODULE_NAME, "播放器:" + result);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFail(String msg) {
|
||||
// Logger.e(MODULE_NAME, "播放器:" + msg);
|
||||
// }
|
||||
// }, carLiveInfo.getVideoSn(), 1);
|
||||
// V2XServiceManager
|
||||
// .getV2XRefreshModel()
|
||||
// .livePush(new V2XRefreshCallback<V2XLivePushVoRes>() {
|
||||
// @Override
|
||||
// public void onSuccess(V2XLivePushVoRes result) {
|
||||
// Logger.d(MODULE_NAME, "播放器:" + result);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFail(String msg) {
|
||||
// Logger.e(MODULE_NAME, "播放器:" + msg);
|
||||
// }
|
||||
// }, carLiveInfo.getVideoSn(), 1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -234,10 +227,4 @@ public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatS
|
||||
super.onDetachedFromWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applySkin() {
|
||||
if (mBackgroundTintHelper != null) {
|
||||
mBackgroundTintHelper.applySkin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user