合并黑夜白天模式等需求
This commit is contained in:
@@ -34,6 +34,7 @@ public class V2XEventPanelModuleProvider implements
|
||||
|
||||
@Override
|
||||
public Fragment createFragment(Context context, Bundle data) {
|
||||
V2XServiceManager.init(context);
|
||||
return V2XEventPanelFragment.Companion.getInstance();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,9 @@ import android.os.Handler;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.v2x.listener.V2XLocationListener;
|
||||
import com.mogo.module.v2x.network.V2XRefreshCallback;
|
||||
import com.mogo.module.v2x.network.V2XRefreshModel;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -18,7 +20,7 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
* desc :
|
||||
* version: 1.0
|
||||
*/
|
||||
public class V2XMarkerService {
|
||||
public class V2XMarkerService implements V2XRefreshCallback<MarkerResponse> {
|
||||
private final String TAG = "V2XMarkerService";
|
||||
|
||||
// 一分钟获取一次最新的路况信息
|
||||
@@ -48,12 +50,13 @@ public class V2XMarkerService {
|
||||
public void refreshMarkerData(MogoLocation location) {
|
||||
try {
|
||||
if (mV2XRefreshModel != null && location != null) {
|
||||
//Logger.d(MODULE_NAME, "V2X道路事件:执行气泡刷新操作。");
|
||||
Logger.d(MODULE_NAME, "V2X道路事件:执行气泡刷新操作。");
|
||||
// 获取目前最新的周边的poi点
|
||||
mV2XRefreshModel.querySnapshotAsync(
|
||||
mV2XRefreshModel.querySnapshotSync(
|
||||
new MogoLatLng(location.getLatitude(), location.getLongitude()),
|
||||
(int) getMapCameraFactWidth(),
|
||||
999);
|
||||
999,
|
||||
this);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -105,4 +108,16 @@ public class V2XMarkerService {
|
||||
}
|
||||
refreshHandler.post(refreshRunnable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(MarkerResponse result) {
|
||||
if (V2XSocketManager.getInstance().getV2XMessageListener_401011() != null) {
|
||||
V2XSocketManager.getInstance().getV2XMessageListener_401011().onMsgReceived(result);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String msg) {
|
||||
Logger.e(TAG, "刷新V2X道路事件异常请检查参数");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,6 +275,7 @@ public class V2XModuleProvider implements
|
||||
* 刷新自车求助状态
|
||||
*/
|
||||
private void initCarForHelpStatus() {
|
||||
Logger.d(MODULE_NAME, "刷新自车求助状态……");
|
||||
//本地查询是否超时
|
||||
V2XServiceManager.getV2XRefreshModel().getHelpSignal(new V2XRefreshCallback<V2XSeekHelpRes>() {
|
||||
@Override
|
||||
@@ -282,18 +283,15 @@ public class V2XModuleProvider implements
|
||||
if (result != null) {
|
||||
V2XSeekHelpRes.ResultBean resultBean = result.getResult();
|
||||
if (resultBean != null) {
|
||||
Logger.d(MODULE_NAME, "刷新自车求助状态 resultBean:"+resultBean);
|
||||
int vehicleType = resultBean.getVehicleType();
|
||||
//故障车
|
||||
if (vehicleType == 4) {
|
||||
if (!V2XServiceManager.getMoGoStatusManager().isSeekHelping()) {
|
||||
refreshMeSeekHelp(true);
|
||||
V2XServiceManager.getMoGoStatusManager().setSeekHelping(MODULE_NAME, true);
|
||||
}
|
||||
refreshMeSeekHelp(true);
|
||||
V2XServiceManager.getMoGoStatusManager().setSeekHelping(MODULE_NAME, true);
|
||||
} else {
|
||||
if (V2XServiceManager.getMoGoStatusManager().isSeekHelping()) {
|
||||
refreshMeSeekHelp(false);
|
||||
V2XServiceManager.getMoGoStatusManager().setSeekHelping(MODULE_NAME, false);
|
||||
}
|
||||
refreshMeSeekHelp(false);
|
||||
V2XServiceManager.getMoGoStatusManager().setSeekHelping(MODULE_NAME, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@ import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.carchattingprovider.ICarsChattingProvider;
|
||||
import com.mogo.module.v2x.alarm.V2XCalculateServer;
|
||||
import com.mogo.module.v2x.network.V2XRefreshModel;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XMarkerManager;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XPolylineManager;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XStatusManager;
|
||||
import com.mogo.module.v2x.network.V2XRefreshModel;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
@@ -45,6 +45,9 @@ import com.zhidao.carchattingprovider.CallChattingProviderConstant;
|
||||
*/
|
||||
public class V2XServiceManager {
|
||||
private static final String TAG = "V2XServiceManager";
|
||||
|
||||
private static boolean isInit;
|
||||
|
||||
private static Context mContext;
|
||||
private static IMogoServiceApis mMogoServiceApis;
|
||||
|
||||
@@ -88,45 +91,49 @@ public class V2XServiceManager {
|
||||
|
||||
|
||||
public static void init(final Context context) {
|
||||
mContext = context;
|
||||
mMogoServiceApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
|
||||
if (!isInit) {
|
||||
isInit = true;
|
||||
|
||||
mMapService = mMogoServiceApis.getMapServiceApi();
|
||||
mImageLoader = mMogoServiceApis.getImageLoaderApi();
|
||||
mMogoStatusManager = mMogoServiceApis.getStatusManagerApi();
|
||||
mMogoSocketManager = mMogoServiceApis.getSocketManagerApi(context);
|
||||
mMogoAnalytics = mMogoServiceApis.getAnalyticsApi();
|
||||
mIMogoWindowManager = mMogoServiceApis.getWindowManagerApi();
|
||||
mMogoRegisterCenter = mMogoServiceApis.getRegisterCenterApi();
|
||||
mIMogoRefreshStrategyController = mMogoServiceApis.getRefreshStrategyControllerApi();
|
||||
mIMogoADASController = mMogoServiceApis.getAdasControllerApi();
|
||||
mMogoEntranceButtonController = mMogoServiceApis.getEntranceButtonController();
|
||||
mMogoActionManager = mMogoServiceApis.getActionManagerApi();
|
||||
mMogoTopViewManager = mMogoServiceApis.getTopViewManager();
|
||||
mIMogoSearchManager = mMogoServiceApis.getSearchManagerApi();
|
||||
mIMogoMarkerService = mMogoServiceApis.getMarkerService();
|
||||
mIMogoShareManager = mMogoServiceApis.getShareManager();
|
||||
mIMogoTanluProvider = mMogoServiceApis.getTanluApi();
|
||||
mContext = context;
|
||||
mMogoServiceApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
|
||||
|
||||
mMarkerManager = mMapService.getMarkerManager(context);
|
||||
mNavi = mMapService.getNavi(context);
|
||||
mMapUIController = mMapService.getMapUIController();
|
||||
mMogoLocationClient = mMapService.getSingletonLocationClient(context);
|
||||
mMogoOverlayManager = mMapService.getOverlayManager(context);
|
||||
mIMogoGeoSearch = mMapService.getGeoSearch(context);
|
||||
mMapService = mMogoServiceApis.getMapServiceApi();
|
||||
mImageLoader = mMogoServiceApis.getImageLoaderApi();
|
||||
mMogoStatusManager = mMogoServiceApis.getStatusManagerApi();
|
||||
mMogoSocketManager = mMogoServiceApis.getSocketManagerApi(context);
|
||||
mMogoAnalytics = mMogoServiceApis.getAnalyticsApi();
|
||||
mIMogoWindowManager = mMogoServiceApis.getWindowManagerApi();
|
||||
mMogoRegisterCenter = mMogoServiceApis.getRegisterCenterApi();
|
||||
mIMogoRefreshStrategyController = mMogoServiceApis.getRefreshStrategyControllerApi();
|
||||
mIMogoADASController = mMogoServiceApis.getAdasControllerApi();
|
||||
mMogoEntranceButtonController = mMogoServiceApis.getEntranceButtonController();
|
||||
mMogoActionManager = mMogoServiceApis.getActionManagerApi();
|
||||
mMogoTopViewManager = mMogoServiceApis.getTopViewManager();
|
||||
mIMogoSearchManager = mMogoServiceApis.getSearchManagerApi();
|
||||
mIMogoMarkerService = mMogoServiceApis.getMarkerService();
|
||||
mIMogoShareManager = mMogoServiceApis.getShareManager();
|
||||
mIMogoTanluProvider = mMogoServiceApis.getTanluApi();
|
||||
|
||||
mCarsChattingProvider = (ICarsChattingProvider) ARouter.getInstance().build(CallChattingProviderConstant.CAR_CALL_PROVIDER).navigation();
|
||||
mMogoIntentManager = mMogoServiceApis.getIntentManagerApi();
|
||||
mMarkerManager = mMapService.getMarkerManager(context);
|
||||
mNavi = mMapService.getNavi(context);
|
||||
mMapUIController = mMapService.getMapUIController();
|
||||
mMogoLocationClient = mMapService.getSingletonLocationClient(context);
|
||||
mMogoOverlayManager = mMapService.getOverlayManager(context);
|
||||
mIMogoGeoSearch = mMapService.getGeoSearch(context);
|
||||
|
||||
mV2XRefreshModel = V2XRefreshModel.getInstance(context);
|
||||
mV2XMarkerService = V2XMarkerService.getInstance(context);
|
||||
mV2XStatusManager = V2XStatusManager.getInstance();
|
||||
mV2XSocketManager = V2XSocketManager.getInstance();
|
||||
mV2XCalculateServer = V2XCalculateServer.getInstance();
|
||||
mCarsChattingProvider = (ICarsChattingProvider) ARouter.getInstance().build(CallChattingProviderConstant.CAR_CALL_PROVIDER).navigation();
|
||||
mMogoIntentManager = mMogoServiceApis.getIntentManagerApi();
|
||||
|
||||
moGoV2XMarkerManager = (IMoGoV2XMarkerManager) ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_MARKER_MANAGER).navigation(context);
|
||||
moGoV2XPolylineManager = (IMoGoV2XPolylineManager) ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_POLYLINE_MANAGER).navigation(context);
|
||||
moGoV2XStatusManager = (IMoGoV2XStatusManager) ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_STATUS_MANAGER).navigation(context);
|
||||
mV2XRefreshModel = V2XRefreshModel.getInstance(context);
|
||||
mV2XMarkerService = V2XMarkerService.getInstance(context);
|
||||
mV2XStatusManager = V2XStatusManager.getInstance();
|
||||
mV2XSocketManager = V2XSocketManager.getInstance();
|
||||
mV2XCalculateServer = V2XCalculateServer.getInstance();
|
||||
|
||||
moGoV2XMarkerManager = (IMoGoV2XMarkerManager) ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_MARKER_MANAGER).navigation(context);
|
||||
moGoV2XPolylineManager = (IMoGoV2XPolylineManager) ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_POLYLINE_MANAGER).navigation(context);
|
||||
moGoV2XStatusManager = (IMoGoV2XStatusManager) ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_STATUS_MANAGER).navigation(context);
|
||||
}
|
||||
}
|
||||
|
||||
public static Context getContext() {
|
||||
@@ -258,5 +265,4 @@ public class V2XServiceManager {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -120,6 +120,10 @@ public class V2XSocketManager {
|
||||
);
|
||||
}
|
||||
|
||||
public V2XMessageListener_401011 getV2XMessageListener_401011() {
|
||||
return v2XMessageListener_401011;
|
||||
}
|
||||
|
||||
/**
|
||||
* 道路事件,服务端下发
|
||||
*/
|
||||
|
||||
@@ -11,7 +11,9 @@ import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
|
||||
import com.mogo.module.common.glide.SkinAbleBitmapTarget;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
|
||||
import com.mogo.module.v2x.listener.SurroundingItemClickListener;
|
||||
@@ -84,22 +86,20 @@ public class V2XSurroundingAdapter extends RecyclerView.Adapter<V2XSurroundingVi
|
||||
.load(getTypeRes(surroundingConstruction.getPoiType()))
|
||||
.into(mBgImageView);
|
||||
|
||||
// CornerTransform transformation = new CornerTransform(mContext, dip2px(mContext, 15));
|
||||
// //只是绘制左上角和右上角圆角
|
||||
// transformation.setExceptCorner(true, true, false, false);
|
||||
//
|
||||
// Glide.with(mContext).
|
||||
// load(getTypeRes(surroundingConstruction.getPoiType()))
|
||||
// .asBitmap()
|
||||
// .skipMemoryCache(true)
|
||||
// .diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||
// .transform(transformation)
|
||||
// .into(mBgImageView);
|
||||
//
|
||||
// Glide.with(mContext)
|
||||
// .load(getTypeSmallRes(surroundingConstruction.getPoiType()))
|
||||
// .into(mTypeImageView);
|
||||
|
||||
RequestOptions requestOptions = new RequestOptions()
|
||||
.placeholder(R.drawable.v2x_icon_live_logo)
|
||||
.error(R.drawable.v2x_icon_live_logo)
|
||||
.fallback(R.drawable.v2x_icon_live_logo);
|
||||
Glide.with(mContext)
|
||||
.asBitmap()
|
||||
.load(getTypeSmallRes(surroundingConstruction.getPoiType()))
|
||||
.into(mTypeImageView);
|
||||
.apply(requestOptions)
|
||||
.into(new SkinAbleBitmapTarget(mTypeImageView, requestOptions));
|
||||
|
||||
}
|
||||
|
||||
public static int dip2px(Context context, float dpValue) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.module.v2x.fragment;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
@@ -37,7 +38,7 @@ public class V2XScenarioHistoryFragment
|
||||
private String TAG = "ScenarioHistoryFragment";
|
||||
|
||||
private V2XListEmptyView mEmptyView;
|
||||
private CoordinatorLayout mClHistoryList;
|
||||
private LinearLayout mClHistoryList;
|
||||
private RecyclerView mRecyclerView;
|
||||
private V2XScenarioHistoryAdapter mV2XScenarioHistoryAdapter;
|
||||
private ArrayList<V2XHistoryScenarioData> mV2XHistoryScenarioData = new ArrayList<>();
|
||||
|
||||
@@ -182,7 +182,8 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
|
||||
SpannableString spannableString = new SpannableString(originStr);
|
||||
spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#459DFF")), 7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
//设置字体大小,true表示前面的字体大小 dip
|
||||
spannableString.setSpan(new AbsoluteSizeSpan(46, true), 7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
spannableString.setSpan(new AbsoluteSizeSpan((int) getContext().getResources().getDimension(R.dimen.module_v2x_surrounding_top), true),
|
||||
7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
spannableString.setSpan(new StyleSpan(Typeface.NORMAL), 7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
mTotalTv.setText(spannableString);
|
||||
} else {
|
||||
|
||||
@@ -39,12 +39,19 @@ public interface V2XApiService {
|
||||
Observable<BaseData> refreshHeartBeat(@FieldMap Map<String, Object> liveBroadcast);
|
||||
|
||||
/**
|
||||
* 刷新地图气泡点
|
||||
* 刷新地图气泡点,异步获取
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/yycp-launcherSnapshot/launcherSnapshot/querySnapshotAsync")
|
||||
Observable<BaseData> querySnapshotAsync(@FieldMap Map<String, Object> parameters);
|
||||
|
||||
/**
|
||||
* 刷新地图气泡点,同步获取
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/yycp-launcherSnapshot/launcherSnapshot/querySnapshotSync")
|
||||
Observable<MarkerResponse> querySnapshotSync(@FieldMap Map<String, Object> parameters);
|
||||
|
||||
/**
|
||||
* 直播点赞
|
||||
*/
|
||||
|
||||
@@ -67,7 +67,7 @@ public class V2XRefreshModel {
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新地图点数据
|
||||
* 刷新地图点数据,同步获取
|
||||
*/
|
||||
public void querySnapshotAsync(MogoLatLng latLng, int radius, int limit) {
|
||||
if (mV2XApiService != null) {
|
||||
@@ -96,6 +96,42 @@ public class V2XRefreshModel {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新地图点数据,同步获取
|
||||
*/
|
||||
public void querySnapshotSync(MogoLatLng latLng, int radius, int limit, final V2XRefreshCallback<MarkerResponse> callback) {
|
||||
if (mV2XApiService != null) {
|
||||
final Map<String, Object> query = new ParamsProvider.Builder(mContext).build();
|
||||
final RefreshBody refreshBody = new RefreshBody();
|
||||
refreshBody.limit = limit;
|
||||
refreshBody.location = new RefreshBody.LatLon(latLng.lat, latLng.lon);
|
||||
refreshBody.radius = radius;
|
||||
refreshBody.dataType.add(ServiceConst.CARD_TYPE_ROAD_CONDITION);
|
||||
refreshBody.viewPush = true;
|
||||
query.put("data", GsonUtil.jsonFromObject(refreshBody));
|
||||
mV2XApiService.querySnapshotSync(query)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<MarkerResponse>(RequestOptions.create(mContext)) {
|
||||
@Override
|
||||
public void onSuccess(MarkerResponse o) {
|
||||
super.onSuccess(o);
|
||||
if (callback != null) {
|
||||
callback.onSuccess(o);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String message, int code) {
|
||||
super.onError(message, code);
|
||||
if (callback != null) {
|
||||
callback.onFail(message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 触发刷新直播心跳
|
||||
*
|
||||
|
||||
@@ -10,8 +10,6 @@ import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.scenario.impl.AbsV2XScenario;
|
||||
import com.mogo.module.v2x.scenario.scene.seek.V2XSeekHelpButton;
|
||||
import com.mogo.module.v2x.scenario.scene.seek.V2XSeekHelpDialog;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceConstants;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.v2x.scenario.scene.seek;
|
||||
package com.mogo.module.v2x.scenario.scene.help;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
@@ -70,12 +70,12 @@ public class V2XSeekHelpButton implements IV2XButton {
|
||||
if (tv != null) {
|
||||
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("将为您取消", null);
|
||||
tv.setVisibility(View.GONE);
|
||||
V2XServiceManager
|
||||
.getV2XRefreshModel().cancelHelpSignal(new V2XRefreshCallback<BaseData>() {
|
||||
V2XServiceManager.getV2XRefreshModel().cancelHelpSignal(new V2XRefreshCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData result) {
|
||||
tv.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String msg) {
|
||||
tv.setVisibility(View.VISIBLE);
|
||||
@@ -85,6 +85,7 @@ public class V2XSeekHelpButton implements IV2XButton {
|
||||
}
|
||||
unRegisterVoice();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerVoice() {
|
||||
V2XVoiceManager.INSTANCE.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CANCEL_HELP, cancelCb);
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.module.v2x.scenario.scene.seek;
|
||||
package com.mogo.module.v2x.scenario.scene.help;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.module.v2x.view;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
@@ -7,9 +8,19 @@ import android.graphics.Path;
|
||||
import android.graphics.RectF;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatCallback;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.skin.support.IMogoSkinCompatSupportable;
|
||||
import com.mogo.skin.support.IMogoSkinSupportInstaller;
|
||||
import com.mogo.skin.support.MogoSkinManager;
|
||||
import com.mogo.skin.support.SkinMode;
|
||||
import com.mogo.skin.support.helper.MogoSkinCompatBackgroundHelperDelegate;
|
||||
import com.mogo.skin.support.helper.MogoSkinCompatHelperDelegate;
|
||||
import com.mogo.skin.support.helper.MogoSkinCompatTextHelperDelegate;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
@@ -18,23 +29,19 @@ import com.mogo.module.v2x.R;
|
||||
* desc :
|
||||
* version: 1.0
|
||||
*/
|
||||
public class RoundConstraintLayout extends ConstraintLayout {
|
||||
public class RoundConstraintLayout extends ConstraintLayout implements IMogoSkinCompatSupportable {
|
||||
|
||||
private float roundLayoutRadius = 14f;
|
||||
private Path roundPath;
|
||||
private RectF rectF;
|
||||
private MogoSkinCompatBackgroundHelperDelegate mBackgroundTintHelper;
|
||||
|
||||
public RoundConstraintLayout(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public RoundConstraintLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
this(context, attrs);
|
||||
}
|
||||
|
||||
public RoundConstraintLayout(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
this(context, attrs, 0);
|
||||
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RoundLayout);
|
||||
roundLayoutRadius = typedArray.getDimensionPixelSize(R.styleable.RoundLayout_roundLayoutRadius, (int) roundLayoutRadius);
|
||||
typedArray.recycle();
|
||||
@@ -42,6 +49,13 @@ public class RoundConstraintLayout extends ConstraintLayout {
|
||||
init();
|
||||
}
|
||||
|
||||
public RoundConstraintLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
mBackgroundTintHelper = new MogoSkinCompatBackgroundHelperDelegate(this);
|
||||
mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
|
||||
private void init() {
|
||||
setWillNotDraw(false);//如果你继承的是ViewGroup,注意此行,否则draw方法是不会回调的;
|
||||
roundPath = new Path();
|
||||
@@ -74,4 +88,12 @@ public class RoundConstraintLayout extends ConstraintLayout {
|
||||
}
|
||||
super.draw(canvas);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applySkin() {
|
||||
if (mBackgroundTintHelper != null) {
|
||||
mBackgroundTintHelper.applySkin();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
@@ -24,6 +24,7 @@ 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.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.tencent.rtmp.ITXLivePlayListener;
|
||||
@@ -41,7 +42,7 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
* desc :
|
||||
* version: 1.0
|
||||
*/
|
||||
public class V2XLiveGSYVideoView extends RoundLayout {
|
||||
public class V2XLiveGSYVideoView extends RoundLayout implements IMogoSkinCompatSupportable {
|
||||
private final String TAG = "V2XLiveGSYVideoView";
|
||||
|
||||
private TXCloudVideoView mTxcVideoView;
|
||||
@@ -278,4 +279,9 @@ public class V2XLiveGSYVideoView extends RoundLayout {
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_REFRESH_LIVE_UN_WAKEUP);
|
||||
super.onDetachedFromWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applySkin() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user