Merge branch 'dev_1.1.2' into dev
This commit is contained in:
@@ -3,6 +3,7 @@ package com.mogo.utils.sqlite
|
||||
import android.content.ContentValues
|
||||
import android.database.Cursor
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
import com.mogo.utils.logger.Logger
|
||||
import com.mogo.utils.sqlite.annotation.DbField
|
||||
import com.mogo.utils.sqlite.annotation.DbTable
|
||||
import java.lang.reflect.Field
|
||||
@@ -15,13 +16,17 @@ import java.util.*
|
||||
*/
|
||||
//T必须指明上界是Any且不为null,下面会用到反射获取对象实例,默认是Any?
|
||||
open class BaseDao<T : Any> : IBaseDao<T> {
|
||||
private val TAG = "BaseDao"
|
||||
|
||||
//数据库操作的引用
|
||||
private var sqLiteDatabase: SQLiteDatabase? = null
|
||||
|
||||
//要操作的数据实体的引用
|
||||
private var entityClass: Class<T>? = null
|
||||
|
||||
//要操作的数据表名称
|
||||
private var tableName: String? = null
|
||||
|
||||
//记录数据表是否存在
|
||||
private var isInit = false
|
||||
|
||||
@@ -44,6 +49,8 @@ open class BaseDao<T : Any> : IBaseDao<T> {
|
||||
|
||||
//执行Sql进行自动建表
|
||||
val createTableSql = getCreateTableSql()
|
||||
Logger.d(TAG, "执行SQL:$createTableSql")
|
||||
|
||||
sqLiteDatabase.execSQL(createTableSql)
|
||||
|
||||
//初始化缓存空间
|
||||
@@ -101,16 +108,16 @@ open class BaseDao<T : Any> : IBaseDao<T> {
|
||||
//获取成员变量数据类型
|
||||
|
||||
when (val fieldType = field.type) {
|
||||
String::class.java -> {
|
||||
java.lang.String::class.java -> {
|
||||
sqlCreateTable.append("$columnName TEXT,")
|
||||
}
|
||||
Integer::class.java -> {
|
||||
java.lang.Integer::class.java -> {
|
||||
sqlCreateTable.append("$columnName INTEGER,")
|
||||
}
|
||||
Long::class.java -> {
|
||||
java.lang.Long::class.java -> {
|
||||
sqlCreateTable.append("$columnName BIGINT,")
|
||||
}
|
||||
Double::class.java -> {
|
||||
java.lang.Double::class.java -> {
|
||||
sqlCreateTable.append("$columnName DOUBLE,")
|
||||
}
|
||||
ByteArray::class.java -> {
|
||||
@@ -156,11 +163,11 @@ open class BaseDao<T : Any> : IBaseDao<T> {
|
||||
return if (sqLiteDatabase != null && sqLiteDatabase!!.isOpen) {
|
||||
//受影响行数
|
||||
sqLiteDatabase!!
|
||||
.delete(
|
||||
tableName,
|
||||
condition.getWhereCause(),
|
||||
condition.getWhereArgs()
|
||||
)
|
||||
.delete(
|
||||
tableName,
|
||||
condition.getWhereCause(),
|
||||
condition.getWhereArgs()
|
||||
)
|
||||
} else {
|
||||
-1
|
||||
}
|
||||
@@ -175,12 +182,12 @@ open class BaseDao<T : Any> : IBaseDao<T> {
|
||||
return if (sqLiteDatabase != null && sqLiteDatabase!!.isOpen) {
|
||||
//受影响行数
|
||||
sqLiteDatabase!!
|
||||
.update(
|
||||
tableName,
|
||||
getContentValuesForInsert(newEntity),
|
||||
condition.getWhereCause(),
|
||||
condition.getWhereArgs()
|
||||
)
|
||||
.update(
|
||||
tableName,
|
||||
getContentValuesForInsert(newEntity),
|
||||
condition.getWhereCause(),
|
||||
condition.getWhereArgs()
|
||||
)
|
||||
} else {
|
||||
-1
|
||||
}
|
||||
@@ -218,16 +225,16 @@ open class BaseDao<T : Any> : IBaseDao<T> {
|
||||
try {
|
||||
//查询数据库
|
||||
cursor = sqLiteDatabase!!
|
||||
.query(
|
||||
tableName,
|
||||
null,
|
||||
condition.getWhereCause(),
|
||||
condition.getWhereArgs(),
|
||||
null,
|
||||
null,
|
||||
orderBy,
|
||||
limitString
|
||||
)
|
||||
.query(
|
||||
tableName,
|
||||
null,
|
||||
condition.getWhereCause(),
|
||||
condition.getWhereArgs(),
|
||||
null,
|
||||
null,
|
||||
orderBy,
|
||||
limitString
|
||||
)
|
||||
//将查到结果添加到返回集合中
|
||||
result.addAll(getQueryResult(cursor, where))
|
||||
} catch (e: Exception) {
|
||||
@@ -344,16 +351,16 @@ open class BaseDao<T : Any> : IBaseDao<T> {
|
||||
|
||||
if (columnIndex != -1) {
|
||||
when (fieldType) {
|
||||
String::class.java -> {
|
||||
java.lang.String::class.java -> {
|
||||
field.set(item, cursor.getString(columnIndex))
|
||||
}
|
||||
Integer::class.java -> {
|
||||
java.lang.Integer::class.java -> {
|
||||
field.set(item, cursor.getInt(columnIndex))
|
||||
}
|
||||
Long::class.java -> {
|
||||
java.lang.Long::class.java -> {
|
||||
field.set(item, cursor.getLong(columnIndex))
|
||||
}
|
||||
Double::class.java -> {
|
||||
java.lang.Double::class.java -> {
|
||||
field.set(item, cursor.getDouble(columnIndex))
|
||||
}
|
||||
ByteArray::class.java -> {
|
||||
@@ -392,16 +399,16 @@ open class BaseDao<T : Any> : IBaseDao<T> {
|
||||
//获取成员变量数据类型
|
||||
val fieldType = it.value.type
|
||||
when (fieldType) {
|
||||
String::class.java -> {
|
||||
java.lang.String::class.java -> {
|
||||
contentValues.put(columnName, valueObject as String)
|
||||
}
|
||||
Integer::class.java -> {
|
||||
java.lang.Integer::class.java -> {
|
||||
contentValues.put(columnName, valueObject as Int)
|
||||
}
|
||||
Long::class.java -> {
|
||||
java.lang.Long::class.java -> {
|
||||
contentValues.put(columnName, valueObject as Long)
|
||||
}
|
||||
Double::class.java -> {
|
||||
java.lang.Double::class.java -> {
|
||||
contentValues.put(columnName, valueObject as Double)
|
||||
}
|
||||
ByteArray::class.java -> {
|
||||
@@ -417,6 +424,8 @@ open class BaseDao<T : Any> : IBaseDao<T> {
|
||||
}
|
||||
}
|
||||
|
||||
Logger.d(TAG, "contentValues:$contentValues")
|
||||
|
||||
return contentValues
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
|
||||
import androidx.annotation.IntDef;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -14,7 +20,8 @@ import java.util.Objects;
|
||||
*/
|
||||
public class V2XEventShowEntity implements Serializable {
|
||||
|
||||
// 0---默认展示详情,1--直播,4--道路事件详情
|
||||
// 0---默认展示详情,1--直播,
|
||||
@ViewType
|
||||
private int viewType;
|
||||
|
||||
// 道路事件详情
|
||||
@@ -23,6 +30,10 @@ public class V2XEventShowEntity implements Serializable {
|
||||
private V2XLiveCarInfoEntity v2XLiveCarInfoRes;
|
||||
// 直播车机列表
|
||||
private List<V2XLiveCarInfoEntity> v2XLiveCarList;
|
||||
// 推送信息,疲劳驾驶,
|
||||
private V2XPushMessageEntity v2XPushMessageEntity;
|
||||
// 违章停车
|
||||
private MarkerExploreWay v2XIllegalPark;
|
||||
|
||||
public int getViewType() {
|
||||
return viewType;
|
||||
@@ -56,6 +67,22 @@ public class V2XEventShowEntity implements Serializable {
|
||||
this.v2XLiveCarList = v2XLiveCarList;
|
||||
}
|
||||
|
||||
public V2XPushMessageEntity getV2XPushMessageEntity() {
|
||||
return v2XPushMessageEntity;
|
||||
}
|
||||
|
||||
public void setV2XPushMessageEntity(V2XPushMessageEntity v2XPushMessageEntity) {
|
||||
this.v2XPushMessageEntity = v2XPushMessageEntity;
|
||||
}
|
||||
|
||||
public MarkerExploreWay getV2XIllegalPark() {
|
||||
return v2XIllegalPark;
|
||||
}
|
||||
|
||||
public void setV2XIllegalPark(MarkerExploreWay v2XIllegalPark) {
|
||||
this.v2XIllegalPark = v2XIllegalPark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
@@ -68,21 +95,35 @@ public class V2XEventShowEntity implements Serializable {
|
||||
return viewType == that.viewType &&
|
||||
Objects.equals(v2XRoadEventEntity, that.v2XRoadEventEntity) &&
|
||||
Objects.equals(v2XLiveCarInfoRes, that.v2XLiveCarInfoRes) &&
|
||||
Objects.equals(v2XLiveCarList, that.v2XLiveCarList);
|
||||
Objects.equals(v2XLiveCarList, that.v2XLiveCarList) &&
|
||||
Objects.equals(v2XPushMessageEntity, that.v2XPushMessageEntity) &&
|
||||
Objects.equals(v2XIllegalPark, that.v2XIllegalPark);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(viewType, v2XRoadEventEntity, v2XLiveCarInfoRes, v2XLiveCarList);
|
||||
return Objects.hash(viewType, v2XRoadEventEntity,
|
||||
v2XLiveCarInfoRes, v2XLiveCarList,
|
||||
v2XPushMessageEntity, v2XIllegalPark);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "V2XEventShowEntity{" +
|
||||
"viewType=" + viewType +
|
||||
", v2XRoadEventEntity=" + v2XRoadEventEntity +
|
||||
", v2XLiveCarInfoRes=" + v2XLiveCarInfoRes +
|
||||
", v2XLiveCarList=" + v2XLiveCarList +
|
||||
'}';
|
||||
|
||||
@IntDef(value = {
|
||||
V2XWindowTypeEnum.DEFAULT_WINDOW,
|
||||
V2XWindowTypeEnum.LIVE_CAR_WINDOW,
|
||||
V2XWindowTypeEnum.ROAD_EVENT_WINDOW,
|
||||
V2XWindowTypeEnum.PUSH_EVENT_WINDOW,
|
||||
V2XWindowTypeEnum.ANIMATION_WINDOW,
|
||||
V2XWindowTypeEnum.FATIGUE_DRIVING_WINDOW,
|
||||
V2XWindowTypeEnum.SEEK_HELP_WINDOW,
|
||||
V2XWindowTypeEnum.ILLEGAL_PARK_WINDOW,
|
||||
})
|
||||
@Target({
|
||||
ElementType.PARAMETER,
|
||||
ElementType.FIELD,
|
||||
ElementType.METHOD,
|
||||
}) //表示注解作用范围,参数注解,成员注解,方法注解
|
||||
@Retention(RetentionPolicy.SOURCE) //表示注解所存活的时间,在运行时,而不会存在 .class 文件中
|
||||
public @interface ViewType { //接口,定义新的注解类型
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
import com.mogo.utils.sqlite.annotation.DbDatabase;
|
||||
import com.mogo.utils.sqlite.annotation.DbField;
|
||||
import com.mogo.utils.sqlite.annotation.DbTable;
|
||||
|
||||
/**
|
||||
* V2X 道路历史事件
|
||||
*
|
||||
* @author donghongyu
|
||||
*/
|
||||
@DbDatabase(dbName = "MoGoScenario.db")
|
||||
@DbTable(tableName = "tb_history_scenario")
|
||||
public class V2XHistoryScenarioData {
|
||||
|
||||
/**
|
||||
* 事件类型
|
||||
*/
|
||||
@DbField(fieldName = "scenarioType")
|
||||
public Integer scenarioType;
|
||||
|
||||
/**
|
||||
* 事件触发时间
|
||||
*/
|
||||
@DbField(fieldName = "triggerTime")
|
||||
public Long triggerTime;
|
||||
|
||||
/**
|
||||
* 事件json
|
||||
*/
|
||||
@DbField(fieldName = "eventJsonData")
|
||||
public String eventJsonData;
|
||||
|
||||
public Integer getScenarioType() {
|
||||
return scenarioType;
|
||||
}
|
||||
|
||||
public void setScenarioType(Integer scenarioType) {
|
||||
this.scenarioType = scenarioType;
|
||||
}
|
||||
|
||||
public String getEventJsonData() {
|
||||
return eventJsonData;
|
||||
}
|
||||
|
||||
public void setEventJsonData(String eventJsonData) {
|
||||
this.eventJsonData = eventJsonData;
|
||||
}
|
||||
|
||||
public Long getTriggerTime() {
|
||||
return triggerTime;
|
||||
}
|
||||
|
||||
public void setTriggerTime(Long triggerTime) {
|
||||
this.triggerTime = triggerTime;
|
||||
}
|
||||
}
|
||||
@@ -4,30 +4,27 @@ import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.utils.DateTimeUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.mogo.module.event.panel.R;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventDescription;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventItem;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventItemEnum;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ShareEventAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
private Context context;
|
||||
private ArrayList<ShareEventItem> dataArrayList;
|
||||
private Object Tag = "ShareEventAdapter";
|
||||
private ArrayList dataArrayList;
|
||||
private final LayoutInflater shareLayoutInflater;
|
||||
|
||||
public static enum ITEM_TYPE {
|
||||
ITEM_TYPE_NUM_DES,
|
||||
ITEM_TYPE_SHARE_LIST_ITEM,
|
||||
ITEM_TYPE_SHARE_EMPTY
|
||||
}
|
||||
|
||||
public ShareEventAdapter(Context context, ArrayList<ShareEventItem> dataArrayList) {
|
||||
public ShareEventAdapter(Context context, ArrayList dataArrayList) {
|
||||
this.context = context;
|
||||
this.dataArrayList = dataArrayList;
|
||||
shareLayoutInflater = LayoutInflater.from(context);
|
||||
@@ -37,65 +34,90 @@ public class ShareEventAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
//根据viewType创建自定义布局
|
||||
if (viewType == ITEM_TYPE.ITEM_TYPE_NUM_DES.ordinal()) {
|
||||
if (viewType == ShareEventItemEnum.ITEM_TYPE_NUM_DES) {
|
||||
View v = shareLayoutInflater.inflate(R.layout.module_event_panel_share_description, parent,
|
||||
false);
|
||||
shareDescriptionViewHolder holder = new shareDescriptionViewHolder(v);
|
||||
return holder;
|
||||
} else if ((viewType == ITEM_TYPE.ITEM_TYPE_SHARE_LIST_ITEM.ordinal())) {
|
||||
} else if (viewType == ShareEventItemEnum.ITEM_TYPE_SHARE_LIST) {
|
||||
View v = shareLayoutInflater.inflate(R.layout.module_event_panel_share_item, parent,
|
||||
false);
|
||||
shareItemViewHolder holder = new shareItemViewHolder(v);
|
||||
return holder;
|
||||
} else {
|
||||
} else if (viewType == ShareEventItemEnum.ITEM_TYPE_SHARE_EMPTY) {
|
||||
View v = shareLayoutInflater.inflate(R.layout.module_event_panel_share_empty, parent,
|
||||
false);
|
||||
shareEmptyViewHolder holder = new shareEmptyViewHolder(v);
|
||||
return holder;
|
||||
} else {
|
||||
View v = shareLayoutInflater.inflate(R.layout.module_event_panel_share_load_status, parent,
|
||||
false);
|
||||
shareLoadStatusViewHolder holder = new shareLoadStatusViewHolder(v);
|
||||
return holder;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
|
||||
if (position == 0) {
|
||||
ShareEventDescription data = new ShareEventDescription();
|
||||
data.shareNum = "12";
|
||||
data.approveNum = "10";
|
||||
|
||||
((shareDescriptionViewHolder) holder).shareNumTextView.setText(data.shareNum);
|
||||
((shareDescriptionViewHolder) holder).approveNumTextView.setText(data.approveNum);
|
||||
|
||||
} else {
|
||||
if (dataArrayList.size() > 0) {
|
||||
ShareEventItem data = dataArrayList.get(position - 1);
|
||||
data.usefulNum = "2";
|
||||
data.uselessNum = "3";
|
||||
((shareItemViewHolder) holder).caseStyleTextView.setText(data.caseStyle);
|
||||
((shareItemViewHolder) holder).caseAddressTextView.setText(data.caseAddress);
|
||||
((shareItemViewHolder) holder).caseTimeTextView.setText(data.caseTime);
|
||||
((shareItemViewHolder) holder).caseUsefulTextView.setText(data.usefulNum);
|
||||
((shareItemViewHolder) holder).caseUselessTextView.setText(data.uselessNum);
|
||||
if (holder instanceof shareDescriptionViewHolder) {
|
||||
if (dataArrayList.size() > position) {
|
||||
ShareEventDescription.ResultBean.EnthusiasmIndexBean data = (ShareEventDescription.ResultBean.EnthusiasmIndexBean) dataArrayList.get(position);
|
||||
if (data != null) {
|
||||
String shareNum = String.valueOf(data.getShareNum());
|
||||
String likeNum = String.valueOf(data.getLikeNum());
|
||||
if (shareNum != null) {
|
||||
((shareDescriptionViewHolder) holder).shareNumTextView.setText(shareNum);
|
||||
}
|
||||
if (likeNum != null) {
|
||||
((shareDescriptionViewHolder) holder).approveNumTextView.setText(likeNum);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (holder instanceof shareItemViewHolder) {
|
||||
if (dataArrayList.size() > position) {
|
||||
ShareEventItem.ResultBean.PageBean.ContentBean data = (ShareEventItem.ResultBean.PageBean.ContentBean) dataArrayList.get(position);
|
||||
if (data != null) {
|
||||
String poitype = data.getPoiType();
|
||||
String address = data.getUploadAddress();
|
||||
String time = DateTimeUtils.getTimeText(data.getUploadTimestamp());
|
||||
String likeNum = String.valueOf(data.getLikeNum());
|
||||
String notLikeNum = String.valueOf(data.getNotLikeNum());
|
||||
if (poitype != null){
|
||||
((shareItemViewHolder) holder).caseStyleTextView.setText(poitype);
|
||||
}
|
||||
if (address != null){
|
||||
((shareItemViewHolder) holder).caseAddressTextView.setText(address);
|
||||
}
|
||||
if (time != null){
|
||||
((shareItemViewHolder) holder).caseTimeTextView.setText(time);
|
||||
}
|
||||
if (likeNum != null){
|
||||
((shareItemViewHolder) holder).caseUsefulTextView.setText(likeNum);
|
||||
}
|
||||
if(notLikeNum != null){
|
||||
((shareItemViewHolder) holder).caseUselessTextView.setText(notLikeNum);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} else if (holder instanceof shareLoadStatusViewHolder) {
|
||||
((shareLoadStatusViewHolder) holder).statusButton.setText("加载更多");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return dataArrayList.size() + dataArrayList.size() > 0 ? 1 : 2;
|
||||
return dataArrayList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
switch (dataArrayList.size()) {
|
||||
case 0:
|
||||
return position == 0 ? ITEM_TYPE.ITEM_TYPE_NUM_DES.ordinal() : ITEM_TYPE.ITEM_TYPE_SHARE_EMPTY.ordinal();
|
||||
if (position == 0) {
|
||||
return ShareEventItemEnum.ITEM_TYPE_NUM_DES;
|
||||
}
|
||||
|
||||
int type = position == 0 ? ITEM_TYPE.ITEM_TYPE_NUM_DES.ordinal() : ITEM_TYPE.ITEM_TYPE_SHARE_LIST_ITEM.ordinal();
|
||||
return type;
|
||||
return ShareEventItemEnum.ITEM_TYPE_SHARE_LIST;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -138,6 +160,22 @@ public class ShareEventAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
class shareEmptyViewHolder extends RecyclerView.ViewHolder {
|
||||
public shareEmptyViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
Button shareBtn = itemView.findViewById(R.id.share_event_button);
|
||||
shareBtn.setOnClickListener(view -> {
|
||||
Logger.d("我的分享列表", "去分享");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 加载更多/没有更多
|
||||
* */
|
||||
class shareLoadStatusViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView statusButton;
|
||||
|
||||
public shareLoadStatusViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
statusButton = itemView.findViewById(R.id.event_share_load_status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,158 @@
|
||||
package com.zhidao.mogo.module.event.panel.bean;
|
||||
|
||||
public class ShareEventDescription {
|
||||
public String shareNum;
|
||||
public String approveNum;
|
||||
import com.mogo.commons.data.BaseData;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ShareEventDescription extends BaseData implements Serializable {
|
||||
/**
|
||||
* detailMsg :
|
||||
* result : {"enthusiasmIndex":{"id":68,"sn":"ZD802B1932L00622","score":10,"shareNum":1024,"likeNum":0,"notLikeNum":0,"enthusiasmIndex":1,"createTime":"2020-07-28T06:21:11.523+0000","updateTime":"2020-07-28T06:21:11.523+0000"}}
|
||||
*/
|
||||
|
||||
private String detailMsg;
|
||||
private ResultBean result;
|
||||
|
||||
public String getDetailMsg() {
|
||||
return detailMsg;
|
||||
}
|
||||
|
||||
public void setDetailMsg(String detailMsg) {
|
||||
this.detailMsg = detailMsg;
|
||||
}
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* enthusiasmIndex : {"id":68,"sn":"ZD802B1932L00622","score":10,"shareNum":1024,"likeNum":0,"notLikeNum":0,"enthusiasmIndex":1,"createTime":"2020-07-28T06:21:11.523+0000","updateTime":"2020-07-28T06:21:11.523+0000"}
|
||||
*/
|
||||
|
||||
private EnthusiasmIndexBean enthusiasmIndex;
|
||||
|
||||
public EnthusiasmIndexBean getEnthusiasmIndex() {
|
||||
return enthusiasmIndex;
|
||||
}
|
||||
|
||||
public void setEnthusiasmIndex(EnthusiasmIndexBean enthusiasmIndex) {
|
||||
this.enthusiasmIndex = enthusiasmIndex;
|
||||
}
|
||||
|
||||
public static class EnthusiasmIndexBean {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EnthusiasmIndexBean{" +
|
||||
"id=" + id +
|
||||
", sn='" + sn + '\'' +
|
||||
", score=" + score +
|
||||
", shareNum=" + shareNum +
|
||||
", likeNum=" + likeNum +
|
||||
", notLikeNum=" + notLikeNum +
|
||||
", enthusiasmIndex=" + enthusiasmIndex +
|
||||
", createTime='" + createTime + '\'' +
|
||||
", updateTime='" + updateTime + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
/**
|
||||
* id : 68
|
||||
* sn : ZD802B1932L00622
|
||||
* score : 10
|
||||
* shareNum : 1024
|
||||
* likeNum : 0
|
||||
* notLikeNum : 0
|
||||
* enthusiasmIndex : 1.0
|
||||
* createTime : 2020-07-28T06:21:11.523+0000
|
||||
* updateTime : 2020-07-28T06:21:11.523+0000
|
||||
*/
|
||||
|
||||
private int id;
|
||||
private String sn;
|
||||
private int score;
|
||||
private int shareNum;
|
||||
private int likeNum;
|
||||
private int notLikeNum;
|
||||
private double enthusiasmIndex;
|
||||
private String createTime;
|
||||
private String updateTime;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public int getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
public void setScore(int score) {
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
public int getShareNum() {
|
||||
return shareNum;
|
||||
}
|
||||
|
||||
public void setShareNum(int shareNum) {
|
||||
this.shareNum = shareNum;
|
||||
}
|
||||
|
||||
public int getLikeNum() {
|
||||
return likeNum;
|
||||
}
|
||||
|
||||
public void setLikeNum(int likeNum) {
|
||||
this.likeNum = likeNum;
|
||||
}
|
||||
|
||||
public int getNotLikeNum() {
|
||||
return notLikeNum;
|
||||
}
|
||||
|
||||
public void setNotLikeNum(int notLikeNum) {
|
||||
this.notLikeNum = notLikeNum;
|
||||
}
|
||||
|
||||
public double getEnthusiasmIndex() {
|
||||
return enthusiasmIndex;
|
||||
}
|
||||
|
||||
public void setEnthusiasmIndex(double enthusiasmIndex) {
|
||||
this.enthusiasmIndex = enthusiasmIndex;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(String updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,486 @@
|
||||
package com.zhidao.mogo.module.event.panel.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import com.mogo.commons.data.BaseData;
|
||||
|
||||
public class ShareEventItem implements Serializable {
|
||||
public String caseStyle;
|
||||
public String caseAddress;
|
||||
public String caseTime;
|
||||
public String usefulNum;
|
||||
public String uselessNum;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class ShareEventItem extends BaseData implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* detailMsg :
|
||||
* result : {"page":{"total":1024,"pageSize":1,"pageNum":4,"content":[{"coordinates":[116.407653,39.966487],"uploadTimestamp":1592901273966,"timeout":1593100800000,"uploadAddress":"安定门外大街","distance":0,"dbId":"725026095564550144","poiType":"10002","sn":"ZD802B1932L00622","userId":0,"userName":"小松鼠艾德蒙","userHead":"http://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592476328925.png","likeNum":18,"notLikeNum":0,"uploadType":2,"uploadUser":"123","imgUrl":null,"content":null,"gasStationId":null,"gasStationName":null,"gasImg":null,"gasPrices":null,"endDate":"2020-06-26 00:00:00","fabulous":false,"direction":180,"virtualLikeNum":822,"status":1,"sourceType":"10002","hitId":"0K-mf3MBeovPWpwE9IfR","userType":2,"data":[{"url":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546939076.mp4%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546939%253B1592550539%2526q-key-time%253D1592546939%253B1592550539%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253D74a4058ad7579ea210dafcf78d7a19460cffb899?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D679bff1838c7d497d38f48ef999b50e80c5856c4","thumbnail":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546956790.png%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546956%253B1592550556%2526q-key-time%253D1592546956%253B1592550556%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253Dcc9a35349fc55e433f934af88df576ae792b3987?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D99b5a92a4f97909d8c217dbeec2ec6e9ec1052f4","content":null,"illegalCount":null}]}]}}
|
||||
*/
|
||||
|
||||
private String detailMsg;
|
||||
private ResultBean result;
|
||||
|
||||
public String getDetailMsg() {
|
||||
return detailMsg;
|
||||
}
|
||||
|
||||
public void setDetailMsg(String detailMsg) {
|
||||
this.detailMsg = detailMsg;
|
||||
}
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* page : {"total":1024,"pageSize":1,"pageNum":4,"content":[{"coordinates":[116.407653,39.966487],"uploadTimestamp":1592901273966,"timeout":1593100800000,"uploadAddress":"安定门外大街","distance":0,"dbId":"725026095564550144","poiType":"10002","sn":"ZD802B1932L00622","userId":0,"userName":"小松鼠艾德蒙","userHead":"http://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592476328925.png","likeNum":18,"notLikeNum":0,"uploadType":2,"uploadUser":"123","imgUrl":null,"content":null,"gasStationId":null,"gasStationName":null,"gasImg":null,"gasPrices":null,"endDate":"2020-06-26 00:00:00","fabulous":false,"direction":180,"virtualLikeNum":822,"status":1,"sourceType":"10002","hitId":"0K-mf3MBeovPWpwE9IfR","userType":2,"data":[{"url":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546939076.mp4%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546939%253B1592550539%2526q-key-time%253D1592546939%253B1592550539%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253D74a4058ad7579ea210dafcf78d7a19460cffb899?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D679bff1838c7d497d38f48ef999b50e80c5856c4","thumbnail":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546956790.png%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546956%253B1592550556%2526q-key-time%253D1592546956%253B1592550556%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253Dcc9a35349fc55e433f934af88df576ae792b3987?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D99b5a92a4f97909d8c217dbeec2ec6e9ec1052f4","content":null,"illegalCount":null}]}]}
|
||||
*/
|
||||
|
||||
private PageBean page;
|
||||
|
||||
public PageBean getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(PageBean page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public static class PageBean {
|
||||
/**
|
||||
* total : 1024
|
||||
* pageSize : 1
|
||||
* pageNum : 4
|
||||
* content : [{"coordinates":[116.407653,39.966487],"uploadTimestamp":1592901273966,"timeout":1593100800000,"uploadAddress":"安定门外大街","distance":0,"dbId":"725026095564550144","poiType":"10002","sn":"ZD802B1932L00622","userId":0,"userName":"小松鼠艾德蒙","userHead":"http://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592476328925.png","likeNum":18,"notLikeNum":0,"uploadType":2,"uploadUser":"123","imgUrl":null,"content":null,"gasStationId":null,"gasStationName":null,"gasImg":null,"gasPrices":null,"endDate":"2020-06-26 00:00:00","fabulous":false,"direction":180,"virtualLikeNum":822,"status":1,"sourceType":"10002","hitId":"0K-mf3MBeovPWpwE9IfR","userType":2,"data":[{"url":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546939076.mp4%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546939%253B1592550539%2526q-key-time%253D1592546939%253B1592550539%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253D74a4058ad7579ea210dafcf78d7a19460cffb899?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D679bff1838c7d497d38f48ef999b50e80c5856c4","thumbnail":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546956790.png%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546956%253B1592550556%2526q-key-time%253D1592546956%253B1592550556%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253Dcc9a35349fc55e433f934af88df576ae792b3987?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D99b5a92a4f97909d8c217dbeec2ec6e9ec1052f4","content":null,"illegalCount":null}]}]
|
||||
*/
|
||||
|
||||
private int total;
|
||||
private int pageSize;
|
||||
private int pageNum;
|
||||
private List<ContentBean> content;
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(int total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public int getPageNum() {
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(int pageNum) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public List<ContentBean> getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(List<ContentBean> content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public static class ContentBean {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ContentBean{" +
|
||||
"uploadTimestamp=" + uploadTimestamp +
|
||||
", timeout=" + timeout +
|
||||
", uploadAddress='" + uploadAddress + '\'' +
|
||||
", distance=" + distance +
|
||||
", dbId='" + dbId + '\'' +
|
||||
", poiType='" + poiType + '\'' +
|
||||
", sn='" + sn + '\'' +
|
||||
", userId=" + userId +
|
||||
", userName='" + userName + '\'' +
|
||||
", userHead='" + userHead + '\'' +
|
||||
", likeNum=" + likeNum +
|
||||
", notLikeNum=" + notLikeNum +
|
||||
", uploadType=" + uploadType +
|
||||
", uploadUser='" + uploadUser + '\'' +
|
||||
", imgUrl=" + imgUrl +
|
||||
", content=" + content +
|
||||
", gasStationId=" + gasStationId +
|
||||
", gasStationName=" + gasStationName +
|
||||
", gasImg=" + gasImg +
|
||||
", gasPrices=" + gasPrices +
|
||||
", endDate='" + endDate + '\'' +
|
||||
", fabulous=" + fabulous +
|
||||
", direction=" + direction +
|
||||
", virtualLikeNum=" + virtualLikeNum +
|
||||
", status=" + status +
|
||||
", sourceType='" + sourceType + '\'' +
|
||||
", hitId='" + hitId + '\'' +
|
||||
", userType=" + userType +
|
||||
", coordinates=" + coordinates +
|
||||
", data=" + data +
|
||||
'}';
|
||||
}
|
||||
|
||||
/**
|
||||
* coordinates : [116.407653,39.966487]
|
||||
* uploadTimestamp : 1592901273966
|
||||
* timeout : 1593100800000
|
||||
* uploadAddress : 安定门外大街
|
||||
* distance : 0
|
||||
* dbId : 725026095564550144
|
||||
* poiType : 10002
|
||||
* sn : ZD802B1932L00622
|
||||
* userId : 0
|
||||
* userName : 小松鼠艾德蒙
|
||||
* userHead : http://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592476328925.png
|
||||
* likeNum : 18
|
||||
* notLikeNum : 0
|
||||
* uploadType : 2
|
||||
* uploadUser : 123
|
||||
* imgUrl : null
|
||||
* content : null
|
||||
* gasStationId : null
|
||||
* gasStationName : null
|
||||
* gasImg : null
|
||||
* gasPrices : null
|
||||
* endDate : 2020-06-26 00:00:00
|
||||
* fabulous : false
|
||||
* direction : 180
|
||||
* virtualLikeNum : 822
|
||||
* status : 1
|
||||
* sourceType : 10002
|
||||
* hitId : 0K-mf3MBeovPWpwE9IfR
|
||||
* userType : 2
|
||||
* data : [{"url":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546939076.mp4%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546939%253B1592550539%2526q-key-time%253D1592546939%253B1592550539%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253D74a4058ad7579ea210dafcf78d7a19460cffb899?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D679bff1838c7d497d38f48ef999b50e80c5856c4","thumbnail":"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546956790.png%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546956%253B1592550556%2526q-key-time%253D1592546956%253B1592550556%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253Dcc9a35349fc55e433f934af88df576ae792b3987?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D99b5a92a4f97909d8c217dbeec2ec6e9ec1052f4","content":null,"illegalCount":null}]
|
||||
*/
|
||||
|
||||
private long uploadTimestamp;
|
||||
private long timeout;
|
||||
private String uploadAddress;
|
||||
private int distance;
|
||||
private String dbId;
|
||||
private String poiType;
|
||||
private String sn;
|
||||
private int userId;
|
||||
private String userName;
|
||||
private String userHead;
|
||||
private int likeNum;
|
||||
private int notLikeNum;
|
||||
private int uploadType;
|
||||
private String uploadUser;
|
||||
private Object imgUrl;
|
||||
private Object content;
|
||||
private Object gasStationId;
|
||||
private Object gasStationName;
|
||||
private Object gasImg;
|
||||
private Object gasPrices;
|
||||
private String endDate;
|
||||
private boolean fabulous;
|
||||
private int direction;
|
||||
private int virtualLikeNum;
|
||||
private int status;
|
||||
private String sourceType;
|
||||
private String hitId;
|
||||
private int userType;
|
||||
private List<Double> coordinates;
|
||||
private List<DataBean> data;
|
||||
|
||||
public long getUploadTimestamp() {
|
||||
return uploadTimestamp;
|
||||
}
|
||||
|
||||
public void setUploadTimestamp(long uploadTimestamp) {
|
||||
this.uploadTimestamp = uploadTimestamp;
|
||||
}
|
||||
|
||||
public long getTimeout() {
|
||||
return timeout;
|
||||
}
|
||||
|
||||
public void setTimeout(long timeout) {
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
public String getUploadAddress() {
|
||||
return uploadAddress;
|
||||
}
|
||||
|
||||
public void setUploadAddress(String uploadAddress) {
|
||||
this.uploadAddress = uploadAddress;
|
||||
}
|
||||
|
||||
public int getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance(int distance) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public String getDbId() {
|
||||
return dbId;
|
||||
}
|
||||
|
||||
public void setDbId(String dbId) {
|
||||
this.dbId = dbId;
|
||||
}
|
||||
|
||||
public String getPoiType() {
|
||||
return poiType;
|
||||
}
|
||||
|
||||
public void setPoiType(String poiType) {
|
||||
this.poiType = poiType;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserHead() {
|
||||
return userHead;
|
||||
}
|
||||
|
||||
public void setUserHead(String userHead) {
|
||||
this.userHead = userHead;
|
||||
}
|
||||
|
||||
public int getLikeNum() {
|
||||
return likeNum;
|
||||
}
|
||||
|
||||
public void setLikeNum(int likeNum) {
|
||||
this.likeNum = likeNum;
|
||||
}
|
||||
|
||||
public int getNotLikeNum() {
|
||||
return notLikeNum;
|
||||
}
|
||||
|
||||
public void setNotLikeNum(int notLikeNum) {
|
||||
this.notLikeNum = notLikeNum;
|
||||
}
|
||||
|
||||
public int getUploadType() {
|
||||
return uploadType;
|
||||
}
|
||||
|
||||
public void setUploadType(int uploadType) {
|
||||
this.uploadType = uploadType;
|
||||
}
|
||||
|
||||
public String getUploadUser() {
|
||||
return uploadUser;
|
||||
}
|
||||
|
||||
public void setUploadUser(String uploadUser) {
|
||||
this.uploadUser = uploadUser;
|
||||
}
|
||||
|
||||
public Object getImgUrl() {
|
||||
return imgUrl;
|
||||
}
|
||||
|
||||
public void setImgUrl(Object imgUrl) {
|
||||
this.imgUrl = imgUrl;
|
||||
}
|
||||
|
||||
public Object getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(Object content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public Object getGasStationId() {
|
||||
return gasStationId;
|
||||
}
|
||||
|
||||
public void setGasStationId(Object gasStationId) {
|
||||
this.gasStationId = gasStationId;
|
||||
}
|
||||
|
||||
public Object getGasStationName() {
|
||||
return gasStationName;
|
||||
}
|
||||
|
||||
public void setGasStationName(Object gasStationName) {
|
||||
this.gasStationName = gasStationName;
|
||||
}
|
||||
|
||||
public Object getGasImg() {
|
||||
return gasImg;
|
||||
}
|
||||
|
||||
public void setGasImg(Object gasImg) {
|
||||
this.gasImg = gasImg;
|
||||
}
|
||||
|
||||
public Object getGasPrices() {
|
||||
return gasPrices;
|
||||
}
|
||||
|
||||
public void setGasPrices(Object gasPrices) {
|
||||
this.gasPrices = gasPrices;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public boolean isFabulous() {
|
||||
return fabulous;
|
||||
}
|
||||
|
||||
public void setFabulous(boolean fabulous) {
|
||||
this.fabulous = fabulous;
|
||||
}
|
||||
|
||||
public int getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(int direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public int getVirtualLikeNum() {
|
||||
return virtualLikeNum;
|
||||
}
|
||||
|
||||
public void setVirtualLikeNum(int virtualLikeNum) {
|
||||
this.virtualLikeNum = virtualLikeNum;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getSourceType() {
|
||||
return sourceType;
|
||||
}
|
||||
|
||||
public void setSourceType(String sourceType) {
|
||||
this.sourceType = sourceType;
|
||||
}
|
||||
|
||||
public String getHitId() {
|
||||
return hitId;
|
||||
}
|
||||
|
||||
public void setHitId(String hitId) {
|
||||
this.hitId = hitId;
|
||||
}
|
||||
|
||||
public int getUserType() {
|
||||
return userType;
|
||||
}
|
||||
|
||||
public void setUserType(int userType) {
|
||||
this.userType = userType;
|
||||
}
|
||||
|
||||
public List<Double> getCoordinates() {
|
||||
return coordinates;
|
||||
}
|
||||
|
||||
public void setCoordinates(List<Double> coordinates) {
|
||||
this.coordinates = coordinates;
|
||||
}
|
||||
|
||||
public List<DataBean> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DataBean> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class DataBean {
|
||||
/**
|
||||
* url : http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546939076.mp4%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546939%253B1592550539%2526q-key-time%253D1592546939%253B1592550539%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253D74a4058ad7579ea210dafcf78d7a19460cffb899?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D679bff1838c7d497d38f48ef999b50e80c5856c4
|
||||
* thumbnail : http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1592546956790.png%3Fsign%3Dq-sign-algorithm%253Dsha1%2526q-ak%253DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%2526q-sign-time%253D1592546956%253B1592550556%2526q-key-time%253D1592546956%253B1592550556%2526q-header-list%253D%2526q-url-param-list%253D%2526q-signature%253Dcc9a35349fc55e433f934af88df576ae792b3987?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595574735%3B1595578335%26q-key-time%3D1595574735%3B1595578335%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D99b5a92a4f97909d8c217dbeec2ec6e9ec1052f4
|
||||
* content : null
|
||||
* illegalCount : null
|
||||
*/
|
||||
|
||||
private String url;
|
||||
private String thumbnail;
|
||||
private Object content;
|
||||
private Object illegalCount;
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getThumbnail() {
|
||||
return thumbnail;
|
||||
}
|
||||
|
||||
public void setThumbnail(String thumbnail) {
|
||||
this.thumbnail = thumbnail;
|
||||
}
|
||||
|
||||
public Object getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(Object content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public Object getIllegalCount() {
|
||||
return illegalCount;
|
||||
}
|
||||
|
||||
public void setIllegalCount(Object illegalCount) {
|
||||
this.illegalCount = illegalCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.zhidao.mogo.module.event.panel.bean;
|
||||
|
||||
public interface ShareEventItemEnum {
|
||||
|
||||
int ITEM_TYPE_NUM_DES = 0;
|
||||
int ITEM_TYPE_SHARE_LIST = 1;
|
||||
int ITEM_TYPE_SHARE_EMPTY = 2;
|
||||
int ITEM_TYPE_LOAD_MORE_STATUS = 3;
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.zhidao.mogo.module.event.panel.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -10,20 +11,39 @@ import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
import com.mogo.utils.network.RequestOptions;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.zhidao.mogo.module.event.panel.R;
|
||||
import com.zhidao.mogo.module.event.panel.adapter.ShareEventAdapter;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventDescription;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventItem;
|
||||
import com.zhidao.mogo.module.event.panel.network.HostConstant;
|
||||
import com.zhidao.mogo.module.event.panel.network.ShareEventApiService;
|
||||
import com.zhidao.mogo.module.event.panel.network.ShareEventParameter;
|
||||
import com.zhidao.mogo.module.event.panel.presenter.ShareEventsPresenter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
public class ShareEventsFragment extends MvpFragment<ShareEventsFragment, ShareEventsPresenter> {
|
||||
|
||||
private static final String TAG = "ShareEventsFragment";
|
||||
private RecyclerView recyclerView;
|
||||
private View view;
|
||||
private ShareEventAdapter adapter;
|
||||
private ArrayList<ShareEventItem> dataArrayList = new ArrayList<ShareEventItem>();
|
||||
private ArrayList dataArrayList = new ArrayList();
|
||||
private ShareEventApiService shareEventApiService;
|
||||
private int pageNum = 1;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -32,7 +52,6 @@ public class ShareEventsFragment extends MvpFragment<ShareEventsFragment, ShareE
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -46,21 +65,80 @@ public class ShareEventsFragment extends MvpFragment<ShareEventsFragment, ShareE
|
||||
|
||||
private void initRecyclerView() {
|
||||
recyclerView = view.findViewById(R.id.road_case_share_list);
|
||||
adapter = new ShareEventAdapter(getActivity(),dataArrayList);
|
||||
adapter = new ShareEventAdapter(getActivity(), dataArrayList);
|
||||
recyclerView.setAdapter(adapter);
|
||||
LinearLayoutManager linearLayoutManager =
|
||||
new LinearLayoutManager( getActivity(), LinearLayoutManager.VERTICAL, false );
|
||||
new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
|
||||
recyclerView.setLayoutManager(linearLayoutManager);
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
// for (int i = 0; i < 12; i++) {
|
||||
// ShareEventItem data = new ShareEventItem();
|
||||
// data.caseStyle = "道路拥堵";
|
||||
// data.caseAddress = "环球贸易中心";
|
||||
// data.caseTime = "2020-07-21 12:00:00";
|
||||
// dataArrayList.add(data);
|
||||
// }
|
||||
IMogoNetwork network = (IMogoNetwork) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_NETWORK).navigation(getContext());
|
||||
this.shareEventApiService = network.create(ShareEventApiService.class, HostConstant.getNetHost());
|
||||
|
||||
getShareEventDescription();
|
||||
getShareEventList(pageNum, 10);
|
||||
}
|
||||
|
||||
/*
|
||||
* 热心指数等
|
||||
* */
|
||||
private void getShareEventDescription() {
|
||||
//ZD802B1932L00622
|
||||
//Utils.getSn()
|
||||
ShareEventParameter parameter = new ShareEventParameter("ZD802B1932L00622");
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("data", GsonUtil.jsonFromObject(parameter));
|
||||
|
||||
shareEventApiService.getEnthusiasmIndex(parameters)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<ShareEventDescription>(RequestOptions.create(getContext())) {
|
||||
@Override
|
||||
public void onSuccess(ShareEventDescription resultData) {
|
||||
if (resultData != null && resultData.getResult() != null
|
||||
&& resultData.getResult().getEnthusiasmIndex() != null) {
|
||||
dataArrayList.add(resultData.getResult().getEnthusiasmIndex());
|
||||
adapter.notifyDataSetChanged();
|
||||
Log.d(TAG, "热心指数---:" + resultData.getResult().getEnthusiasmIndex());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String message, int code) {
|
||||
super.onError(message, code);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 分享列表
|
||||
* */
|
||||
private void getShareEventList(int page, int size) {
|
||||
ShareEventParameter parameter = new ShareEventParameter("ZD802B1932L00622",pageNum,10);
|
||||
HashMap<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("data", GsonUtil.jsonFromObject(parameter));
|
||||
|
||||
shareEventApiService.getShareEventList(parameters)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<ShareEventItem>(RequestOptions.create(getContext())) {
|
||||
@Override
|
||||
public void onSuccess(ShareEventItem resultData) {
|
||||
if (resultData != null && resultData.getResult() != null
|
||||
&& resultData.getResult().getPage().getContent().size() > 0) {
|
||||
dataArrayList.addAll(resultData.getResult().getPage().getContent());
|
||||
Log.d(TAG, "分享列表---:" + dataArrayList.get(0));
|
||||
adapter.notifyDataSetChanged();
|
||||
} else {
|
||||
//没有分享内容
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String message, int code) { super.onError(message, code); }
|
||||
});
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.zhidao.mogo.module.event.panel.network;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
|
||||
public class HostConstant {
|
||||
public static final String HOST_DEV = "http://dzt-test.zhidaohulian.com";
|
||||
public static final String HOST_TEST = "http://dzt-test.zhidaohulian.com";
|
||||
public static final String HOST_DEMO = "http://dzt-show.zhidaohulian.com";
|
||||
public static final String HOST_PRODUCT = "https://dzt.zhidaohulian.com";
|
||||
|
||||
public static String getNetHost() {
|
||||
switch ( DebugConfig.getNetMode() ) {
|
||||
case DebugConfig.NET_MODE_DEV:
|
||||
return HOST_DEV;
|
||||
case DebugConfig.NET_MODE_QA:
|
||||
return HOST_TEST;
|
||||
case DebugConfig.NET_MODE_DEMO:
|
||||
return HOST_DEMO;
|
||||
default:
|
||||
return HOST_PRODUCT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.zhidao.mogo.module.event.panel.network;
|
||||
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventDescription;
|
||||
import com.zhidao.mogo.module.event.panel.bean.ShareEventItem;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.FieldMap;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
public interface ShareEventApiService {
|
||||
|
||||
//我的分享-热心指数等
|
||||
@FormUrlEncoded
|
||||
@POST("/deva/poiInfoFabulous/car/poi/no/queryEnthusiasmIndex/v1")
|
||||
Observable<ShareEventDescription> getEnthusiasmIndex(@FieldMap Map<String, Object> parames);
|
||||
|
||||
//我的分享-列表
|
||||
@FormUrlEncoded
|
||||
@POST("/deva/car/pathAndPoi/no/queryInfo")
|
||||
Observable<ShareEventItem> getShareEventList(@FieldMap Map<String, Object> parames);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.zhidao.mogo.module.event.panel.network;
|
||||
|
||||
public class ShareEventParameter {
|
||||
private String sn;
|
||||
private int pageNum;
|
||||
private int pageSize;
|
||||
|
||||
public ShareEventParameter(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public ShareEventParameter(String sn, int pageNum, int pageSize) {
|
||||
this.sn = sn;
|
||||
this.pageNum = pageNum;
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
android:id="@+id/btnShowOrHidePanels"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="200dp"
|
||||
android:layout_marginTop="300dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="显示面板"
|
||||
android:textColor="#000"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
android:text="你还没有分享过道路事件,快去试试吧" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/shre_event_button"
|
||||
android:id="@+id/share_event_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/share_event_null_des"
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:background="#1E90FF"
|
||||
android:text="道路类型"
|
||||
android:textColor="#FFFFFF"
|
||||
@@ -23,7 +23,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/road_case_style"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="15dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:text="东城区北三环"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp" />
|
||||
@@ -34,7 +34,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/road_case_address"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:text="时间:"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<Button
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/event_share_load_status"
|
||||
android:textColor="#000000"
|
||||
android:text="没有更多了"
|
||||
android:textSize="18sp"
|
||||
android:gravity="center"/>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -8,5 +8,7 @@
|
||||
android:orientation="vertical"
|
||||
android:overScrollMode="never"
|
||||
android:background="#000000"
|
||||
tools:itemCount="1"
|
||||
tools:listitem="@layout/module_event_panel_share_description"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
|
||||
|
||||
|
||||
@@ -140,12 +140,12 @@ public class V2XModuleProvider implements
|
||||
intentFilter.addAction(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
|
||||
localBroadcastManager.registerReceiver(localReceiver, intentFilter);
|
||||
|
||||
// if (BuildConfig.DEBUG) {
|
||||
// // TODO 这是测试页面
|
||||
// V2XServiceManager
|
||||
// .getIMogoWindowManager()
|
||||
// .addView(new V2XTestConsoleWindow(context), 0, 0, false);
|
||||
// }
|
||||
if (BuildConfig.DEBUG) {
|
||||
// TODO 这是测试页面
|
||||
V2XServiceManager
|
||||
.getIMogoWindowManager()
|
||||
.addView(new V2XTestConsoleWindow(context), 0, 0, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void initVoice(Context context) {
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.mogo.module.v2x.adapter;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.module.v2x.adapter.holder.V2XPushEventDetailVH;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020/3/11 4:05 PM
|
||||
* desc : V2X 场景事件列表中的数据适配器
|
||||
* version: 1.0
|
||||
*/
|
||||
public class V2XPushEventAdapter extends RecyclerView.Adapter<V2XPushEventDetailVH> {
|
||||
|
||||
private List<V2XPushMessageEntity> itemList;
|
||||
|
||||
public V2XPushEventAdapter(List<V2XPushMessageEntity> itemList) {
|
||||
this.itemList = itemList;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public V2XPushEventDetailVH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new V2XPushEventDetailVH(parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull V2XPushEventDetailVH holder, int position) {
|
||||
holder.initView(itemList.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return itemList.get(position).getViewType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return itemList == null ? 0 : itemList.size();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,9 +6,12 @@ import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.module.common.entity.V2XEventShowEntity;
|
||||
import com.mogo.module.v2x.adapter.holder.V2XLiveVideoVH;
|
||||
import com.mogo.module.v2x.adapter.holder.V2XRoadEventDetailVH;
|
||||
import com.mogo.module.common.entity.V2XWindowTypeEnum;
|
||||
import com.mogo.module.v2x.adapter.holder.V2XFatigueDrivingDetailVH;
|
||||
import com.mogo.module.v2x.adapter.holder.V2XIllegalParkDetailVH;
|
||||
import com.mogo.module.v2x.adapter.holder.V2XLiveVideoVH;
|
||||
import com.mogo.module.v2x.adapter.holder.V2XPushEventDetailVH;
|
||||
import com.mogo.module.v2x.adapter.holder.V2XRoadEventDetailVH;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -32,14 +35,28 @@ public class V2XRoadEventAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
RecyclerView.ViewHolder holder;
|
||||
switch (viewType) {
|
||||
// 直播
|
||||
case V2XWindowTypeEnum.LIVE_CAR_WINDOW:
|
||||
holder = new V2XLiveVideoVH(parent);
|
||||
break;
|
||||
//道路事件详情
|
||||
case V2XWindowTypeEnum.ROAD_EVENT_WINDOW:
|
||||
holder = new V2XRoadEventDetailVH(parent);
|
||||
break;
|
||||
//违章停车
|
||||
case V2XWindowTypeEnum.ILLEGAL_PARK_WINDOW:
|
||||
holder = new V2XIllegalParkDetailVH(parent);
|
||||
break;
|
||||
//推送展示
|
||||
case V2XWindowTypeEnum.PUSH_EVENT_WINDOW:
|
||||
holder = new V2XPushEventDetailVH(parent);
|
||||
break;
|
||||
//疲劳驾驶
|
||||
case V2XWindowTypeEnum.FATIGUE_DRIVING_WINDOW:
|
||||
holder = new V2XFatigueDrivingDetailVH(parent);
|
||||
break;
|
||||
default:
|
||||
holder = new V2XRoadEventDetailVH(parent);
|
||||
holder = new V2XPushEventDetailVH(parent);
|
||||
}
|
||||
return holder;
|
||||
}
|
||||
@@ -52,6 +69,12 @@ public class V2XRoadEventAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
||||
if (holder instanceof V2XRoadEventDetailVH) {
|
||||
((V2XRoadEventDetailVH) holder).initView(itemList.get(position));
|
||||
}
|
||||
if (holder instanceof V2XIllegalParkDetailVH) {
|
||||
((V2XIllegalParkDetailVH) holder).initView(itemList.get(position));
|
||||
}
|
||||
if (holder instanceof V2XPushEventDetailVH) {
|
||||
((V2XPushEventDetailVH) holder).initView(itemList.get(position));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.mogo.module.v2x.adapter.holder;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mogo.module.common.entity.V2XEventShowEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.scenario.scene.push.V2XPushEventScenario;
|
||||
|
||||
/**
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020/3/11 4:35 PM
|
||||
* desc : 疲劳驾驶
|
||||
* version: 1.0
|
||||
*
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class V2XFatigueDrivingDetailVH extends V2XBaseViewHolder {
|
||||
|
||||
private TextView mTvAddress, mTvAddressDistance;
|
||||
private ImageView mIvToNav;
|
||||
|
||||
public V2XFatigueDrivingDetailVH(ViewGroup viewGroup) {
|
||||
super(LayoutInflater.from(viewGroup.getContext())
|
||||
.inflate(R.layout.window_fatigue_driving, viewGroup, false));
|
||||
}
|
||||
|
||||
public void initView(V2XEventShowEntity v2XEventShowEntity) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 延迟关闭窗体
|
||||
*/
|
||||
@Override
|
||||
public void delayedCloseWindow() {
|
||||
itemView.postDelayed(() -> V2XPushEventScenario.getInstance().close(), 1000);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.mogo.module.v2x.adapter.holder;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.V2XEventShowEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkScenario;
|
||||
import com.mogo.module.v2x.utils.RoadConditionUtils;
|
||||
import com.mogo.module.v2x.view.HeartLikeView;
|
||||
import com.mogo.module.v2x.view.HeartUnLikeView;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceConstants;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
|
||||
/**
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020/3/11 4:35 PM
|
||||
* desc : 违章停车弹窗
|
||||
* version: 1.0
|
||||
*
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class V2XIllegalParkDetailVH extends V2XBaseViewHolder {
|
||||
private TextView mAddressTv;
|
||||
private TextView mIllegalNumTv;
|
||||
private HeartLikeView mIlIllegalParkingLike;
|
||||
private HeartUnLikeView mIIllegalParkingUnLike;
|
||||
|
||||
private MarkerExploreWay mExploreWay;
|
||||
|
||||
// 反馈按钮语音操控
|
||||
private V2XVoiceCallbackListener v2XVoiceCallbackYouYongListener = (command, intent) -> roadReportTrue();
|
||||
private V2XVoiceCallbackListener v2XVoiceCallbackMeiYongListener = (command, intent) -> roadReportErr();
|
||||
|
||||
public V2XIllegalParkDetailVH(ViewGroup viewGroup) {
|
||||
super(LayoutInflater.from(viewGroup.getContext())
|
||||
.inflate(R.layout.window_illegal_parking, viewGroup, false));
|
||||
|
||||
mAddressTv = itemView.findViewById(R.id.tvAddress);
|
||||
mIllegalNumTv = itemView.findViewById(R.id.tvIllegalNum);
|
||||
mIlIllegalParkingLike = itemView.findViewById(R.id.llIllegalParkingLike);
|
||||
mIIllegalParkingUnLike = itemView.findViewById(R.id.llIllegalParkingUnLike);
|
||||
|
||||
// 设置视图状态监听
|
||||
itemView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
|
||||
@Override
|
||||
public void onViewAttachedToWindow(View v) {
|
||||
//Logger.w(MODULE_NAME, "列表View V2XPushEventDetailVH 触发 onViewAttachedToWindow");
|
||||
// 注册语音交互
|
||||
V2XVoiceManager.INSTANCE
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_YOUYONG_UN_WAKEUP,
|
||||
v2XVoiceCallbackYouYongListener)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_MEIYONG_UN_WAKEUP,
|
||||
v2XVoiceCallbackMeiYongListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewDetachedFromWindow(View v) {
|
||||
//Logger.w(MODULE_NAME, "列表View V2XPushEventDetailVH 触发 onViewDetachedFromWindow");
|
||||
V2XServiceManager.getMogoRegisterCenter().unregisterMogoNaviListener(MODULE_NAME);
|
||||
// 反注册语音交互
|
||||
V2XVoiceManager.INSTANCE
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_YOUYONG_UN_WAKEUP)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_MEIYONG_UN_WAKEUP);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void initView(V2XEventShowEntity v2XEventShowEntity) {
|
||||
mExploreWay = v2XEventShowEntity.getV2XIllegalPark();
|
||||
mAddressTv.setText(mExploreWay.getAddr());
|
||||
try {
|
||||
mIllegalNumTv.setText("违章人数:" + (int) mExploreWay.getItems().get(0).getIllegalCount());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
mIlIllegalParkingLike.setOnClickCallListener(v -> {
|
||||
Logger.d(V2XConst.MODULE_NAME, "反馈有用");
|
||||
roadReportTrue();
|
||||
});
|
||||
|
||||
mIIllegalParkingUnLike.setOnClickCallListener(v -> {
|
||||
Logger.d(V2XConst.MODULE_NAME, "反馈无用");
|
||||
roadReportErr();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 延迟关闭窗体
|
||||
*/
|
||||
@Override
|
||||
public void delayedCloseWindow() {
|
||||
itemView.postDelayed(() -> V2XIllegalParkScenario.getInstance().close(), 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 反馈路况正确
|
||||
*/
|
||||
private void roadReportTrue() {
|
||||
if (mExploreWay != null) {
|
||||
RoadConditionUtils.sendDataErrorReceiverInfo(
|
||||
mExploreWay.getPoiType(),
|
||||
mExploreWay.getInfoId(),
|
||||
"2");
|
||||
}
|
||||
delayedCloseWindow();
|
||||
}
|
||||
|
||||
/**
|
||||
* 反馈路况错误
|
||||
*/
|
||||
private void roadReportErr() {
|
||||
if (mExploreWay != null) {
|
||||
RoadConditionUtils.sendDataErrorReceiverInfo(
|
||||
mExploreWay.getPoiType(),
|
||||
mExploreWay.getInfoId(),
|
||||
"1");
|
||||
}
|
||||
delayedCloseWindow();
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import android.widget.ImageView;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerUserInfo;
|
||||
import com.mogo.module.common.entity.V2XEventShowEntity;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
@@ -133,8 +134,8 @@ public class V2XPushEventDetailVH extends V2XBaseViewHolder {
|
||||
});
|
||||
}
|
||||
|
||||
public void initView(V2XPushMessageEntity v2XRoadEventEntity) {
|
||||
mV2XRoadEventEntity = v2XRoadEventEntity;
|
||||
public void initView(V2XEventShowEntity v2XEventShowEntity) {
|
||||
mV2XRoadEventEntity = v2XEventShowEntity.getV2XPushMessageEntity();
|
||||
mNoveltyInfo = new MarkerExploreWay();
|
||||
mNoveltyInfo.setSn(mV2XRoadEventEntity.getSn());
|
||||
mNoveltyInfo.setInfoId(mV2XRoadEventEntity.getSceneId());
|
||||
@@ -143,16 +144,16 @@ public class V2XPushEventDetailVH extends V2XBaseViewHolder {
|
||||
location.setLon(mV2XRoadEventEntity.getLon());
|
||||
mNoveltyInfo.setLocation(location);
|
||||
|
||||
if (!TextUtils.isEmpty(v2XRoadEventEntity.getMsgImgUrl())) {
|
||||
if (!TextUtils.isEmpty(mV2XRoadEventEntity.getMsgImgUrl())) {
|
||||
V2XServiceManager.getImageLoader()
|
||||
.displayImage(v2XRoadEventEntity.getMsgImgUrl(), ivImg);
|
||||
.displayImage(mV2XRoadEventEntity.getMsgImgUrl(), ivImg);
|
||||
}
|
||||
if (!TextUtils.isEmpty(v2XRoadEventEntity.getHeadImgUrl())) {
|
||||
if (!TextUtils.isEmpty(mV2XRoadEventEntity.getHeadImgUrl())) {
|
||||
V2XServiceManager.getImageLoader()
|
||||
.displayImage(v2XRoadEventEntity.getHeadImgUrl(), ivReportHead);
|
||||
.displayImage(mV2XRoadEventEntity.getHeadImgUrl(), ivReportHead);
|
||||
}
|
||||
|
||||
switch (v2XRoadEventEntity.getSceneId()) {
|
||||
switch (mV2XRoadEventEntity.getSceneId()) {
|
||||
case "100015"://取快递
|
||||
case "100016"://顺风车
|
||||
ivRoadEventNav.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Intent;
|
||||
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.mogo.module.common.entity.V2XHistoryScenarioData;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.scenario.IV2XScenarioManager;
|
||||
@@ -15,10 +16,13 @@ import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkScenario;
|
||||
import com.mogo.module.v2x.scenario.scene.push.V2XPushEventScenario;
|
||||
import com.mogo.module.v2x.scenario.scene.road.V2XRoadEventScenario;
|
||||
import com.mogo.module.v2x.scenario.scene.seek.V2XSeekHelpScenario;
|
||||
import com.mogo.module.v2x.utils.TimeUtils;
|
||||
import com.mogo.module.v2x.utils.ToastUtils;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.mogo.utils.sqlite.BaseDaoFactory;
|
||||
import com.mogo.utils.sqlite.IBaseDao;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -36,6 +40,11 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
private AbsV2XScenario mV2XScenario;
|
||||
private HashMap<Integer, AbsV2XScenario> mV2XScenarioSet = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 场景数据管理
|
||||
*/
|
||||
private static IBaseDao<V2XHistoryScenarioData> mScenarioDao;
|
||||
|
||||
private V2XScenarioManager() {
|
||||
}
|
||||
|
||||
@@ -44,6 +53,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
synchronized (V2XScenarioManager.class) {
|
||||
if (mV2XScenarioManager == null) {
|
||||
mV2XScenarioManager = new V2XScenarioManager();
|
||||
mScenarioDao = BaseDaoFactory.Companion.getInstance().getBaseDao(V2XUtils.getApp(), V2XHistoryScenarioData.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,6 +68,17 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
V2XUtils.runOnUiThread(() -> {
|
||||
// 提取之前存储的场景
|
||||
if (v2XMessageEntity != null) {
|
||||
try {
|
||||
// 进行数据库存储
|
||||
V2XHistoryScenarioData v2XHistoryScenarioData = new V2XHistoryScenarioData();
|
||||
v2XHistoryScenarioData.setScenarioType(v2XMessageEntity.getType());
|
||||
v2XHistoryScenarioData.setTriggerTime(TimeUtils.getNowMills());
|
||||
v2XHistoryScenarioData.setEventJsonData(GsonUtil.jsonFromObject(v2XMessageEntity.getContent()));
|
||||
mScenarioDao.insert(v2XHistoryScenarioData);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// 广播给应用内部其它模块
|
||||
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_ACTION);
|
||||
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
|
||||
|
||||
@@ -2,19 +2,21 @@ package com.mogo.module.v2x.scenario.scene.livecar;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerCarInfo;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.v2x.listener.V2XWindowStatusListener;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XWindow;
|
||||
import com.mogo.module.v2x.utils.MarkerUtils;
|
||||
import com.mogo.module.v2x.view.V2XLiveGSYVideoView;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
@@ -30,6 +32,7 @@ public class V2XPushLiveCarWindow extends RelativeLayout implements IV2XWindow<V
|
||||
|
||||
private Context mContext;
|
||||
private V2XLiveGSYVideoView mV2XLiveGSYVideoView;
|
||||
private MogoImageView mIvReportHead;
|
||||
// 弹窗状态监听
|
||||
private V2XWindowStatusListener mV2XWindowStatusListener;
|
||||
|
||||
@@ -60,6 +63,7 @@ public class V2XPushLiveCarWindow extends RelativeLayout implements IV2XWindow<V
|
||||
LayoutInflater.from(context).inflate(R.layout.window_push_live_video, this);
|
||||
// 详情列表
|
||||
mV2XLiveGSYVideoView = findViewById(R.id.videoPlayer);
|
||||
mIvReportHead = findViewById(R.id.ivReportHead);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,6 +74,11 @@ public class V2XPushLiveCarWindow extends RelativeLayout implements IV2XWindow<V
|
||||
if (entity != null) {
|
||||
Logger.w(MODULE_NAME, "更新直播信息。。。。。" + entity);
|
||||
|
||||
if (!TextUtils.isEmpty(entity.getHeadImgUrl())) {
|
||||
mIvReportHead.setVisibility(VISIBLE);
|
||||
V2XServiceManager.getImageLoader()
|
||||
.displayImage(entity.getHeadImgUrl(), mIvReportHead);
|
||||
}
|
||||
// 启动播放
|
||||
MarkerCarInfo.CarLiveInfo carLiveInfo = new MarkerCarInfo.CarLiveInfo();
|
||||
carLiveInfo.setVideoChannel(entity.getVideoChannel());
|
||||
|
||||
@@ -7,34 +7,39 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.PagerSnapHelper;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.V2XEventShowEntity;
|
||||
import com.mogo.module.common.entity.V2XWindowTypeEnum;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.adapter.V2XRoadEventAdapter;
|
||||
import com.mogo.module.v2x.listener.V2XWindowStatusListener;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XWindow;
|
||||
import com.mogo.module.v2x.utils.RoadConditionUtils;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.module.v2x.view.HeartLikeView;
|
||||
import com.mogo.module.v2x.view.HeartUnLikeView;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceConstants;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 违章停车
|
||||
* 弹窗视图
|
||||
*/
|
||||
public class V2XIllegalParkWindow extends RelativeLayout implements IV2XWindow<MarkerExploreWay> {
|
||||
private static final String TAG = "V2XLegalParkWindow";
|
||||
|
||||
private TextView mAddressTv;
|
||||
private TextView mIllegalNumTv;
|
||||
private HeartLikeView mIlIllegalParkingLike;
|
||||
private HeartUnLikeView mIIllegalParkingUnLike;
|
||||
private static final String TAG = "V2XIllegalParkWindow";
|
||||
// 展示列表
|
||||
private RecyclerView mRecyclerView;
|
||||
// 列表数据适配器
|
||||
private V2XRoadEventAdapter mV2XRoadEventAdapter;
|
||||
// 列表展示
|
||||
private List<V2XEventShowEntity> mItemList = new ArrayList<>();
|
||||
|
||||
// 处理道路事件,20秒倒计时
|
||||
private Handler handlerV2XEvent = new Handler();
|
||||
@@ -44,10 +49,6 @@ public class V2XIllegalParkWindow extends RelativeLayout implements IV2XWindow<M
|
||||
|
||||
private MarkerExploreWay mExploreWay;
|
||||
|
||||
// 反馈按钮语音操控
|
||||
private V2XVoiceCallbackListener v2XVoiceCallbackYouYongListener = (command, intent) -> roadReportTrue();
|
||||
private V2XVoiceCallbackListener v2XVoiceCallbackMeiYongListener = (command, intent) -> roadReportErr();
|
||||
|
||||
public V2XIllegalParkWindow() {
|
||||
this(V2XServiceManager.getContext(), null);
|
||||
}
|
||||
@@ -69,12 +70,28 @@ public class V2XIllegalParkWindow extends RelativeLayout implements IV2XWindow<M
|
||||
* 初始化视图
|
||||
*/
|
||||
private void initView(Context context) {
|
||||
LayoutInflater.from(context).inflate(R.layout.window_illegal_parking, this);
|
||||
|
||||
mAddressTv = findViewById(R.id.tvAddress);
|
||||
mIllegalNumTv = findViewById(R.id.tvIllegalNum);
|
||||
mIlIllegalParkingLike = findViewById(R.id.llIllegalParkingLike);
|
||||
mIIllegalParkingUnLike = findViewById(R.id.llIllegalParkingUnLike);
|
||||
LayoutInflater.from(context).inflate(R.layout.window_road_event_detail, this);
|
||||
// 详情列表
|
||||
mRecyclerView = findViewById(R.id.rvRoadEventList);
|
||||
mV2XRoadEventAdapter = new V2XRoadEventAdapter(mItemList);
|
||||
mRecyclerView.setAdapter(mV2XRoadEventAdapter);
|
||||
// 设置切换样式
|
||||
new PagerSnapHelper().attachToRecyclerView(mRecyclerView);
|
||||
// 配置列表朝向
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
|
||||
mRecyclerView.setLayoutManager(layoutManager);
|
||||
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
|
||||
super.onScrollStateChanged(recyclerView, newState);
|
||||
if (recyclerView.getChildCount() > 0) {
|
||||
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
|
||||
// 用户处于交互的时候延后隐藏时间
|
||||
countDownV2XEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void show(MarkerExploreWay entity, boolean isAutoClose) {
|
||||
@@ -89,23 +106,17 @@ public class V2XIllegalParkWindow extends RelativeLayout implements IV2XWindow<M
|
||||
public void show(MarkerExploreWay entity) {
|
||||
mExploreWay = entity;
|
||||
//Logger.d(V2XConst.MODULE_NAME, "V2X===违章停车:展示 Window=\n" + entity);
|
||||
mAddressTv.setText(entity.getAddr());
|
||||
try {
|
||||
mIllegalNumTv.setText("违章人数:" + (int) entity.getItems().get(0).getIllegalCount());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// 清空数据
|
||||
mItemList.clear();
|
||||
if (mExploreWay != null) {
|
||||
//Logger.d(MODULE_NAME, "V2X===推送消息:" + v2XRoadEventEntity);
|
||||
V2XEventShowEntity v2XEventShowEntity = new V2XEventShowEntity();
|
||||
v2XEventShowEntity.setV2XIllegalPark(mExploreWay);
|
||||
v2XEventShowEntity.setViewType(V2XWindowTypeEnum.ILLEGAL_PARK_WINDOW);
|
||||
mItemList.add(v2XEventShowEntity);
|
||||
}
|
||||
|
||||
mIlIllegalParkingLike.setOnClickCallListener(v -> {
|
||||
Logger.d(V2XConst.MODULE_NAME, "反馈有用");
|
||||
roadReportTrue();
|
||||
});
|
||||
|
||||
mIIllegalParkingUnLike.setOnClickCallListener(v -> {
|
||||
Logger.d(V2XConst.MODULE_NAME, "反馈无用");
|
||||
roadReportErr();
|
||||
});
|
||||
|
||||
// 刷新列表
|
||||
mV2XRoadEventAdapter.notifyDataSetChanged();
|
||||
// 倒计时
|
||||
if (mIsAutoClose) {
|
||||
countDownV2XEvent();
|
||||
@@ -120,14 +131,6 @@ public class V2XIllegalParkWindow extends RelativeLayout implements IV2XWindow<M
|
||||
|
||||
// 添加弹窗
|
||||
V2XServiceManager.getMogoTopViewManager().addView(this, layoutParams);
|
||||
|
||||
// 注册语音交互
|
||||
V2XVoiceManager.INSTANCE
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_YOUYONG_UN_WAKEUP,
|
||||
v2XVoiceCallbackYouYongListener)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_MEIYONG_UN_WAKEUP,
|
||||
v2XVoiceCallbackMeiYongListener);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,11 +139,6 @@ public class V2XIllegalParkWindow extends RelativeLayout implements IV2XWindow<M
|
||||
@Override
|
||||
public void close() {
|
||||
mIsAutoClose = false;
|
||||
|
||||
V2XVoiceManager.INSTANCE
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_YOUYONG_UN_WAKEUP)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_MEIYONG_UN_WAKEUP);
|
||||
|
||||
// 停止倒计时
|
||||
if (handlerV2XEvent != null && runnableV2XEvent != null) {
|
||||
handlerV2XEvent.removeCallbacks(runnableV2XEvent);
|
||||
@@ -179,31 +177,4 @@ public class V2XIllegalParkWindow extends RelativeLayout implements IV2XWindow<M
|
||||
Logger.d(V2XConst.MODULE_NAME, "V2X===违章停车 Window 展示开始倒计时:" + mExpireTime);
|
||||
handlerV2XEvent.postDelayed(runnableV2XEvent, mExpireTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 反馈路况正确
|
||||
*/
|
||||
private void roadReportTrue() {
|
||||
if (mExploreWay != null) {
|
||||
RoadConditionUtils.sendDataErrorReceiverInfo(
|
||||
mExploreWay.getPoiType(),
|
||||
mExploreWay.getInfoId(),
|
||||
"2");
|
||||
}
|
||||
close();
|
||||
}
|
||||
|
||||
/**
|
||||
* 反馈路况错误
|
||||
*/
|
||||
private void roadReportErr() {
|
||||
if (mExploreWay != null) {
|
||||
RoadConditionUtils.sendDataErrorReceiverInfo(
|
||||
mExploreWay.getPoiType(),
|
||||
mExploreWay.getInfoId(),
|
||||
"1");
|
||||
}
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,10 +13,12 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.PagerSnapHelper;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.module.common.entity.V2XEventShowEntity;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XWindowTypeEnum;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.adapter.V2XPushEventAdapter;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.v2x.adapter.V2XRoadEventAdapter;
|
||||
import com.mogo.module.v2x.listener.V2XWindowStatusListener;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XWindow;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
|
||||
@@ -42,9 +44,9 @@ public class V2XPushEventWindow extends RelativeLayout implements IV2XWindow<V2X
|
||||
// 展示列表
|
||||
private RecyclerView mRecyclerView;
|
||||
// 列表数据适配器
|
||||
private V2XPushEventAdapter mV2XRoadEventAdapter;
|
||||
private V2XRoadEventAdapter mV2XRoadEventAdapter;
|
||||
// 列表展示
|
||||
private List<V2XPushMessageEntity> mItemList = new ArrayList<>();
|
||||
private List<V2XEventShowEntity> mItemList = new ArrayList<>();
|
||||
// 处理道路事件,30秒倒计时
|
||||
private Handler handlerV2XEvent = new Handler();
|
||||
private Runnable runnableV2XEvent;
|
||||
@@ -80,7 +82,7 @@ public class V2XPushEventWindow extends RelativeLayout implements IV2XWindow<V2X
|
||||
LayoutInflater.from(context).inflate(R.layout.window_push_event_detail, this);
|
||||
// 详情列表
|
||||
mRecyclerView = findViewById(R.id.rvRoadEventList);
|
||||
mV2XRoadEventAdapter = new V2XPushEventAdapter(mItemList);
|
||||
mV2XRoadEventAdapter = new V2XRoadEventAdapter(mItemList);
|
||||
mRecyclerView.setAdapter(mV2XRoadEventAdapter);
|
||||
// 设置切换样式
|
||||
new PagerSnapHelper().attachToRecyclerView(mRecyclerView);
|
||||
@@ -110,7 +112,10 @@ public class V2XPushEventWindow extends RelativeLayout implements IV2XWindow<V2X
|
||||
mItemList.clear();
|
||||
if (v2XRoadEventEntity != null) {
|
||||
//Logger.d(MODULE_NAME, "V2X===推送消息:" + v2XRoadEventEntity);
|
||||
mItemList.add(v2XRoadEventEntity);
|
||||
V2XEventShowEntity v2XEventShowEntity = new V2XEventShowEntity();
|
||||
v2XEventShowEntity.setV2XPushMessageEntity(v2XRoadEventEntity);
|
||||
v2XEventShowEntity.setViewType(V2XWindowTypeEnum.PUSH_EVENT_WINDOW);
|
||||
mItemList.add(v2XEventShowEntity);
|
||||
}
|
||||
// 刷新列表
|
||||
mV2XRoadEventAdapter.notifyDataSetChanged();
|
||||
|
||||
@@ -103,7 +103,6 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
properties.put("style", style);
|
||||
V2XServiceManager.getMogoAnalytics().track(V2XConst.V2X_ROAD_SHOW, properties);
|
||||
}
|
||||
String json = "{\"exploreWay\":[{\"addr\":\"东城区小黄庄北街2号靠近中国银行(北京安贞桥支行)\",\"userInfo\":{\"userName\":\"玉涛1\",\"sn\":\"E841CC2018PZD20143\",\"userHead\":\"http://img.zhidaohulian.com/fileServer/api/prod/user_info/726761827601/914019cfda5ab4b618e7f00e093eda82.jpg\",\"safeLabelType\":0,\"userId\":726761827601},\"cityName\":\"北京市\",\"uploadType\":\"0\",\"type\":\"CARD_TYPE_ROAD_CONDITION\",\"poiType\":\"10015\",\"infoId\":\"56280492\",\"items\":[{\"url\":\"http://petchfile-1255510688.cos.ap-beijing.myqcloud.com/CarPad/com.zhidao.roadcondition/E841CC2018PZD20143/E841CC2018PZD20143_20200722112917/PhotoFront_20200722_112918.JPG?sign\\u003dq-sign-algorithm%3Dsha1%26q-ak%3DAKIDCWfcNwD5PXVWLxwejccR3Tiz5zhIkx0T%26q-sign-time%3D1595388896%3B1595396096%26q-key-time%3D1595388896%3B1595396096%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D2301fa50ff90f5b34f7f7c05a13a15f39abde9eb\",\"illegalCount\":0.0}],\"location\":{\"address\":\"东城区小黄庄北街2号靠近中国银行(北京安贞桥支行)\",\"angle\":0.0,\"lat\":39.968223,\"lon\":116.410857},\"generateTime\":1595388559153,\"distance\":47.0,\"fileType\":0,\"direction\":0,\"canLive\":false}]}";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,20 +4,22 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.google.android.flexbox.FlexboxLayout;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.alarm.V2XAlarmServer;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
|
||||
import com.mogo.module.v2x.utils.TestOnLineCarUtils;
|
||||
import com.mogo.module.v2x.utils.ToastUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -29,8 +31,10 @@ import java.util.List;
|
||||
* version: 1.0
|
||||
*/
|
||||
public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
|
||||
private FlexboxLayout mFlTestPanel;
|
||||
private Button mBtnTriggerOpen;
|
||||
private Button mBtnTriggerRoadEvent;
|
||||
private Button mBtnClearRoadEvent;
|
||||
private Button mBtnTriggerPushEvent;
|
||||
private Button mBtnTriggerPushLiveCarEvent;
|
||||
private Button mBtnTriggerAnimationEvent;
|
||||
@@ -54,6 +58,9 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
private void initView(Context context) {
|
||||
LayoutInflater.from(context).inflate(R.layout.window_test_console, this);
|
||||
|
||||
mFlTestPanel = findViewById(R.id.flTestPanel);
|
||||
mBtnTriggerOpen = findViewById(R.id.btnTriggerOpen);
|
||||
mBtnClearRoadEvent = findViewById(R.id.btnClearRoadEvent);
|
||||
mBtnTriggerRoadEvent = findViewById(R.id.btnTriggerRoadEvent);
|
||||
mBtnTriggerPushEvent = findViewById(R.id.btnTriggerPushEvent);
|
||||
mBtnTriggerPushLiveCarEvent = findViewById(R.id.btnTriggerPushLiveCarEvent);
|
||||
@@ -62,6 +69,13 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
mBtnTriggerSeekHelpEvent = findViewById(R.id.btnTriggerSeekHelpEvent);
|
||||
mBtnTriggerParkEvent = findViewById(R.id.btnTriggerParkEvent);
|
||||
|
||||
mBtnTriggerOpen.setOnClickListener(v -> mFlTestPanel.setVisibility(GONE));
|
||||
|
||||
mBtnClearRoadEvent.setOnClickListener(v -> {
|
||||
V2XAlarmServer.mAlertRoadEventList.clear();
|
||||
ToastUtils.showShort("缓存已清除");
|
||||
});
|
||||
|
||||
mBtnTriggerRoadEvent.setOnClickListener(v -> {
|
||||
V2XMessageEntity<V2XRoadEventEntity> v2XMessageEntity =
|
||||
TestOnLineCarUtils.getV2XScenarioRoadEventData();
|
||||
@@ -82,7 +96,7 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
|
||||
mBtnTriggerPushLiveCarEvent.setOnClickListener(v -> {
|
||||
V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity =
|
||||
TestOnLineCarUtils.getV2XScenarioPushEventData();
|
||||
TestOnLineCarUtils.getV2XScenarioPushLiveEventData();
|
||||
|
||||
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
|
||||
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
|
||||
|
||||
@@ -2,11 +2,11 @@ package com.mogo.module.v2x.utils;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@@ -122,6 +122,40 @@ public class TestOnLineCarUtils {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 模拟H5推送直播数据
|
||||
*/
|
||||
public static V2XMessageEntity<V2XPushMessageEntity> getV2XScenarioPushLiveEventData() {
|
||||
try {
|
||||
InputStream inputStream = V2XUtils.getApp()
|
||||
.getResources()
|
||||
.openRawResource(R.raw.scenario_push_live_event_data);
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
int len = -1;
|
||||
byte[] buffer = new byte[1024];
|
||||
while ((len = inputStream.read(buffer)) != -1) {
|
||||
baos.write(buffer, 0, len);
|
||||
}
|
||||
inputStream.close();
|
||||
|
||||
// 加载数据源
|
||||
V2XPushMessageEntity v2xRoadEventEntity = GsonUtil.objectFromJson(baos.toString(), V2XPushMessageEntity.class);
|
||||
|
||||
V2XMessageEntity<V2XPushMessageEntity> v2xMessageEntity = new V2XMessageEntity<>();
|
||||
// 控制类型
|
||||
v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_LIVE_CAR_WARNING);
|
||||
// 设置数据
|
||||
v2xMessageEntity.setContent(v2xRoadEventEntity);
|
||||
// 控制展示状态
|
||||
v2xMessageEntity.setShowState(true);
|
||||
return v2xMessageEntity;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟H5推送场景动画数据
|
||||
*/
|
||||
|
||||
@@ -7,17 +7,43 @@
|
||||
android:paddingStart="@dimen/module_main_v2x_animation_width">
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/flTestPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="@dimen/dp_150"
|
||||
android:paddingEnd="@dimen/dp_100"
|
||||
app:alignContent="flex_start"
|
||||
app:alignItems="center"
|
||||
app:flexDirection="row"
|
||||
android:paddingStart="@dimen/dp_150"
|
||||
app:flexWrap="wrap"
|
||||
app:justifyContent="flex_start">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnTriggerOpen"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="隐藏测试按钮面板"
|
||||
android:background="#FFF"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_22"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnClearRoadEvent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#6BCF23"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="清除缓存播报"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_22"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnTriggerRoadEvent"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"sceneId": "100016",
|
||||
"alarmContent": "顺风车提醒",
|
||||
"expireTime": 30000,
|
||||
"sceneCategory": 0,
|
||||
"sceneDescription": "周围有路人发起顺风车",
|
||||
"sceneName": "顺风车提醒",
|
||||
"sceneLevel": 0,
|
||||
"videoUrl": "rtmp://58.200.131.2:1935/livetv/hunantv",
|
||||
"videoChannel": "C_1",
|
||||
"videoSn": "XTCBA90740400625",
|
||||
"tts": "附近直播车辆",
|
||||
"zoom": true,
|
||||
"zoomScale": 15,
|
||||
"location": {
|
||||
"lat": 39.971417,
|
||||
"lon": 116.415853
|
||||
},
|
||||
"headImgUrl": "https://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/defaultUserHeadImg/5.png",
|
||||
"msgImgUrl": "https://upload.jianshu.io/users/upload_avatars/7663825/7c28763e-002b-4e89-8dea-5b8da210ef2c.jpg"
|
||||
}
|
||||
Reference in New Issue
Block a user