10
.idea/gradle.xml
generated
10
.idea/gradle.xml
generated
@@ -64,16 +64,6 @@
|
||||
<option value="$PROJECT_DIR$/services" />
|
||||
<option value="$PROJECT_DIR$/services/mogo-service" />
|
||||
<option value="$PROJECT_DIR$/services/mogo-service-api" />
|
||||
<option value="$PROJECT_DIR$/skin" />
|
||||
<option value="$PROJECT_DIR$/skin/mogo-skin-light" />
|
||||
<option value="$PROJECT_DIR$/skin/mogo-skin-support" />
|
||||
<option value="$PROJECT_DIR$/skin/mogo-skin-support-impl" />
|
||||
<option value="$PROJECT_DIR$/skin/mogo-skin-support-noop" />
|
||||
<option value="$PROJECT_DIR$/skin/skin-support" />
|
||||
<option value="$PROJECT_DIR$/skin/skin-support-appcompat" />
|
||||
<option value="$PROJECT_DIR$/skin/skin-support-cardview" />
|
||||
<option value="$PROJECT_DIR$/skin/skin-support-constraint-layout" />
|
||||
<option value="$PROJECT_DIR$/skin/skin-support-design" />
|
||||
<option value="$PROJECT_DIR$/test" />
|
||||
<option value="$PROJECT_DIR$/test/crashreport" />
|
||||
<option value="$PROJECT_DIR$/test/crashreport-bugly" />
|
||||
|
||||
@@ -205,7 +205,7 @@ dependencies {
|
||||
}
|
||||
|
||||
apply from: "./functions/basedmap.gradle"
|
||||
apply from: "./functions/skin.gradle"
|
||||
// apply from: "./functions/skin.gradle"
|
||||
apply from: "./functions/tts.gradle"
|
||||
apply from: "./functions/och.gradle"
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ dependencies {
|
||||
implementation project(":foudations:mogo-utils")
|
||||
api project(":foudations:mogo-aicloud-services-sdk")
|
||||
api project(":tts:tts-base")
|
||||
implementation project(":skin:mogo-skin-support")
|
||||
// implementation project(":skin:mogo-skin-support")
|
||||
implementation project(':core:mogo-core-utils')
|
||||
}
|
||||
api 'org.greenrobot:eventbus:3.1.1'
|
||||
|
||||
@@ -17,10 +17,8 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.skin.support.MogoSkinManager;
|
||||
import com.mogo.utils.SoftKeyBoardJobber;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.permissions.PermissionsDialogUtils;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -28,7 +26,7 @@ import com.mogo.utils.permissions.PermissionsDialogUtils;
|
||||
* <p>
|
||||
* mvp 的 activity
|
||||
*/
|
||||
public abstract class MvpActivity< V extends IView, P extends Presenter< V > >
|
||||
public abstract class MvpActivity<V extends IView, P extends Presenter<V>>
|
||||
extends AppCompatActivity implements IView {
|
||||
|
||||
protected static final String TAG = "MvpActivity";
|
||||
@@ -36,17 +34,17 @@ public abstract class MvpActivity< V extends IView, P extends Presenter< V > >
|
||||
protected P mPresenter;
|
||||
|
||||
@Override
|
||||
protected void onCreate( @Nullable Bundle savedInstanceState ) {
|
||||
super.onCreate( savedInstanceState );
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
beforeSetContentView(savedInstanceState);
|
||||
if ( DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_BYD ) {
|
||||
requestWindowFeature( Window.FEATURE_NO_TITLE );
|
||||
getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN );
|
||||
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_BYD) {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
setContentView( getLayoutId() );
|
||||
setContentView(getLayoutId());
|
||||
initViews();
|
||||
mPresenter = createPresenter();
|
||||
getLifecycle().addObserver( mPresenter );
|
||||
getLifecycle().addObserver(mPresenter);
|
||||
//申请悬浮窗权限
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
// 检查是否有悬浮窗权限
|
||||
@@ -98,12 +96,12 @@ public abstract class MvpActivity< V extends IView, P extends Presenter< V > >
|
||||
//for new api versions.
|
||||
View decorView = getWindow().getDecorView();
|
||||
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY ;
|
||||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
}
|
||||
}
|
||||
|
||||
protected void beforeSetContentView(Bundle savedInstanceState){
|
||||
protected void beforeSetContentView(Bundle savedInstanceState) {
|
||||
|
||||
}
|
||||
|
||||
@@ -134,16 +132,16 @@ public abstract class MvpActivity< V extends IView, P extends Presenter< V > >
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchTouchEvent( MotionEvent ev ) {
|
||||
if ( ev.getAction() == MotionEvent.ACTION_DOWN && enableDispatchTouchEventToDismissSoftKeyBoard() ) {
|
||||
SoftKeyBoardJobber.hideIfNecessary( this, ev );
|
||||
return super.dispatchTouchEvent( ev );
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
if (ev.getAction() == MotionEvent.ACTION_DOWN && enableDispatchTouchEventToDismissSoftKeyBoard()) {
|
||||
SoftKeyBoardJobber.hideIfNecessary(this, ev);
|
||||
return super.dispatchTouchEvent(ev);
|
||||
}
|
||||
// 必不可少,否则所有的组件都不会有TouchEvent了
|
||||
if ( getWindow().superDispatchTouchEvent( ev ) ) {
|
||||
if (getWindow().superDispatchTouchEvent(ev)) {
|
||||
return true;
|
||||
}
|
||||
return onTouchEvent( ev );
|
||||
return onTouchEvent(ev);
|
||||
}
|
||||
|
||||
protected boolean enableDispatchTouchEventToDismissSoftKeyBoard() {
|
||||
@@ -153,17 +151,17 @@ public abstract class MvpActivity< V extends IView, P extends Presenter< V > >
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
getLifecycle().removeObserver( mPresenter );
|
||||
if ( mPresenter != null ) {
|
||||
getLifecycle().removeObserver( mPresenter );
|
||||
getLifecycle().removeObserver(mPresenter);
|
||||
if (mPresenter != null) {
|
||||
getLifecycle().removeObserver(mPresenter);
|
||||
}
|
||||
mPresenter = null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public AppCompatDelegate getDelegate() {
|
||||
return MogoSkinManager.getInstance().getInstaller().getSkinAppCompatDelegate(this,
|
||||
super.getDelegate(), this);
|
||||
}
|
||||
// @NonNull
|
||||
// @Override
|
||||
// public AppCompatDelegate getDelegate() {
|
||||
// return MogoSkinManager.getInstance().getInstaller().getSkinAppCompatDelegate(this,
|
||||
// super.getDelegate(), this);
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.view.LiveRoundLayout;
|
||||
import com.mogo.skin.support.IMogoSkinCompatSupportable;
|
||||
import com.mogo.skin.support.helper.MogoSkinCompatBackgroundHelperDelegate;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.tencent.rtmp.ITXLivePlayListener;
|
||||
import com.tencent.rtmp.TXLiveConstants;
|
||||
@@ -27,7 +25,7 @@ import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||
/**
|
||||
* V2XLiveGSYVideoView
|
||||
*/
|
||||
public class CameraLiveGSYVideoView extends LiveRoundLayout implements IMogoSkinCompatSupportable {
|
||||
public class CameraLiveGSYVideoView extends LiveRoundLayout {
|
||||
private static final String TAG = "CameraLiveGSYVideoView";
|
||||
private TXCloudVideoView mTxcVideoView;
|
||||
private ProgressBar mLoading;
|
||||
@@ -35,7 +33,6 @@ public class CameraLiveGSYVideoView extends LiveRoundLayout implements IMogoSkin
|
||||
private ConstraintLayout mClLoadError;
|
||||
private TextView mTvRefreshButton;
|
||||
|
||||
private MogoSkinCompatBackgroundHelperDelegate mBackgroundTintHelper;
|
||||
private String mLiveUrl;
|
||||
|
||||
|
||||
@@ -51,8 +48,6 @@ public class CameraLiveGSYVideoView extends LiveRoundLayout implements IMogoSkin
|
||||
super(context, attrs, defStyleAttr);
|
||||
initView(context);
|
||||
|
||||
mBackgroundTintHelper = new MogoSkinCompatBackgroundHelperDelegate(this);
|
||||
mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
private void initView(Context context) {
|
||||
@@ -175,10 +170,4 @@ public class CameraLiveGSYVideoView extends LiveRoundLayout implements IMogoSkin
|
||||
super.onDetachedFromWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applySkin() {
|
||||
if (mBackgroundTintHelper != null) {
|
||||
mBackgroundTintHelper.applySkin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,17 +8,13 @@ import android.graphics.RectF;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.skin.support.IMogoSkinCompatSupportable;
|
||||
import com.mogo.skin.support.helper.MogoSkinCompatBackgroundHelperDelegate;
|
||||
|
||||
|
||||
public class LiveRoundLayout extends RelativeLayout implements IMogoSkinCompatSupportable {
|
||||
public class LiveRoundLayout extends RelativeLayout {
|
||||
private float roundLayoutRadius = 14f;
|
||||
private Path roundPath;
|
||||
private RectF rectF;
|
||||
private MogoSkinCompatBackgroundHelperDelegate mBackgroundTintHelper;
|
||||
|
||||
public LiveRoundLayout(Context context) {
|
||||
this(context, null);
|
||||
@@ -37,8 +33,6 @@ public class LiveRoundLayout extends RelativeLayout implements IMogoSkinCompatSu
|
||||
|
||||
init();
|
||||
|
||||
mBackgroundTintHelper = new MogoSkinCompatBackgroundHelperDelegate(this);
|
||||
mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
|
||||
@@ -75,11 +69,5 @@ public class LiveRoundLayout extends RelativeLayout implements IMogoSkinCompatSu
|
||||
super.draw(canvas);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applySkin() {
|
||||
if (mBackgroundTintHelper != null) {
|
||||
mBackgroundTintHelper.applySkin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,6 @@ import android.widget.TextView;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
|
||||
import com.mogo.skin.support.IMogoSkinCompatSupportable;
|
||||
import com.mogo.skin.support.helper.MogoSkinCompatTextHelperDelegate;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
@@ -22,9 +19,8 @@ import java.lang.reflect.Field;
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class StrokeTextView extends AppCompatTextView implements IMogoSkinCompatSupportable {
|
||||
public class StrokeTextView extends AppCompatTextView {
|
||||
|
||||
private MogoSkinCompatTextHelperDelegate textHelperDelegate;
|
||||
|
||||
public StrokeTextView(Context context) {
|
||||
this(context,null);
|
||||
@@ -36,13 +32,11 @@ public class StrokeTextView extends AppCompatTextView implements IMogoSkinCompat
|
||||
|
||||
public StrokeTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
textHelperDelegate = new MogoSkinCompatTextHelperDelegate(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTextAppearance(Context context, int resId) {
|
||||
super.setTextAppearance(context, resId);
|
||||
textHelperDelegate.onSetTextAppearance(context, resId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,8 +88,4 @@ public class StrokeTextView extends AppCompatTextView implements IMogoSkinCompat
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applySkin() {
|
||||
textHelperDelegate.applySkin();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ dependencies {
|
||||
api project(':modules:mogo-module-common')
|
||||
api project(':services:mogo-service-api')
|
||||
api project(':services:mogo-service')
|
||||
compileOnly project(':skin:mogo-skin-support')
|
||||
// compileOnly project(':skin:mogo-skin-support')
|
||||
|
||||
implementation project(':core:mogo-core-data')
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.module.main;
|
||||
|
||||
import static com.mogo.module.main.MainPresenter.MOGO_PERMISSION_REQUEST_CODE;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
@@ -7,7 +9,6 @@ import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
@@ -37,7 +38,6 @@ import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.skin.support.SkinMode;
|
||||
import com.mogo.utils.NetworkUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.permissions.PermissionsDialogUtils;
|
||||
@@ -47,8 +47,6 @@ import com.zhidao.autopilot.support.api.AutopilotServiceManage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.module.main.MainPresenter.MOGO_PERMISSION_REQUEST_CODE;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
@@ -107,8 +105,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
*/
|
||||
private void installSkinManager(Bundle savedInstanceState) {
|
||||
mServiceApis.getMapServiceApi().getMapViewInstanceHandler().createMapViewInstance(this);
|
||||
mServiceApis.getSkinSupportInstallerApi().install(getApplication());
|
||||
mServiceApis.getSkinSupportInstallerApi().onCompensateActivityCreated(this, savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -311,10 +307,8 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
public void onMapUiModeChanged(EnumMapUI mapUI) {
|
||||
switch (mapUI) {
|
||||
case Type_Night:
|
||||
mServiceApis.getSkinSupportInstallerApi().loadSkin(SkinMode.Night);
|
||||
break;
|
||||
case Type_Light:
|
||||
mServiceApis.getSkinSupportInstallerApi().loadSkin(SkinMode.Light);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -422,7 +416,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
SchemeIntent.getInstance().clear();
|
||||
FloatingViewHandler.clear();
|
||||
mServiceApis.getShareManager().releaseContext();
|
||||
mServiceApis.getSkinSupportInstallerApi().onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.moduledata
|
||||
} else {
|
||||
api project(":libraries:mogo-map-api")
|
||||
api project(":skin:mogo-skin-support")
|
||||
// api project(":skin:mogo-skin-support")
|
||||
api project(':core:mogo-core-function-api')
|
||||
implementation project(':core:mogo-core-data')
|
||||
|
||||
|
||||
@@ -3,11 +3,13 @@ package com.mogo.service;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.auth.IMogoAuthManager;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.eagle.core.function.api.check.ICheckProvider;
|
||||
import com.mogo.service.cloud.location.IMogoLocationInfoService;
|
||||
import com.mogo.service.cloud.passport.IMogoPassportManager;
|
||||
import com.mogo.service.cloud.socket.IMogoSocketManager;
|
||||
import com.mogo.service.cloud.socket.IMogoWebSocketManager;
|
||||
import com.mogo.service.datamanager.IMogoDataManager;
|
||||
@@ -17,11 +19,8 @@ import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.imageloader.IMogoImageloader;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.launcher.IMogoLauncher;
|
||||
import com.mogo.service.cloud.location.IMogoLocationInfoService;
|
||||
import com.mogo.service.map.IMogoMapFrameController;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuProvider;
|
||||
import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider;
|
||||
import com.mogo.service.module.IMogoActionManager;
|
||||
import com.mogo.service.module.IMogoMarkerService;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
@@ -30,21 +29,18 @@ import com.mogo.service.module.IMogoSettingManager;
|
||||
import com.mogo.service.monitor.IMogoMonitorProvider;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
import com.mogo.service.obu.IMogoCrashWarnProvider;
|
||||
import com.mogo.service.cloud.passport.IMogoPassportManager;
|
||||
import com.mogo.service.share.IMogoShareManager;
|
||||
import com.mogo.service.share.IMogoTanluProvider;
|
||||
import com.mogo.service.share.IMogoTanluUiProvider;
|
||||
import com.mogo.service.share.IMogoTrafficUploadProvider;
|
||||
import com.mogo.service.statusmanager.IMogoMsgCenter;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.strategy.IMogoOnlineCarListPanelProvider;
|
||||
import com.mogo.service.strategy.IMogoRefreshStrategyController;
|
||||
import com.mogo.service.share.IMogoTanluProvider;
|
||||
import com.mogo.service.share.IMogoTanluUiProvider;
|
||||
import com.mogo.service.v2x.DisplayEffectsInterface;
|
||||
import com.mogo.service.v2x.IV2XProvider;
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider;
|
||||
import com.mogo.service.windowview.IMogoTopViewManager;
|
||||
import com.mogo.service.windowview.IMogoWindowManager;
|
||||
import com.mogo.skin.support.IMogoSkinSupportInstaller;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -279,13 +275,6 @@ public interface IMogoServiceApis extends IProvider {
|
||||
*/
|
||||
IMogoTanluUiProvider getTanluUiApi();
|
||||
|
||||
/**
|
||||
* 皮肤管理接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoSkinSupportInstaller getSkinSupportInstallerApi();
|
||||
|
||||
/**
|
||||
* 获取crashWarnProvider
|
||||
*
|
||||
|
||||
@@ -11,8 +11,6 @@ import androidx.annotation.Keep;
|
||||
|
||||
import com.facebook.drawee.view.GenericDraweeView;
|
||||
import com.mogo.service.R;
|
||||
import com.mogo.skin.support.IMogoSkinCompatSupportable;
|
||||
import com.mogo.skin.support.helper.MogoSkinCompatImageHelperDelegate;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -21,9 +19,7 @@ import com.mogo.skin.support.helper.MogoSkinCompatImageHelperDelegate;
|
||||
* 封装 facebook GenericDraweeView,实现占位图、失败占位图、形状、边框、模糊等效果
|
||||
*/
|
||||
@Keep
|
||||
public class MogoImageView extends GenericDraweeView implements IMogoSkinCompatSupportable {
|
||||
|
||||
private MogoSkinCompatImageHelperDelegate imageHelperDelegate;
|
||||
public class MogoImageView extends GenericDraweeView {
|
||||
|
||||
private int mPlaceHolder;
|
||||
private int mFailureHolder;
|
||||
@@ -43,43 +39,40 @@ public class MogoImageView extends GenericDraweeView implements IMogoSkinCompatS
|
||||
public static final int SHAPE_CIRCLE = 1;
|
||||
public static final int SHAPE_ROUND = 2;
|
||||
|
||||
public MogoImageView( Context context ) {
|
||||
this( context, null, 0 );
|
||||
public MogoImageView(Context context) {
|
||||
this(context, null, 0);
|
||||
}
|
||||
|
||||
public MogoImageView( Context context, AttributeSet attrs ) {
|
||||
this( context, attrs, 0 );
|
||||
public MogoImageView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public MogoImageView( Context context, AttributeSet attrs, int theme ) {
|
||||
super( context, attrs, theme );
|
||||
TypedArray arrays = context.obtainStyledAttributes( attrs, R.styleable.MogoImageView );
|
||||
mPlaceHolder = arrays.getResourceId( R.styleable.MogoImageView_miv_placeHolder, 0 );
|
||||
mFailureHolder = arrays.getResourceId( R.styleable.MogoImageView_miv_failureHolder, 0 );
|
||||
mOverlayImageId = arrays.getResourceId( R.styleable.MogoImageView_miv_overlayImageId, 0 );
|
||||
mShape = arrays.getInt( R.styleable.MogoImageView_miv_shape, SHAPE_NORMAL );
|
||||
mRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_miv_radius, 0 );
|
||||
mTopLeftRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_miv_topLeftRadius, 0 );
|
||||
mTopRightRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_miv_topRightRadius, 0 );
|
||||
mBottomLeftRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_miv_bottomLeftRadius, 0 );
|
||||
mBottomRightRadius = arrays.getDimensionPixelSize( R.styleable.MogoImageView_miv_bottomRightRadius, 0 );
|
||||
mBorderWidth = arrays.getDimensionPixelSize( R.styleable.MogoImageView_miv_shapeBorderWidth, 0 );
|
||||
mBorderColor = arrays.getColor( R.styleable.MogoImageView_miv_borderColor, Color.WHITE );
|
||||
mIsBlur = arrays.getBoolean( R.styleable.MogoImageView_miv_isBlur, false );
|
||||
mBlurRadius = arrays.getInt( R.styleable.MogoImageView_miv_blurRadius, 25 );
|
||||
public MogoImageView(Context context, AttributeSet attrs, int theme) {
|
||||
super(context, attrs, theme);
|
||||
TypedArray arrays = context.obtainStyledAttributes(attrs, R.styleable.MogoImageView);
|
||||
mPlaceHolder = arrays.getResourceId(R.styleable.MogoImageView_miv_placeHolder, 0);
|
||||
mFailureHolder = arrays.getResourceId(R.styleable.MogoImageView_miv_failureHolder, 0);
|
||||
mOverlayImageId = arrays.getResourceId(R.styleable.MogoImageView_miv_overlayImageId, 0);
|
||||
mShape = arrays.getInt(R.styleable.MogoImageView_miv_shape, SHAPE_NORMAL);
|
||||
mRadius = arrays.getDimensionPixelSize(R.styleable.MogoImageView_miv_radius, 0);
|
||||
mTopLeftRadius = arrays.getDimensionPixelSize(R.styleable.MogoImageView_miv_topLeftRadius, 0);
|
||||
mTopRightRadius = arrays.getDimensionPixelSize(R.styleable.MogoImageView_miv_topRightRadius, 0);
|
||||
mBottomLeftRadius = arrays.getDimensionPixelSize(R.styleable.MogoImageView_miv_bottomLeftRadius, 0);
|
||||
mBottomRightRadius = arrays.getDimensionPixelSize(R.styleable.MogoImageView_miv_bottomRightRadius, 0);
|
||||
mBorderWidth = arrays.getDimensionPixelSize(R.styleable.MogoImageView_miv_shapeBorderWidth, 0);
|
||||
mBorderColor = arrays.getColor(R.styleable.MogoImageView_miv_borderColor, Color.WHITE);
|
||||
mIsBlur = arrays.getBoolean(R.styleable.MogoImageView_miv_isBlur, false);
|
||||
mBlurRadius = arrays.getInt(R.styleable.MogoImageView_miv_blurRadius, 25);
|
||||
arrays.recycle();
|
||||
|
||||
imageHelperDelegate = new MogoSkinCompatImageHelperDelegate( this );
|
||||
imageHelperDelegate.loadFromAttributes( attrs, theme );
|
||||
setImageResource( mPlaceHolder );
|
||||
setImageResource(mPlaceHolder);
|
||||
}
|
||||
|
||||
public void setRadius( float radius ) {
|
||||
this.mRadius = ( int ) radius;
|
||||
public void setRadius(float radius) {
|
||||
this.mRadius = (int) radius;
|
||||
}
|
||||
|
||||
public void setRadius( int[] radius ) {
|
||||
if ( radius != null && radius.length == 8 ) {
|
||||
public void setRadius(int[] radius) {
|
||||
if (radius != null && radius.length == 8) {
|
||||
mTopLeftRadius = radius[0] >= radius[1] ? radius[0] : radius[1];
|
||||
mTopRightRadius = radius[2] >= radius[3] ? radius[2] : radius[3];
|
||||
mBottomRightRadius = radius[4] >= radius[5] ? radius[4] : radius[5];
|
||||
@@ -87,35 +80,35 @@ public class MogoImageView extends GenericDraweeView implements IMogoSkinCompatS
|
||||
}
|
||||
}
|
||||
|
||||
public void setShape( int shape ) {
|
||||
public void setShape(int shape) {
|
||||
this.mShape = shape;
|
||||
}
|
||||
|
||||
public void setBorderWidth( int width ) {
|
||||
public void setBorderWidth(int width) {
|
||||
this.mBorderWidth = width;
|
||||
}
|
||||
|
||||
public void setBorderColor( int color ) {
|
||||
public void setBorderColor(int color) {
|
||||
this.mBorderColor = color;
|
||||
}
|
||||
|
||||
public void setPlaceHolder( int placeHolder ) {
|
||||
public void setPlaceHolder(int placeHolder) {
|
||||
this.mPlaceHolder = placeHolder;
|
||||
}
|
||||
|
||||
public void setFailureHolder( int failureHolder ) {
|
||||
public void setFailureHolder(int failureHolder) {
|
||||
this.mFailureHolder = failureHolder;
|
||||
}
|
||||
|
||||
public void setOverlayImageId( @DrawableRes int overlayImageId ) {
|
||||
public void setOverlayImageId(@DrawableRes int overlayImageId) {
|
||||
this.mOverlayImageId = overlayImageId;
|
||||
}
|
||||
|
||||
public void setBlur( boolean isBlur ) {
|
||||
public void setBlur(boolean isBlur) {
|
||||
this.mIsBlur = isBlur;
|
||||
}
|
||||
|
||||
public void setBlurRadius( int blurRadius ) {
|
||||
public void setBlurRadius(int blurRadius) {
|
||||
this.mBlurRadius = blurRadius;
|
||||
}
|
||||
|
||||
@@ -136,7 +129,7 @@ public class MogoImageView extends GenericDraweeView implements IMogoSkinCompatS
|
||||
}
|
||||
|
||||
public float[] getRadii() {
|
||||
if ( mTopLeftRadius != 0 || mTopRightRadius != 0 || mBottomRightRadius != 0 || mBottomLeftRadius != 0 ) {
|
||||
if (mTopLeftRadius != 0 || mTopRightRadius != 0 || mBottomRightRadius != 0 || mBottomLeftRadius != 0) {
|
||||
float[] radii = {mTopLeftRadius, mTopLeftRadius, mTopRightRadius, mTopRightRadius,
|
||||
mBottomRightRadius, mBottomRightRadius, mBottomLeftRadius, mBottomLeftRadius};
|
||||
return radii;
|
||||
@@ -167,33 +160,19 @@ public class MogoImageView extends GenericDraweeView implements IMogoSkinCompatS
|
||||
|
||||
public String getParams() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append( mIsBlur ).append( mBlurRadius )
|
||||
.append( mShape ).append( mRadius )
|
||||
.append( mBorderWidth ).append( mBorderColor );
|
||||
builder.append(mIsBlur).append(mBlurRadius)
|
||||
.append(mShape).append(mRadius)
|
||||
.append(mBorderWidth).append(mBorderColor);
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImageResource( int resId ) {
|
||||
super.setImageResource( resId );
|
||||
if ( imageHelperDelegate != null ) {
|
||||
imageHelperDelegate.setImageResource( resId );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解决共享动画无效的问题
|
||||
*
|
||||
* @param matrix
|
||||
*/
|
||||
public void animateTransform( Matrix matrix ) {
|
||||
public void animateTransform(Matrix matrix) {
|
||||
invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applySkin() {
|
||||
if ( imageHelperDelegate != null ) {
|
||||
imageHelperDelegate.applySkin();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,8 +49,6 @@ import com.mogo.service.v2x.DisplayEffectsInterface;
|
||||
import com.mogo.service.v2x.IV2XProvider;
|
||||
import com.mogo.service.windowview.IMogoTopViewManager;
|
||||
import com.mogo.service.windowview.IMogoWindowManager;
|
||||
import com.mogo.skin.support.IMogoSkinSupportInstaller;
|
||||
import com.mogo.skin.support.SkinSupportInstallerConstants;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
@@ -233,11 +231,6 @@ public class MogoServiceApis implements IMogoServiceApis {
|
||||
return getApiInstance(IMogoTanluUiProvider.class, MogoServicePaths.PATH_TANLU_UI_API);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoSkinSupportInstaller getSkinSupportInstallerApi() {
|
||||
return getApiInstance(IMogoSkinSupportInstaller.class, SkinSupportInstallerConstants.PATH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoCrashWarnProvider getCrashWarnProvider() {
|
||||
return getApiInstance(IMogoCrashWarnProvider.class, MogoServicePaths.PATH_CRASH_WARNING);
|
||||
|
||||
@@ -81,15 +81,15 @@ include ':test:crashreport-noop'
|
||||
include ':test:crashreport-upgrade'
|
||||
|
||||
// 换肤
|
||||
include ':skin:skin-support'
|
||||
include ':skin:skin-support-appcompat'
|
||||
include ':skin:skin-support-cardview'
|
||||
include ':skin:skin-support-constraint-layout'
|
||||
include ':skin:skin-support-design'
|
||||
include ':skin:mogo-skin-light'
|
||||
include ':skin:mogo-skin-support-impl'
|
||||
include ':skin:mogo-skin-support-noop'
|
||||
include ':skin:mogo-skin-support'
|
||||
//include ':skin:skin-support'
|
||||
//include ':skin:skin-support-appcompat'
|
||||
//include ':skin:skin-support-cardview'
|
||||
//include ':skin:skin-support-constraint-layout'
|
||||
//include ':skin:skin-support-design'
|
||||
//include ':skin:mogo-skin-light'
|
||||
//include ':skin:mogo-skin-support-impl'
|
||||
//include ':skin:mogo-skin-support-noop'
|
||||
//include ':skin:mogo-skin-support'
|
||||
|
||||
// 网约车
|
||||
include ':OCH:mogo-och-taxi'
|
||||
|
||||
Reference in New Issue
Block a user