Merge branch '930' into dev_MogoAP_eagle-1030_211020_8.0.14

This commit is contained in:
liujing
2021-10-27 19:44:51 +08:00
28 changed files with 842 additions and 75 deletions

View File

@@ -304,7 +304,8 @@ public class MogoApplication extends AbsMogoApplication {
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_V2X_FRONT_CRASH_WARNING, "IV2XManagerProvider"));
// 全局语音唤醒
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_GLOBAL_UNWAKE, "GlobalUnwake"));
// 云公告发布
MogoModulePaths.addModuleFunction(new MogoModule(MogoServicePaths.PATH_AI_NOTICE, "IMoGoNoticeProvider"));
if (!DebugConfig.isLauncher()) {
PersistentManager.getInstance().initManager(this);

View File

@@ -1,28 +0,0 @@
package com.mogo.eagle.core.function.check.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import com.mogo.eagle.core.function.check.R;
import java.util.jar.Attributes;
/**
* @author liujing
* @description 描述
* @since: 10/13/21
*/
public class CheckRecyclerFooter extends View {
public CheckRecyclerFooter(Context context, AttributeSet attributes) {
super(context, attributes);
LayoutInflater.from(context).inflate(R.layout.check_recycler_footer, null);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}

View File

@@ -48,6 +48,7 @@ dependencies {
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.arouter
implementation rootProject.ext.dependencies.rxandroid
implementation rootProject.ext.dependencies.androidxrecyclerview
kapt rootProject.ext.dependencies.aroutercompiler

View File

@@ -0,0 +1,67 @@
package com.mogo.eagle.core.function.hmi.ui.notice;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.eagle.core.data.notice.NoticeInfo;
import com.mogo.eagle.core.function.hmi.R;
/**
* @author liujing
* @description 云公告顶部弹框
* @since: 10/26/21
*/
public class NoticeBannerView extends ConstraintLayout {
private ImageView styleImageView;
private ImageView iconImageView;
private TextView noticePushTitle;
private TextView noticePushContent;
private TextView noticeBannerCheck;
private NoticeTrafficDialog mNoticeTrafficDialog;
private Context mContext;
public NoticeBannerView(@NonNull Context context) {
super(context);
mContext = context;
LayoutInflater.from(context).inflate(R.layout.notice_push_top_banner, this);
initView();
}
public NoticeBannerView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public NoticeBannerView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public NoticeBannerView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public void initView() {
styleImageView = findViewById(R.id.notice_push_style_image);
iconImageView = findViewById(R.id.notice_push_icon_video);
noticePushTitle = findViewById(R.id.notice_push_title);
noticePushContent = findViewById(R.id.notice_push_content);
noticeBannerCheck = findViewById(R.id.notice_push_banner_check);
noticeBannerCheck.setOnClickListener(v -> {
mNoticeTrafficDialog = new NoticeTrafficDialog(mContext);
mNoticeTrafficDialog.show();
});
}
//数据改变刷新UI
public void pushBeanChanged(NoticeInfo info){
}
}

View File

@@ -0,0 +1,55 @@
package com.mogo.eagle.core.function.hmi.ui.notice;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.function.hmi.R;
/**
* @author liujing
* @description 描述
* @since: 10/26/21
*/
class NoticeTrafficAdapter extends RecyclerView.Adapter {
LayoutInflater mLayoutInflater;
public NoticeTrafficAdapter(@NonNull Context context) {
mLayoutInflater = LayoutInflater.from(context);
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = mLayoutInflater.inflate(R.layout.notice_traffice_info_list_adapter, parent,
false);
TrafficInfoHolder holder = new TrafficInfoHolder(v);
return holder;
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return 18;
}
public class TrafficInfoHolder extends RecyclerView.ViewHolder {
private TextView keyText;
private TextView valueText;
public TrafficInfoHolder(@NonNull View itemView) {
super(itemView);
keyText = itemView.findViewById(R.id.key_text_view);
valueText = itemView.findViewById(R.id.value_text_view);
}
}
}

View File

@@ -0,0 +1,50 @@
package com.mogo.eagle.core.function.hmi.ui.notice;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.module.common.dialog.BaseFloatDialog;
import java.util.List;
/**
* @author liujing
* @description 描述
* @since: 10/26/21
*/
public class NoticeTrafficDialog extends BaseFloatDialog {
private Context mContext;
private RecyclerView mRecyclerView;
public NoticeTrafficDialog(@NonNull Context context) {
super(context);
mContext = context;
initView();
}
public NoticeTrafficDialog(@NonNull Context context, int themeResId) {
super(context, themeResId);
}
public void initView() {
mRecyclerView = findViewById(R.id.traffic_info_recyclerView);
//网格布局
GridLayoutManager layoutManager = new GridLayoutManager(mContext, 4);
mRecyclerView.setLayoutManager(layoutManager);
layoutManager.setOrientation(GridLayoutManager.VERTICAL);
//网格绘制
try {
NoticeTrafficInfoGridItemDivider gridLayoutDivider = new NoticeTrafficInfoGridItemDivider(1,
(mContext.getResources().getColor(R.color.notice_dialog_back)));
mRecyclerView.addItemDecoration(gridLayoutDivider);
} catch (Exception e) {
e.printStackTrace();
}
NoticeTrafficAdapter adapter = new NoticeTrafficAdapter(mContext);
mRecyclerView.setAdapter(adapter);
}
}

View File

@@ -0,0 +1,165 @@
package com.mogo.eagle.core.function.hmi.ui.notice;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.view.View;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
/**
* @author liujing
* @description 网格布局网格绘制类
* @since: 9/22/21
*/
public class NoticeTrafficInfoGridItemDivider extends RecyclerView.ItemDecoration {
private String TAG = getClass().getSimpleName();
private static final int[] ATTRS = new int[]{android.R.attr.listDivider};
private Drawable divider;
public NoticeTrafficInfoGridItemDivider(Context context) {
final TypedArray a = context.obtainStyledAttributes(ATTRS);
divider = a.getDrawable(0);
a.recycle();
}
public NoticeTrafficInfoGridItemDivider(Drawable drawable) {
divider = drawable;
}
public NoticeTrafficInfoGridItemDivider(int height, int color) {
GradientDrawable shapeDrawable = new GradientDrawable();
shapeDrawable.setColor(color);
shapeDrawable.setShape(GradientDrawable.RECTANGLE);
shapeDrawable.setSize(height, height);
divider = shapeDrawable;
}
@Override
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
drawHorizontal(c, parent);
drawVertical(c, parent);
}
private int getSpanCount(RecyclerView parent) {
// 列数
int spanCount = -1;
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
if (layoutManager instanceof GridLayoutManager) {
spanCount = ((GridLayoutManager) layoutManager).getSpanCount();
} else if (layoutManager instanceof StaggeredGridLayoutManager) {
spanCount = ((StaggeredGridLayoutManager) layoutManager)
.getSpanCount();
}
return spanCount;
}
public void drawHorizontal(Canvas c, RecyclerView parent) {
int childCount = parent.getChildCount(); //获取可见item的数量
int spanCount = getSpanCount(parent);
for (int i = 0; i < childCount; i++) {
final View child = parent.getChildAt(i);
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
.getLayoutParams();
final int left = child.getLeft() - params.leftMargin;
final int right = child.getRight() + params.rightMargin
+ divider.getIntrinsicWidth();
final int top = child.getBottom() + params.bottomMargin;
final int bottom = top + divider.getIntrinsicHeight();
divider.setBounds(left, top, right, bottom);
divider.draw(c);
if (i < spanCount) { //画第一行顶部的分割线
drawHorizontalForFirstRow(c, child);
}
}
}
private void drawHorizontalForFirstRow(Canvas c, View child) {
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
.getLayoutParams();
int left = child.getLeft() - params.leftMargin - divider.getIntrinsicWidth();
int top = child.getTop() - params.topMargin - divider.getIntrinsicHeight();
int right = child.getRight() + params.rightMargin + divider.getIntrinsicWidth();
int bottom = top + divider.getIntrinsicHeight();
divider.setBounds(left, top, right, bottom);
divider.draw(c);
}
private void drawVerticalForFirstColum(Canvas c, View child) {
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
.getLayoutParams();//在父布局的
int left = child.getLeft() - params.leftMargin - divider.getIntrinsicWidth();
int top = child.getTop() - params.topMargin;
int right = child.getLeft() - params.leftMargin;
int bottom = top + child.getHeight() + divider.getIntrinsicHeight();
divider.setBounds(left, top, right, bottom);
divider.draw(c);
}
public void drawVertical(Canvas c, RecyclerView parent) {
final int childCount = parent.getChildCount();
for (int i = 0; i < childCount; i++) {
final View child = parent.getChildAt(i);
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
.getLayoutParams();
final int top = child.getTop() - params.topMargin;
final int bottom = child.getBottom() + params.bottomMargin;
final int left = child.getRight() + params.rightMargin;
final int right = left + divider.getIntrinsicWidth();
divider.setBounds(left, top, right, bottom);
divider.draw(c);
if (isFirstColum(parent, i, getSpanCount(parent))) { //画第一列左边分割线
drawVerticalForFirstColum(c, child);
}
}
}
//是否为第一列
private boolean isFirstColum(RecyclerView parent, int pos, int spanCount) {
RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
if (layoutManager instanceof GridLayoutManager) { //网格布局
if ((pos + 1) % spanCount == 1) {
return true;
}
}
return false;
}
//是否为第一行
private boolean isFirstRaw(int pos, int spanCount) {
if (pos < spanCount) {
return true;
}
return false;
}
@Override
public void getItemOffsets(Rect outRect, int itemPosition,
RecyclerView parent) {
int spanCount = getSpanCount(parent); //列数
if (itemPosition == 0) { //第一行第一个,四边都画
outRect.set(divider.getIntrinsicWidth(), divider.getIntrinsicHeight(),
divider.getIntrinsicWidth(), divider.getIntrinsicHeight());
} else if (isFirstRaw(itemPosition, spanCount)) { //第一行,画上下右三边
outRect.set(0, divider.getIntrinsicHeight(), divider.getIntrinsicWidth(), divider.getIntrinsicHeight());
} else if (isFirstColum(parent, itemPosition, spanCount)) { //第一列,画左右下三边
outRect.set(divider.getIntrinsicWidth(), 0, divider.getIntrinsicWidth(), divider.getIntrinsicHeight());
} else { //其他,画右下两边
outRect.set(0, 0, divider.getIntrinsicWidth(), divider.getIntrinsicHeight());
}
}
}

View File

@@ -0,0 +1,42 @@
package com.mogo.eagle.core.function.hmi.ui.notice;
import android.content.Context;
import android.util.AttributeSet;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.function.hmi.R;
/**
* @author liujing
* @description 交通事故任务详情
* @since: 10/26/21
*/
public class NoticeTrafficInfoView extends RecyclerView {
private int maxHeight = (int) getContext().getResources().getDimension(R.dimen.notice_traffic_info_width);
private int maxWeight = (int) getContext().getResources().getDimension(R.dimen.notice_traffic_info_height);
public NoticeTrafficInfoView(@NonNull Context context) {
super(context);
}
public NoticeTrafficInfoView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public NoticeTrafficInfoView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onMeasure(int widthSpec, int heightSpec) {
super.onMeasure(widthSpec, heightSpec);
int limitHeight = getMeasuredHeight();
if (getMeasuredHeight() > maxHeight) {
limitHeight = maxHeight;
}
setMeasuredDimension(maxWeight, limitHeight);
}
}

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?><!--<selector xmlns:android="http://schemas.android.com/apk/res/android">-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="135"
android:endColor="#80000000"
android:startColor="#80000000"
android:type="linear" />
<corners android:radius="@dimen/dp_30" />
</shape>

View File

@@ -30,7 +30,28 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--图/视频-->
<ImageView
android:id="@+id/back_image"
android:layout_width="@dimen/notice_traffic_acc_image_width"
android:layout_height="@dimen/notice_traffic_acc_image_height"
android:layout_marginLeft="@dimen/dp_200"
android:layout_marginTop="@dimen/dp_50"
android:layout_marginRight="@dimen/dp_200"
android:src="@drawable/notice_unsuccess_image"
app:layout_constraintBottom_toTopOf="@+id/module_push_dialog_bottom_title"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/notice_traffic_dialog_title" />
<!--事故来源等事故详情-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/traffic_info_recyclerView"
android:layout_width="@dimen/notice_traffic_info_width"
android:layout_height="@dimen/notice_traffic_info_height"
android:layout_marginTop="@dimen/dp_38"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/back_image" />
<!--分割线-->
<ImageView
android:id="@+id/traffic_top_line"
@@ -53,9 +74,10 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="接受"
android:text="接 受"
android:textColor="@color/notice_text_blue"
android:textSize="@dimen/dp_50"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="@+id/traffic_middle_line"
@@ -64,9 +86,10 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="拒绝"
android:textColor="@color/notice_text_blue"
android:text="拒 绝"
android:textColor="#FFF"
android:textSize="@dimen/dp_50"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@+id/traffic_middle_line"
app:layout_constraintRight_toRightOf="parent"

View File

@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/dp_1066"
android:layout_height="@dimen/dp_230"
android:layout_marginTop="@dimen/dp_20"
android:background="@drawable/notice_push_item_background">
<ImageView
android:id="@+id/notice_push_style_image"
android:layout_width="@dimen/dp_230"
android:layout_height="@dimen/dp_230"
android:scaleType="fitXY"
android:src="@drawable/notice_banner_default"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/notice_push_icon_video"
android:layout_width="@dimen/dp_62"
android:layout_height="@dimen/dp_45"
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginBottom="@dimen/dp_18"
android:src="@drawable/notice_banner_icon_video"
app:layout_constraintBottom_toBottomOf="@+id/notice_push_image"
app:layout_constraintLeft_toLeftOf="@+id/notice_push_image" />
<LinearLayout
android:id="@+id/module_push_app_icon_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_220"
android:gravity="center_vertical"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/module_push_image"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/notice_push_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center_vertical|left"
android:maxWidth="@dimen/dp_184"
android:maxLength="25"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_46"
app:layout_constrainedWidth="true"
tools:text="官方公告" />
<TextView
android:id="@+id/notice_push_content"
android:layout_width="@dimen/dp_588"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_22"
android:ellipsize="end"
android:gravity="top|left"
android:maxLines="2"
android:paddingRight="@dimen/dp_10"
android:text="这是测试数据,当前测试数据是为了查看换行的显示效果,如果最多3行呢,怎么显示的呢"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_36" />
</LinearLayout>
<View
android:id="@+id/notice_banner_line"
android:layout_width="@dimen/dp_2"
android:layout_height="@dimen/dp_120"
android:layout_marginRight="@dimen/dp_208"
android:background="#FFF"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/module_push_app_icon_title"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/notice_push_banner_check"
android:layout_width="@dimen/dp_100"
android:layout_height="match_parent"
android:layout_marginRight="@dimen/dp_67"
android:clickable="true"
android:focusable="true"
android:gravity="center"
android:text="查看"
android:textColor="@color/notice_banner_blue"
android:textSize="@dimen/dp_42"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@+id/notice_banner_line"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/dp_580"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/key_text_view"
android:layout_width="@dimen/dp_180"
android:layout_height="@dimen/dp_50"
android:gravity="left|center"
android:text="事故来源:"
android:textColor="#FFF"
android:textSize="@dimen/dp_36" />
<TextView
android:id="@+id/value_text_view"
android:layout_width="@dimen/dp_180"
android:layout_height="wrap_content"
android:gravity="left|center"
android:maxLines="2"
android:text="平台发布平台发布平台发布平台发布"
android:textColor="#FFF"
android:textSize="@dimen/dp_36"
android:textStyle="bold" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -2,6 +2,8 @@
<resources>
<color name="notice_blue">#2B6EFF</color>
<color name="notice_text_blue">#1F9BFE</color>
<color name="notice_banner_blue">#5A8EFD</color>
<color name="notice_check_dialog_bg_color">#E63B4577</color>
<color name="notice_traffic_line">#D5D5D4</color>
<color name="notice_dialog_back">#3B4577</color>
</resources>

View File

@@ -4,14 +4,30 @@
<dimen name="module_push_dialog_check_accessory_height">1200px</dimen>
<dimen name="module_push_dialog_check_acc_image_width">1400px</dimen>
<dimen name="module_push_dialog_check_acc_image__height">788px</dimen>
<dimen name="notice_traffic_acc_image_width">900px</dimen>
<dimen name="notice_traffic_acc_image_height">506px</dimen>
<dimen name="notice_traffic_back__width">1300px</dimen>
<dimen name="notice_traffic_back__height">1210px</dimen>
<dimen name="notice_traffic_info_width">1160px</dimen>
<dimen name="notice_traffic_info_height">290px</dimen>
<dimen name="notice_dialog_check_bg_corner">32px</dimen>
<dimen name="dp_18">18px</dimen>
<dimen name="dp_30">30px</dimen>
<dimen name="dp_36">36px</dimen>
<dimen name="dp_38">38px</dimen>
<dimen name="dp_42">42px</dimen>
<dimen name="dp_45">45px</dimen>
<dimen name="dp_50">50px</dimen>
<dimen name="dp_52">52px</dimen>
<dimen name="dp_54">54px</dimen>
<dimen name="dp_56">56px</dimen>
<dimen name="dp_62">62px</dimen>
<dimen name="dp_150">150px</dimen>
<dimen name="dp_180">180px</dimen>
<dimen name="dp_220">220px</dimen>
<dimen name="dp_580">580px</dimen>
<dimen name="dp_588">588px</dimen>
<dimen name="dp_1066">1066px</dimen>
</resources>

View File

@@ -2,6 +2,8 @@
<resources>
<color name="notice_blue">#2B6EFF</color>
<color name="notice_text_blue">#1F9BFE</color>
<color name="notice_banner_blue">#5A8EFD</color>
<color name="notice_check_dialog_bg_color">#E63B4577</color>
<color name="notice_traffic_line">#D5D5D4</color>
<color name="notice_dialog_back">#3B4577</color>
</resources>

View File

@@ -4,14 +4,30 @@
<dimen name="module_push_dialog_check_accessory_height">1200px</dimen>
<dimen name="module_push_dialog_check_acc_image_width">1400px</dimen>
<dimen name="module_push_dialog_check_acc_image__height">788px</dimen>
<dimen name="notice_traffic_acc_image_width">900px</dimen>
<dimen name="notice_traffic_acc_image_height">506px</dimen>
<dimen name="notice_traffic_back__width">1300px</dimen>
<dimen name="notice_traffic_back__height">1210px</dimen>
<dimen name="notice_traffic_info_width">1160px</dimen>
<dimen name="notice_traffic_info_height">290px</dimen>
<dimen name="notice_dialog_check_bg_corner">32px</dimen>
<dimen name="dp_18">18px</dimen>
<dimen name="dp_30">30px</dimen>
<dimen name="dp_36">36px</dimen>
<dimen name="dp_38">38px</dimen>
<dimen name="dp_42">42px</dimen>
<dimen name="dp_45">45px</dimen>
<dimen name="dp_50">50px</dimen>
<dimen name="dp_52">52px</dimen>
<dimen name="dp_54">54px</dimen>
<dimen name="dp_56">56px</dimen>
<dimen name="dp_62">62px</dimen>
<dimen name="dp_150">150px</dimen>
<dimen name="dp_180">180px</dimen>
<dimen name="dp_220">220px</dimen>
<dimen name="dp_580">580px</dimen>
<dimen name="dp_588">588px</dimen>
<dimen name="dp_1066">1066px</dimen>
</resources>

View File

@@ -48,17 +48,22 @@ dependencies {
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.arouter
implementation rootProject.ext.dependencies.rxandroid
implementation project(path: ':services:mogo-service-api')
kapt rootProject.ext.dependencies.aroutercompiler
if (Boolean.valueOf(RELEASE)) {
api rootProject.ext.dependencies.mogocommons
api rootProject.ext.dependencies.mogoserviceapi
implementation rootProject.ext.dependencies.modulecommon
} else {
implementation project(':core:mogo-core-data')
api project(":foudations:mogo-commons")
api project(':services:mogo-service-api')
implementation project(':core:mogo-core-utils')
implementation project(':core:mogo-core-function-api')
implementation project(':modules:mogo-module-common')
implementation project(':core:mogo-core-function-call')
implementation project(':core:mogo-core-res')
implementation project(':core:mogo-core-data')
}
}

View File

@@ -1,22 +0,0 @@
package com.mogo.eagle.core.function.notice
import android.content.Context
import com.mogo.eagle.core.function.api.notice.IMoGoNoticeProvider
/**
* @author xiaoyuzhou
* @date 2021/9/18 11:44 上午
* 处理云端下发通知、公告类的逻辑的接口
*/
class MoGoNoticeProvider : IMoGoNoticeProvider {
private val TAG = "MoGoNoticeProvider"
override val functionName: String
get() = TAG
override fun onDestroy() {
}
override fun init(context: Context) {}
}

View File

@@ -0,0 +1,54 @@
package com.mogo.eagle.core.function.notice;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import androidx.fragment.app.Fragment;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.notice.IMoGoNoticeProvider;
import com.mogo.eagle.core.function.notice.receiver.NoticeMessageListener;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.service.cloud.socket.IMogoLifecycleListener;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* @author Jing
* @description 云公告
* @since: 10/27/21
*/
@Route(path = MogoServicePaths.PATH_AI_NOTICE)
public class NoticeProvider implements IMoGoNoticeProvider {
private String TAG = "AINotice";
private Context mContext;
@Nullable
@Override
public Fragment createCoverage(@Nullable Context context, @Nullable Bundle data) {
return null;
}
@NotNull
@Override
public String getFunctionName() {
return null;
}
@Override
public void onDestroy() {
NoticeSocketManager.getInstance().unRegisterSocketMessage();
}
@Override
public void init(Context context) {
Log.d(TAG, "init");
mContext = context;
NoticeSocketManager.getInstance().registerSocketMessage(context);
}
}

View File

@@ -0,0 +1,53 @@
package com.mogo.eagle.core.function.notice;
import android.content.Context;
import android.util.Log;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.eagle.core.function.notice.receiver.NoticeMessageListener;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.service.IMogoServiceApis;
/**
* @author Jing
* @description 云公告注册、反注册
* @since: 10/27/21
*/
class NoticeSocketManager {
private String TAG = "AINotice";
private static NoticeSocketManager mNoticeSocketManager;
private NoticeMessageListener mNoticeMessageListener;
private static IMogoServiceApis mMoGoServiceApis;
private Context mContext;
public static synchronized NoticeSocketManager getInstance() {
synchronized (NoticeSocketManager.class) {
if (mNoticeSocketManager == null) {
mNoticeSocketManager = new NoticeSocketManager();
}
}
return mNoticeSocketManager;
}
public void registerSocketMessage(Context context) {
Log.d(TAG, "registerSocketMessage");
mContext = context;
mNoticeMessageListener = new NoticeMessageListener();
if (mMoGoServiceApis == null) {
mMoGoServiceApis = (IMogoServiceApis) ARouter.getInstance().build(com.mogo.eagle.core.data.constants.
MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
}
mMoGoServiceApis.
getSocketManagerApi(context).
registerOnMessageListener(100, mNoticeMessageListener);
}
public void unRegisterSocketMessage() {
if (mNoticeMessageListener != null) {
mMoGoServiceApis
.getSocketManagerApi(mContext).
unregisterOnMessageListener(100, mNoticeMessageListener);
}
}
}

View File

@@ -0,0 +1,28 @@
package com.mogo.eagle.core.function.notice.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
/**
* @author Jing
* @description push云公告消息接收
* @since: 10/27/21
*/
public class NoticeMessageListener implements IMogoOnMessageListener {
private String TAG = "AINotice";
private Context mContext;
@Override
public Class target() {
return null;
}
@Override
public void onMsgReceived(Object obj) {
Log.d(TAG, obj.toString());
}
}

View File

@@ -361,4 +361,11 @@ public class MogoServicePaths {
@Keep
@Deprecated
public static final String PATH_AUTO_PILOT = "/auto_pilot/api";
/**
* 云公告 模块
*/
@Keep
@Deprecated
public static final String PATH_AI_NOTICE = "/ai/notice";
}

View File

@@ -0,0 +1,67 @@
package com.mogo.eagle.core.data.notice;
import java.io.Serializable;
/**
* @author liujing
* @description 交通事故任务详情数据bean
* @since: 10/26/21
*/
public class NoticeInfo implements Serializable {
private String infoId;//事故id
private long dataCreateTime;//事故发生时间
private long dataHandleTime;//事故处理时间
private String operaStatus;//事故状态
private String reason;//事故原因
public String getInfoId() {
return infoId;
}
public void setInfoId(String infoId) {
this.infoId = infoId;
}
public long getDataCreateTime() {
return dataCreateTime;
}
public void setDataCreateTime(long dataCreateTime) {
this.dataCreateTime = dataCreateTime;
}
public long getDataHandleTime() {
return dataHandleTime;
}
public void setDataHandleTime(long dataHandleTime) {
this.dataHandleTime = dataHandleTime;
}
public String getOperaStatus() {
return operaStatus;
}
public void setOperaStatus(String operaStatus) {
this.operaStatus = operaStatus;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
@Override
public String toString() {
return "NoticeInfo{" +
"infoId='" + infoId + '\'' +
", dataCreateTime=" + dataCreateTime +
", dataHandleTime=" + dataHandleTime +
", operaStatus='" + operaStatus + '\'' +
", reason='" + reason + '\'' +
'}';
}
}

View File

@@ -0,0 +1,12 @@
package com.mogo.eagle.core.function.api.notice;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
/**
* @author Jing
* @description 云公告监听者
* @since: 10/27/21
*/
public interface IMoGoNoticeProvider extends IMoGoFunctionProvider {
}

View File

@@ -1,13 +0,0 @@
package com.mogo.eagle.core.function.api.notice
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
/**
* @author xiaoyuzhou
* @date 2021/9/18 11:25 上午
* 处理云端下发通知、公告类的逻辑的接口
*/
interface IMoGoNoticeProvider : IMoGoFunctionServerProvider {
}

View File

@@ -1,9 +1,27 @@
package com.mogo.eagle.core.function.call.notice;
import com.mogo.eagle.core.function.api.notice.IMoGoNoticeProvider;
import com.mogo.eagle.core.function.call.base.CallerBase;
import java.util.HashMap;
/**
* @author xiaoyuzhou
* @date 2021/9/18 11:48 上午
* 云端公告、通知类的 调用者管理这里对外及其他模块提供功能的调用用啥写啥不要过度设计不允许直接将Provider暴露出去
*/
public class CallerNoticeManager {
public class CallerNoticeManager extends CallerBase {
private HashMap<String, IMoGoNoticeProvider> mListeners = new HashMap<>();
/**
* 添加监听者
*/
void addListener(String tag, IMoGoNoticeProvider listener) {
mListeners.put(tag, listener);
}
/**
* 移除监听者
*/
void removeListener(String tag) {
mListeners.remove(tag);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB