[change] 添加数据订阅、取消订阅请求
This commit is contained in:
@@ -114,7 +114,6 @@ public class DataDistribution {
|
||||
public final List<String> listStatusInfo = new ArrayList<>();
|
||||
public final List<String> listRecordDataConfig = new ArrayList<>();
|
||||
public final List<String> listErrorData = new ArrayList<>();
|
||||
public final List<String> listPointCloud = new ArrayList<>();
|
||||
public final List<String> listOriginalPointCloud = new ArrayList<>();
|
||||
public final List<String> listPlanningObjects = new ArrayList<>();
|
||||
|
||||
@@ -144,14 +143,6 @@ public class DataDistribution {
|
||||
if (listener != null && Constants.TITLE.RECEIVE_TRACKED_OBJECTS.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (data instanceof MyPointCloud) {
|
||||
listPointCloud.add(0, time + str);
|
||||
if (listPointCloud.size() > LIST_SIZE) {
|
||||
listPointCloud.remove(listPointCloud.size() - 1);
|
||||
}
|
||||
if (listener != null && Constants.TITLE.RECEIVE_POINT_CLOUD.equals(listener.first)) {
|
||||
listener.second.onRefresh();
|
||||
}
|
||||
} else if (data instanceof OriginalPointCloudData) {
|
||||
listOriginalPointCloud.add(0, time + str);
|
||||
if (listOriginalPointCloud.size() > LIST_SIZE) {
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
package com.zhidao.adas.client.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.zhidao.adas.client.R;
|
||||
import com.zhidao.adas.client.bean.InterfaceModel;
|
||||
import com.zhidao.support.adas.high.common.MessageType;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class InterfaceAdapter extends RecyclerView.Adapter<InterfaceAdapter.MyViewHolder> {
|
||||
|
||||
private List<InterfaceModel> mDatas;
|
||||
private boolean isEnabled = true;//是否可操作
|
||||
private boolean oldIsEnabled = isEnabled;
|
||||
private int isCheckAll = 2;//0:全选 1:全不选 2:任意选
|
||||
private int checkNum;
|
||||
private boolean oldIsCheckAll = false;
|
||||
|
||||
private OnInterfaceAdapterListener listener;
|
||||
|
||||
public void setListener(OnInterfaceAdapterListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public interface OnInterfaceAdapterListener {
|
||||
void onCheckAll(boolean isCheckAll);
|
||||
|
||||
void onCheckNum(int checkNum);
|
||||
}
|
||||
|
||||
public int getCheckNum() {
|
||||
return checkNum;
|
||||
}
|
||||
|
||||
//获取已选中的
|
||||
public Set<MessageType> getCheckedModel() {
|
||||
Set<MessageType> messageTypes = new HashSet<>();
|
||||
if (mDatas != null) {
|
||||
for (InterfaceModel model : mDatas) {
|
||||
if (model.isSelected()) {
|
||||
messageTypes.add(model.getMessageType());
|
||||
}
|
||||
}
|
||||
}
|
||||
return messageTypes;
|
||||
}
|
||||
|
||||
private void init() {
|
||||
isEnabled = true;
|
||||
oldIsEnabled = true;
|
||||
isCheckAll = 2;
|
||||
checkNum = 0;
|
||||
}
|
||||
|
||||
public void setData(List<InterfaceModel> mDatas, int checkNum) {
|
||||
init();
|
||||
this.mDatas = mDatas;
|
||||
if (mDatas != null && !mDatas.isEmpty()) {
|
||||
this.checkNum = checkNum;
|
||||
updateCheckAllStatus(true);
|
||||
}
|
||||
}
|
||||
|
||||
//全选 全不选
|
||||
public void setCheckAll(boolean checkAll) {
|
||||
isCheckAll = checkAll ? 0 : 1;
|
||||
checkNum = checkAll ? getItemCount() : 0;
|
||||
notifyDataSetChanged();
|
||||
updateCheckNumStatusCall();
|
||||
updateCheckAllStatus(false);
|
||||
}
|
||||
|
||||
public void setEnabled(boolean isEnabled) {
|
||||
if (oldIsEnabled != isEnabled) {
|
||||
oldIsEnabled = isEnabled;
|
||||
this.isEnabled = isEnabled;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//创建ViewHolder
|
||||
@NonNull
|
||||
@Override
|
||||
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
//实例化得到Item布局文件的View对象
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_interface, parent, false);
|
||||
//返回MyViewHolder的对象
|
||||
return new MyViewHolder(v);
|
||||
}
|
||||
|
||||
//绑定数据
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
|
||||
holder.index.setEnabled(isEnabled);
|
||||
holder.name.setEnabled(isEnabled);
|
||||
holder.itemView.setEnabled(isEnabled);
|
||||
holder.itemCheck.setEnabled(isEnabled);
|
||||
InterfaceModel model = mDatas.get(position);
|
||||
holder.name.setText(model.getMessageType().desc);
|
||||
holder.index.setText((position + 1) + ".");
|
||||
if (isCheckAll == 0) {
|
||||
model.setSelected(true);
|
||||
} else if (isCheckAll == 1) {
|
||||
model.setSelected(false);
|
||||
}
|
||||
holder.itemCheck.setChecked(model.isSelected());
|
||||
|
||||
}
|
||||
|
||||
//返回Item的数量
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mDatas == null ? 0 : mDatas.size();
|
||||
}
|
||||
|
||||
/***
|
||||
* 获取制定 位置的Data
|
||||
* @param position 下标
|
||||
* @return Data
|
||||
*/
|
||||
public InterfaceModel getItem(int position) {
|
||||
return mDatas == null ? null : mDatas.get(position);
|
||||
}
|
||||
|
||||
//继承RecyclerView.ViewHolder抽象类的自定义ViewHolder
|
||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView name;
|
||||
TextView index;
|
||||
CheckBox itemCheck;
|
||||
|
||||
MyViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
index = itemView.findViewById(R.id.index);
|
||||
name = itemView.findViewById(R.id.name);
|
||||
name.setSelected(true);
|
||||
itemCheck = itemView.findViewById(R.id.item_check);
|
||||
init();
|
||||
|
||||
}
|
||||
|
||||
private void init() {
|
||||
itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
InterfaceModel model = getItem(getBindingAdapterPosition());
|
||||
model.setSelected(!model.isSelected());
|
||||
updateCheckNum(model.isSelected());
|
||||
itemCheck.setChecked(model.isSelected());
|
||||
}
|
||||
});
|
||||
itemCheck.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (buttonView.isPressed()) {
|
||||
updateCheckNum(isChecked);
|
||||
InterfaceModel model = getItem(getBindingAdapterPosition());
|
||||
model.setSelected(isChecked);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//更新选中个数
|
||||
private void updateCheckNum(boolean isChecked) {
|
||||
if (isChecked) {
|
||||
checkNum++;
|
||||
} else {
|
||||
checkNum--;
|
||||
}
|
||||
updateCheckNumStatusCall();
|
||||
updateCheckAllStatus(true);
|
||||
}
|
||||
|
||||
private void updateCheckNumStatusCall() {
|
||||
if (listener != null)
|
||||
listener.onCheckNum(checkNum);
|
||||
}
|
||||
|
||||
//更新全选状态
|
||||
private void updateCheckAllStatus(boolean isNotice) {
|
||||
if (getItemCount() == checkNum) {
|
||||
isCheckAll = 0;
|
||||
updateCheckAllStatusCall(isNotice, true);
|
||||
} else if (0 == checkNum) {
|
||||
isCheckAll = 1;
|
||||
updateCheckAllStatusCall(isNotice, false);
|
||||
} else {
|
||||
isCheckAll = 2;
|
||||
updateCheckAllStatusCall(isNotice, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void updateCheckAllStatusCall(boolean isNotice, boolean isCheckAll) {
|
||||
if (isNotice)
|
||||
if (oldIsCheckAll != isCheckAll) {
|
||||
oldIsCheckAll = isCheckAll;
|
||||
if (listener != null)
|
||||
listener.onCheckAll(isCheckAll);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,7 @@ import perception.TrafficLightOuterClass;
|
||||
public abstract class BaseFragment extends Fragment {
|
||||
protected final String TAG = this.getClass().getSimpleName();
|
||||
private static final int WHAT_REFRESH = 0x01;
|
||||
private static final int WHAT_UPDATE_CONNECT_STATUS = 0x02;
|
||||
protected static final int WHAT_REFRESH_TRAFFIC_LIGHTS = 0x02;
|
||||
protected String title;
|
||||
|
||||
@@ -64,6 +65,18 @@ public abstract class BaseFragment extends Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
public void updateConnectStatus(int ipcConnectionStatus) {
|
||||
if (getHandler() != null) {
|
||||
Message msg = Message.obtain();
|
||||
msg.what = WHAT_UPDATE_CONNECT_STATUS;
|
||||
msg.arg1 = ipcConnectionStatus;
|
||||
getHandler().sendMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
protected void onConnectionIPCStatus(int ipcConnectionStatus) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
@@ -197,6 +210,11 @@ public abstract class BaseFragment extends Fragment {
|
||||
if (isVisible())
|
||||
onRefreshView();
|
||||
break;
|
||||
|
||||
case WHAT_UPDATE_CONNECT_STATUS:
|
||||
if (isVisible())
|
||||
onConnectionIPCStatus(msg.arg1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.zhidao.adas.client.bean;
|
||||
|
||||
import com.zhidao.support.adas.high.common.MessageType;
|
||||
|
||||
|
||||
public class InterfaceModel {
|
||||
private boolean isSelected = false;//是否选择
|
||||
private final MessageType messageType;
|
||||
|
||||
public InterfaceModel(MessageType messageType) {
|
||||
this.messageType = messageType;
|
||||
}
|
||||
|
||||
public boolean isSelected() {
|
||||
return isSelected;
|
||||
}
|
||||
|
||||
public void setSelected(boolean selected) {
|
||||
isSelected = selected;
|
||||
}
|
||||
|
||||
public MessageType getMessageType() {
|
||||
return messageType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
InterfaceModel that = (InterfaceModel) o;
|
||||
return messageType == that.messageType;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -129,8 +129,6 @@ public class InfoFragment extends BaseFragment {
|
||||
adapter.setData(DataDistribution.getInstance().listPerceptionTrafficLight);
|
||||
} else if (Constants.TITLE.RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listPredictionObstacleTrajectory);
|
||||
} else if (Constants.TITLE.RECEIVE_POINT_CLOUD.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listPointCloud);
|
||||
} else if (Constants.TITLE.RECEIVE_POINT_CLOUD_ORIGINAL.equals(title)) {
|
||||
adapter.setData(DataDistribution.getInstance().listOriginalPointCloud);
|
||||
} else if (Constants.TITLE.RECEIVE_PLANNING_OBJECTS.equals(title)) {
|
||||
|
||||
@@ -35,7 +35,6 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.AppCompatButton;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
@@ -54,6 +53,7 @@ import com.zhidao.adas.client.R;
|
||||
import com.zhidao.adas.client.adapter.InfoTitleAdapter;
|
||||
import com.zhidao.adas.client.base.BaseActivity;
|
||||
import com.zhidao.adas.client.base.BaseAdapter;
|
||||
import com.zhidao.adas.client.base.BaseFragment;
|
||||
import com.zhidao.adas.client.bean.ArrivalNotification;
|
||||
import com.zhidao.adas.client.bean.AutopilotState;
|
||||
import com.zhidao.adas.client.bean.BasicInfoReq;
|
||||
@@ -148,7 +148,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
private final List<String> titleBtnData = new ArrayList<>();
|
||||
private final List<IPCConnectState> connectStatusList = new ArrayList<>();
|
||||
private InfoTitleAdapter fragmentAdapter;
|
||||
private Fragment fromFragment;
|
||||
private BaseFragment fromFragment;
|
||||
private FragmentManager manager;
|
||||
private String ftpTime;
|
||||
private boolean isPad;
|
||||
@@ -613,7 +613,6 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_REPORT_MESSAGE);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_PERCEPTION_TRAFFIC_LIGHT);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_POINT_CLOUD);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_POINT_CLOUD_ORIGINAL);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_PLANNING_OBJECTS);
|
||||
titleFragmentData.add(Constants.TITLE.RECEIVE_CAR_CONFIG_RESP);
|
||||
@@ -882,7 +881,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
public void onBasicInfoReq(MessagePad.Header header, MessagePad.BasicInfoReq basicInfoReq) {
|
||||
BasicInfoReq info = new BasicInfoReq(header, basicInfoReq, sdf);
|
||||
DataDistribution.getInstance().addData(info);
|
||||
AdasManager.getInstance().sendBasicInfoResp("X202021111192N41VY", 0);
|
||||
AdasManager.getInstance().sendBasicInfoResp("", 0, com.zhidao.support.adas.high.common.Constants.TERMINAL_ROLE.DEBUG);
|
||||
showToastCenter("收到车机基础信息请求:" + info.toString());
|
||||
}
|
||||
|
||||
@@ -1024,6 +1023,9 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
|
||||
@Override
|
||||
public void onConnectionIPCStatus(int ipcConnectionStatus, String reason) {
|
||||
if (fromFragment != null) {
|
||||
fromFragment.updateConnectStatus(ipcConnectionStatus);
|
||||
}
|
||||
// Log.i(TAG, "连接状态=" + (reason == null ? "主动断开连接" : reason));
|
||||
String time = sdf.format(new Date());
|
||||
ConnectStatusSave.getInstance().saveLog(time + " ipcConnectionStatus=" + ipcConnectionStatus + " reason=" + reason);
|
||||
@@ -1089,7 +1091,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
}
|
||||
|
||||
private void showFragment(String title) {
|
||||
Fragment to = manager.findFragmentByTag(title);
|
||||
BaseFragment to = (BaseFragment) manager.findFragmentByTag(title);
|
||||
if (to == null) {
|
||||
if (Constants.TITLE.RECEIVE_CAR_CONFIG_RESP.equals(title)) {
|
||||
to = new VersionFragment(Constants.TITLE.TITLE_CAR_CONFIG_RESP);
|
||||
@@ -1227,30 +1229,31 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
break;
|
||||
case Constants.TITLE.SEND_SET_AUTOPILOT_SPEED_REQ:
|
||||
//速度设置
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle("自动驾驶限速");
|
||||
View view = getLayoutInflater().inflate(R.layout.dialog_speed, null);
|
||||
final EditText et = (EditText) view.findViewById(R.id.et);
|
||||
builder.setView(view);//
|
||||
builder.setCancelable(false);//
|
||||
builder.setPositiveButton("设置", new DialogInterface.OnClickListener() {
|
||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(this);
|
||||
builder1.setTitle("自动驾驶限速");
|
||||
View view1 = getLayoutInflater().inflate(R.layout.dialog_speed, null);
|
||||
final EditText et1 = (EditText) view1.findViewById(R.id.et);
|
||||
builder1.setView(view1);//
|
||||
builder1.setCancelable(false);//
|
||||
builder1.setPositiveButton("设置", null);
|
||||
//设置反面按钮,并做事件处理
|
||||
builder1.setNegativeButton("取消", null);
|
||||
AlertDialog alertDialog1 = builder1.show();//显示Dialog对话框
|
||||
alertDialog1.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
Editable editable = et.getText();
|
||||
public void onClick(View v) {
|
||||
Editable editable = et1.getText();
|
||||
if (TextUtils.isEmpty(editable)) {
|
||||
// 条件不成立不能关闭 AlertDialog 窗口
|
||||
Toast.makeText(MainActivity.this, "请输入速度", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
String temp = et.getText().toString().trim();
|
||||
String temp = et1.getText().toString().trim();
|
||||
double speed = Double.parseDouble(temp) / 3.6;
|
||||
AdasManager.getInstance().sendAutopilotSpeedReq(speed);
|
||||
alertDialog1.dismiss();
|
||||
}
|
||||
});
|
||||
//设置反面按钮,并做事件处理
|
||||
builder.setNegativeButton("取消", null);
|
||||
builder.show();//显示Dialog对话框
|
||||
|
||||
break;
|
||||
case Constants.TITLE.SEND_SYSTEM_CMD_REQ_REBOOT:
|
||||
//重启所有节点
|
||||
|
||||
@@ -7,8 +7,13 @@ import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -21,12 +26,15 @@ import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||
import com.zhidao.adas.client.BuildConfig;
|
||||
import com.zhidao.adas.client.R;
|
||||
import com.zhidao.adas.client.adapter.ConfigAdapter;
|
||||
import com.zhidao.adas.client.adapter.InterfaceAdapter;
|
||||
import com.zhidao.adas.client.base.BaseFragment;
|
||||
import com.zhidao.adas.client.bean.Config;
|
||||
import com.zhidao.adas.client.bean.InterfaceModel;
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.bean.VersionCompatibility;
|
||||
import com.zhidao.support.adas.high.common.Constants;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.common.MessageType;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -34,6 +42,7 @@ import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
@@ -42,11 +51,26 @@ import mogo.telematics.pad.MessagePad;
|
||||
*/
|
||||
public class VersionFragment extends BaseFragment {
|
||||
private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS ", Locale.getDefault());
|
||||
private TextView ipsView;
|
||||
private EditText ipView;
|
||||
private RecyclerView recyclerView;
|
||||
private RecyclerView rec_registered;
|
||||
private RecyclerView rec_unregistered;
|
||||
private CheckBox registered_check_all;
|
||||
private CheckBox unregistered_check_all;
|
||||
private TextView hint_registered;
|
||||
private TextView hint_unregistered;
|
||||
|
||||
private ConfigAdapter adapter;
|
||||
private InterfaceAdapter unregisteredAdapter;
|
||||
private InterfaceAdapter registeredAdapter;
|
||||
|
||||
|
||||
private int role = Constants.TERMINAL_ROLE.DEBUG;//角色 默认调试屏
|
||||
|
||||
public VersionFragment() {
|
||||
}
|
||||
|
||||
private ConfigAdapter adapter;
|
||||
|
||||
public VersionFragment(String title) {
|
||||
super(title);
|
||||
@@ -87,7 +111,7 @@ public class VersionFragment extends BaseFragment {
|
||||
for (String ip : ips) {
|
||||
i++;
|
||||
builder.append(ip);
|
||||
if (i % 2 == 0) {
|
||||
if (i % 4 == 0) {
|
||||
builder.append("\n");
|
||||
} else {
|
||||
builder.append("\t\t\t\t");
|
||||
@@ -98,9 +122,6 @@ public class VersionFragment extends BaseFragment {
|
||||
|
||||
}
|
||||
|
||||
private TextView ipsView;
|
||||
private EditText ipView;
|
||||
private RecyclerView recyclerView;
|
||||
|
||||
private void initView(View view) {
|
||||
TextView tvTitle = view.findViewById(R.id.tv_title);
|
||||
@@ -113,7 +134,7 @@ public class VersionFragment extends BaseFragment {
|
||||
CupidLogUtils.w("InfoFragment===>" + title);
|
||||
tvTitle.setText(title);
|
||||
tvTitle.setGravity(Gravity.CENTER);
|
||||
|
||||
initRegistrationView(view);
|
||||
btn1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -154,6 +175,18 @@ public class VersionFragment extends BaseFragment {
|
||||
|
||||
}
|
||||
|
||||
//根据连接状态更新数据
|
||||
@Override
|
||||
public void onConnectionIPCStatus(int ipcConnectionStatus) {
|
||||
super.onConnectionIPCStatus(ipcConnectionStatus);
|
||||
if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.DISCONNECTED || ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
showVersion();
|
||||
initRegistrationData();
|
||||
if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.DISCONNECTED) {
|
||||
clearRegistrationViewState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void showVersion() {
|
||||
List<Config> list = new ArrayList<>();
|
||||
@@ -204,4 +237,197 @@ public class VersionFragment extends BaseFragment {
|
||||
adapter = new ConfigAdapter();
|
||||
recyclerView.setAdapter(adapter);
|
||||
}
|
||||
|
||||
|
||||
private void initRegistrationView(View view) {
|
||||
recyclerView = view.findViewById(R.id.config_list);
|
||||
rec_registered = view.findViewById(R.id.rec_registered);
|
||||
rec_unregistered = view.findViewById(R.id.rec_unregistered);
|
||||
registered_check_all = view.findViewById(R.id.registered_check_all);
|
||||
unregistered_check_all = view.findViewById(R.id.unregistered_check_all);
|
||||
hint_unregistered = view.findViewById(R.id.hint_unregistered);
|
||||
hint_registered = view.findViewById(R.id.hint_registered);
|
||||
Button update = view.findViewById(R.id.update);
|
||||
initFragmentRecyclerView();
|
||||
initRegisteredRecyclerView();
|
||||
initUnregisteredRecyclerView();
|
||||
initSpinner(view);
|
||||
registered_check_all.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (buttonView.isPressed()) {
|
||||
registeredAdapter.setCheckAll(isChecked);
|
||||
unregisteredAdapter.setCheckAll(false);
|
||||
unregisteredAdapter.setEnabled(!isChecked);
|
||||
unregistered_check_all.setEnabled(!isChecked);
|
||||
}
|
||||
}
|
||||
});
|
||||
registeredAdapter.setListener(new InterfaceAdapter.OnInterfaceAdapterListener() {
|
||||
@Override
|
||||
public void onCheckAll(boolean isCheckAll) {
|
||||
registered_check_all.setChecked(isCheckAll);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckNum(int checkNum) {
|
||||
boolean isEnable = checkNum == 0;
|
||||
unregisteredAdapter.setEnabled(isEnable);
|
||||
unregistered_check_all.setEnabled(isEnable);
|
||||
}
|
||||
});
|
||||
unregistered_check_all.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (buttonView.isPressed()) {
|
||||
unregisteredAdapter.setCheckAll(isChecked);
|
||||
registeredAdapter.setCheckAll(false);
|
||||
registeredAdapter.setEnabled(!isChecked);
|
||||
registered_check_all.setEnabled(!isChecked);
|
||||
}
|
||||
}
|
||||
});
|
||||
unregisteredAdapter.setListener(new InterfaceAdapter.OnInterfaceAdapterListener() {
|
||||
@Override
|
||||
public void onCheckAll(boolean isCheckAll) {
|
||||
unregistered_check_all.setChecked(isCheckAll);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckNum(int checkNum) {
|
||||
boolean isEnable = checkNum == 0;
|
||||
registeredAdapter.setEnabled(isEnable);
|
||||
registered_check_all.setEnabled(isEnable);
|
||||
}
|
||||
});
|
||||
update.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
update();
|
||||
}
|
||||
});
|
||||
initRegistrationData();
|
||||
}
|
||||
|
||||
|
||||
private void update() {
|
||||
if (registeredAdapter.getCheckNum() == 0 && unregisteredAdapter.getCheckNum() == 0) {
|
||||
Toast.makeText(getContext(), "请选择后在更新", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
Set<MessageType> set;
|
||||
if (registeredAdapter.getCheckNum() == 0) {
|
||||
//注册
|
||||
set = unregisteredAdapter.getCheckedModel();
|
||||
if (set == null || set.isEmpty()) {
|
||||
Toast.makeText(getContext(), "请选择要注册的接口", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (set.size() == 1) {
|
||||
AdasManager.getInstance().subscribeInterface(role, Constants.SUBSCRIBE_TYPE.SUBSCRIBE, set.iterator().next());
|
||||
} else {
|
||||
AdasManager.getInstance().subscribeInterface(role, Constants.SUBSCRIBE_TYPE.SUBSCRIBE, set);
|
||||
}
|
||||
} else {
|
||||
//取消注册
|
||||
set = registeredAdapter.getCheckedModel();
|
||||
if (set == null || set.isEmpty()) {
|
||||
Toast.makeText(getContext(), "请选择要取消注册的接口", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (set.size() == 1) {
|
||||
AdasManager.getInstance().subscribeInterface(role, Constants.SUBSCRIBE_TYPE.UNSUBSCRIBE, set.iterator().next());
|
||||
} else {
|
||||
AdasManager.getInstance().subscribeInterface(role, Constants.SUBSCRIBE_TYPE.UNSUBSCRIBE, set);
|
||||
}
|
||||
}
|
||||
clearRegistrationViewState();
|
||||
initRegistrationData();
|
||||
|
||||
}
|
||||
|
||||
private void clearRegistrationViewState() {
|
||||
registered_check_all.setChecked(false);
|
||||
unregistered_check_all.setChecked(false);
|
||||
registered_check_all.setEnabled(true);
|
||||
unregistered_check_all.setEnabled(true);
|
||||
if (registeredAdapter != null)
|
||||
registeredAdapter.notifyDataSetChanged();
|
||||
if (unregisteredAdapter != null)
|
||||
unregisteredAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private void initRegistrationData() {
|
||||
//初始化数据
|
||||
Set<MessageType> set = AdasManager.getInstance().getSubscribedInterface();
|
||||
List<InterfaceModel> registeredList = new ArrayList<>();
|
||||
List<InterfaceModel> unregisteredList = new ArrayList<>();
|
||||
if (set != null && !set.isEmpty()) {
|
||||
registered_check_all.setVisibility(View.VISIBLE);
|
||||
for (MessageType messageType : set) {
|
||||
registeredList.add(new InterfaceModel(messageType));
|
||||
}
|
||||
} else {
|
||||
registered_check_all.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
set = AdasManager.getInstance().getUnsubscribedInterface();
|
||||
if (set != null && !set.isEmpty()) {
|
||||
unregistered_check_all.setVisibility(View.VISIBLE);
|
||||
for (MessageType messageType : set) {
|
||||
unregisteredList.add(new InterfaceModel(messageType));
|
||||
}
|
||||
} else {
|
||||
unregistered_check_all.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
registeredAdapter.setData(registeredList, 0);
|
||||
unregisteredAdapter.setData(unregisteredList, 0);
|
||||
hint_registered.setText("已注册接口(" + registeredAdapter.getItemCount() + ")");
|
||||
hint_unregistered.setText("未注册接口(" + unregisteredAdapter.getItemCount() + ")");
|
||||
}
|
||||
|
||||
|
||||
private void initRegisteredRecyclerView() {
|
||||
//创建默认的线性LayoutManager 横向的GridLayoutManager
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
||||
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
|
||||
rec_registered.setLayoutManager(linearLayoutManager);
|
||||
//如果可以确定每个item的高度是固定的,设置这个选项可以提高性能
|
||||
rec_registered.setHasFixedSize(false);
|
||||
rec_registered.setNestedScrollingEnabled(false);
|
||||
registeredAdapter = new InterfaceAdapter();
|
||||
rec_registered.setAdapter(registeredAdapter);
|
||||
}
|
||||
|
||||
private void initUnregisteredRecyclerView() {
|
||||
//创建默认的线性LayoutManager 横向的GridLayoutManager
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
||||
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
|
||||
rec_unregistered.setLayoutManager(linearLayoutManager);
|
||||
//如果可以确定每个item的高度是固定的,设置这个选项可以提高性能
|
||||
rec_unregistered.setHasFixedSize(false);
|
||||
rec_unregistered.setNestedScrollingEnabled(false);
|
||||
unregisteredAdapter = new InterfaceAdapter();
|
||||
rec_unregistered.setAdapter(unregisteredAdapter);
|
||||
}
|
||||
|
||||
|
||||
private void initSpinner(View view) {
|
||||
String[] s = {"司机", "乘客", "调试"};
|
||||
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(getContext(), android.R.layout.simple_spinner_item, s);
|
||||
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
Spinner sp = view.findViewById(R.id.spinner);
|
||||
sp.setAdapter(dataAdapter);
|
||||
sp.setSelection(2);
|
||||
sp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
role = position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,8 @@ import com.zhidao.support.adas.high.common.JsonUtil;
|
||||
import com.zhidao.support.adas.high.common.MessageType;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* @author song kenan
|
||||
@@ -157,12 +155,11 @@ public class Constants {
|
||||
String RECEIVE_REPORT_MESSAGE = MessageType.TYPE_RECEIVE_REPORT_MESSAGE.desc;
|
||||
String RECEIVE_PERCEPTION_TRAFFIC_LIGHT = MessageType.TYPE_RECEIVE_PERCEPTION_TRAFFIC_LIGHT.desc;
|
||||
String RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY = MessageType.TYPE_RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY.desc;
|
||||
String RECEIVE_POINT_CLOUD = MessageType.TYPE_RECEIVE_POINT_CLOUD.desc;
|
||||
String RECEIVE_POINT_CLOUD_ORIGINAL = "点云原始透传";
|
||||
String RECEIVE_POINT_CLOUD_ORIGINAL = MessageType.TYPE_RECEIVE_POINT_CLOUD.desc;
|
||||
String RECEIVE_PLANNING_OBJECTS = MessageType.TYPE_RECEIVE_PLANNING_OBJECTS.desc;
|
||||
|
||||
// String RECEIVE_BASIC_INFO_REQ = "自动驾驶设备基础信息请求";
|
||||
String TITLE_CAR_CONFIG_RESP = "工控机版本\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t固定IP配置";
|
||||
String TITLE_CAR_CONFIG_RESP = "工控机版本\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t配置";
|
||||
String RECEIVE_CAR_CONFIG_RESP = "信息与配置";
|
||||
String RECEIVE_RECORD_RESULT = MessageType.TYPE_RECEIVE_RECORD_RESULT.desc;
|
||||
String RECEIVE_RECORD_DATA_CONFIG_RESP = MessageType.TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP.desc;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="#7CFC00" android:state_pressed="true" />
|
||||
<item android:color="#7CFC00" android:state_checked="true" />
|
||||
<item android:color="#c9c9c9" android:state_enabled="false" />
|
||||
<item android:color="#000000" />
|
||||
|
||||
</selector>
|
||||
92
app_ipc_monitoring/src/main/res/layout/dialog_sn.xml
Normal file
92
app_ipc_monitoring/src/main/res/layout/dialog_sn.xml
Normal file
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.12"
|
||||
android:gravity="right"
|
||||
android:text="SN:"
|
||||
android:textColor="#000000" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:hint="输入SN"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:minWidth="100dp"
|
||||
android:textColor="#000"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.12"
|
||||
android:gravity="right"
|
||||
android:text="环境:"
|
||||
android:textColor="#000000" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ev"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:hint="(默认0)1:研发环境,2:测试环境,3:生产环境,4:演示环境"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:minWidth="100dp"
|
||||
android:textColor="#000"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.12"
|
||||
android:gravity="right"
|
||||
android:text="角色:"
|
||||
android:textColor="#000000" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/role"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:hint="(默认2)0:司机屏,1:乘客屏,2:调试屏"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:minWidth="100dp"
|
||||
android:textColor="#000"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@@ -52,7 +52,16 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
android:paddingStart="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ip_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="工控机固定IP配置"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ip"
|
||||
@@ -71,13 +80,13 @@
|
||||
android:textSize="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@id/ip_hint" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="36dp"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/btn_bg"
|
||||
android:text="添加"
|
||||
@@ -89,7 +98,7 @@
|
||||
<Button
|
||||
android:id="@+id/btn2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="36dp"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_toEndOf="@id/btn1"
|
||||
android:background="@drawable/btn_bg"
|
||||
@@ -106,10 +115,151 @@
|
||||
android:layout_marginTop="10dp"
|
||||
android:lineSpacingExtra="5dp"
|
||||
android:textIsSelectable="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btn1" />
|
||||
|
||||
<View
|
||||
android:id="@+id/line2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/colorAccent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ips_view" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/interface_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="接收接口订阅、取消订阅配置"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/update"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/update" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinner"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@id/update"
|
||||
app:layout_constraintStart_toEndOf="@id/interface_hint"
|
||||
app:layout_constraintTop_toTopOf="@id/update" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/update"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/btn_bg"
|
||||
android:text="更新"
|
||||
android:textColor="#ffffff"
|
||||
app:layout_constraintStart_toEndOf="@id/spinner"
|
||||
app:layout_constraintTop_toBottomOf="@id/line2" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="选中已注册接口点击更新取消注册\n选中未注册接口点击更新进行注册"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/update"
|
||||
app:layout_constraintStart_toEndOf="@id/update"
|
||||
app:layout_constraintTop_toTopOf="@id/update" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_list_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/update">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hint_registered"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="已注册接口" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/registered_check_all"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_gravity="end"
|
||||
android:text="全选" />
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/colorSlateGray" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hint_unregistered"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="未注册接口" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/unregistered_check_all"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="全选" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/layout_list_title">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rec_registered"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/colorSlateGray" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rec_unregistered"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@@ -15,7 +15,7 @@
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center"
|
||||
android:text="INFO"
|
||||
android:textColor="@drawable/item_text_color"
|
||||
android:textColor="@color/item_text_color"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -15,7 +15,7 @@
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="center"
|
||||
android:text="INFO"
|
||||
android:textColor="@drawable/item_text_color"
|
||||
android:textColor="@color/item_text_color"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
46
app_ipc_monitoring/src/main/res/layout/item_interface.xml
Normal file
46
app_ipc_monitoring/src/main/res/layout/item_interface.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:foreground="?android:attr/selectableItemBackground">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/index"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textColor="@color/item_text_color1"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/item_check"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="false"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:singleLine="true"
|
||||
android:text="sssds"
|
||||
android:textColor="@color/item_text_color1"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
Reference in New Issue
Block a user