[fix]修改工控机监控崩溃问题
This commit is contained in:
@@ -23,6 +23,8 @@ public abstract class BaseFragment extends Fragment {
|
||||
private static final int WHAT_REFRESH = 0x01;
|
||||
protected String title;
|
||||
|
||||
public BaseFragment() {
|
||||
}
|
||||
|
||||
public BaseFragment(String title) {
|
||||
this.title = title;
|
||||
|
||||
@@ -2,9 +2,7 @@ package com.zhidao.adas.client.log;
|
||||
|
||||
import android.os.Environment;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.zhidao.adas.client.bean.BaseInfo;
|
||||
import com.zhidao.support.adas.high.common.ThreadPoolManager;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
@@ -57,7 +55,7 @@ public class LogSave {
|
||||
return bl;
|
||||
}
|
||||
|
||||
private void getFile() throws IOException {
|
||||
private synchronized void getFile() throws IOException {
|
||||
if (isSdcardUse()) {
|
||||
String time = sdf.format(new Date());
|
||||
String childPath = time.split("_")[0] + File.separator;
|
||||
|
||||
@@ -31,6 +31,9 @@ public class InfoFragment extends BaseFragment {
|
||||
|
||||
private DataShowAdapter adapter;
|
||||
|
||||
public InfoFragment() {
|
||||
}
|
||||
|
||||
public InfoFragment(String title) {
|
||||
super(title);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import android.widget.ArrayAdapter;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListPopupWindow;
|
||||
import android.widget.PopupWindow;
|
||||
import android.widget.RadioButton;
|
||||
@@ -99,12 +100,13 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
private static final int WHAT_DRIVER_IP = 0x01;
|
||||
private static final int WHATIPC_CONNECT_STATE = 0x02;
|
||||
private EditText etIp;
|
||||
private TextView role;
|
||||
private TextView tvIp;
|
||||
private ImageView role;
|
||||
private ImageView tvIp;
|
||||
private TextView title;
|
||||
private TextView ipcIp;
|
||||
private TextView localIp;
|
||||
private View line;
|
||||
private View line1;
|
||||
private RadioGroup connectionType;
|
||||
private AppCompatButton connect;
|
||||
private AppCompatButton disconnect;
|
||||
@@ -207,6 +209,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
etIp = findViewById(R.id.et_ip);
|
||||
role = findViewById(R.id.role);
|
||||
line = findViewById(R.id.line);
|
||||
line1 = findViewById(R.id.line1);
|
||||
connectionType = findViewById(R.id.connection_type);
|
||||
tvIp = findViewById(R.id.tv_ip);
|
||||
connect = findViewById(R.id.connect);
|
||||
@@ -224,16 +227,25 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
localIp = findViewById(R.id.local_ip);
|
||||
|
||||
|
||||
role.setText(BuildConfig.IS_CLIENT ? "乘客端" : "司机端");
|
||||
role.setSelected(BuildConfig.IS_CLIENT);
|
||||
if (BuildConfig.IS_CLIENT) {
|
||||
line.setVisibility(View.GONE);
|
||||
line1.setVisibility(View.GONE);
|
||||
connectionType.setVisibility(View.GONE);
|
||||
etIp.setVisibility(View.GONE);
|
||||
tvIp.setVisibility(View.GONE);
|
||||
line.setVisibility(View.GONE);
|
||||
connect.setVisibility(View.GONE);
|
||||
disconnect.setVisibility(View.GONE);
|
||||
cb_timeout.setVisibility(View.GONE);
|
||||
ReceiveTimeoutManager.getInstance().setEnable(false, AdasManager.getInstance().getIpcConnectionStatus());
|
||||
}
|
||||
role.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
showToastCenter("我是" + (BuildConfig.IS_CLIENT ? "乘客端" : "司机端"));
|
||||
}
|
||||
});
|
||||
connect.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -353,12 +365,14 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
}
|
||||
});
|
||||
|
||||
findViewById(R.id.tv_ip).setOnClickListener(new View.OnClickListener() {
|
||||
tvIp.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (listPopupWindow == null)
|
||||
if (listPopupWindow == null) {
|
||||
tvIp.setSelected(true);
|
||||
showListPopupWindow();
|
||||
else {
|
||||
} else {
|
||||
tvIp.setSelected(false);
|
||||
listPopupWindow.dismiss();
|
||||
listPopupWindow = null;
|
||||
}
|
||||
@@ -377,6 +391,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
|
||||
@Override
|
||||
public void onDismiss() {
|
||||
listPopupWindow = null;
|
||||
tvIp.setSelected(false);
|
||||
}
|
||||
});
|
||||
listPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
||||
@@ -38,6 +38,8 @@ import mogo.telematics.pad.MessagePad;
|
||||
*/
|
||||
public class VersionFragment extends BaseFragment {
|
||||
|
||||
public VersionFragment() {
|
||||
}
|
||||
|
||||
private ConfigAdapter adapter;
|
||||
|
||||
|
||||
9
app_ipc_monitoring/src/main/res/drawable/ic_driver.xml
Normal file
9
app_ipc_monitoring/src/main/res/drawable/ic_driver.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="50dp"
|
||||
android:height="50dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M682.67,512c53.64,-48.76 87.77,-117.03 87.77,-190.17 0,-141.41 -117.03,-258.44 -258.44,-258.44S253.56,180.42 253.56,321.83c0,78.02 34.13,146.29 87.77,190.17 -180.42,68.27 -307.2,243.81 -307.2,448.61h97.52c0,-209.68 170.67,-380.34 380.34,-380.34 39.01,0 73.14,4.88 112.15,14.63L487.62,746.06c-107.28,9.75 -195.05,102.4 -195.05,214.55h97.52c0,-68.27 53.64,-121.9 121.9,-121.9s121.9,53.64 121.9,121.9h97.52c0,-87.77 -53.64,-165.79 -126.78,-199.92l112.15,-126.78c107.28,68.27 175.54,185.3 175.54,321.83h97.52c0,-199.92 -126.78,-375.47 -307.2,-443.73zM351.09,321.83c0,-87.77 73.14,-160.91 160.91,-160.91s160.91,73.14 160.91,160.91c0,87.77 -68.27,160.91 -156.04,160.91 -92.65,-4.88 -165.79,-73.14 -165.79,-160.91z"/>
|
||||
</vector>
|
||||
9
app_ipc_monitoring/src/main/res/drawable/ic_pack_up.xml
Normal file
9
app_ipc_monitoring/src/main/res/drawable/ic_pack_up.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="63.9375dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="2046"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M921.83,43.77C950.53,17.96 989.47,-6.02 1026.11,1.35c36.85,-5.52 71.62,20.29 100.28,42.42l886.1,802.25c45.01,40.56 45.01,106.96 0,147.55s-118.69,40.56 -163.7,0l-824.56,-763.52L197.46,993.55c-45.01,40.59 -118.69,40.59 -163.7,0s-45.01,-106.96 0,-147.53L921.83,43.77z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="50dp"
|
||||
android:height="50dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M682.67,512c53.64,-48.76 87.77,-117.03 87.77,-195.05 0,-146.29 -117.03,-263.31 -263.31,-263.31S248.69,170.67 248.69,316.95c0,78.02 34.13,146.29 87.77,195.05C151.16,580.27 19.5,760.69 19.5,970.36h97.52c0,-214.55 175.54,-390.1 390.1,-390.1s390.1,175.54 390.1,390.1h97.52c4.88,-209.68 -126.78,-390.1 -312.08,-458.36zM346.21,316.95c0,-92.65 73.14,-165.79 165.79,-165.79s165.79,73.14 165.79,165.79c0,87.77 -73.14,160.91 -160.91,165.79 -97.52,-4.88 -170.67,-78.02 -170.67,-165.79z" />
|
||||
</vector>
|
||||
9
app_ipc_monitoring/src/main/res/drawable/ic_pull.xml
Normal file
9
app_ipc_monitoring/src/main/res/drawable/ic_pull.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="63.9375dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="2046"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M1124.33,980.23c-28.65,25.81 -67.52,49.79 -104.37,42.42 -36.83,5.54 -71.59,-20.29 -100.24,-42.42L33.76,177.95C-11.25,137.42 -11.25,71 33.76,30.44s118.68,-40.58 163.68,0l824.49,763.46L1848.65,30.44c45,-40.58 118.66,-40.58 163.68,0s45,106.96 0,147.52L1124.33,980.23z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/ic_pack_up" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/ic_pull" />
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/ic_passenger" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/ic_driver" />
|
||||
</selector>
|
||||
@@ -17,17 +17,14 @@
|
||||
android:textSize="18dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
<ImageView
|
||||
android:id="@+id/role"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBaseline="@id/title"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_toEndOf="@id/title"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/colorWhile"
|
||||
android:textSize="14dp"
|
||||
android:textStyle="bold" />
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/selector_role" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/local_ip"
|
||||
@@ -100,7 +97,7 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/line2"
|
||||
android:layout_width="1dp"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="10dp"
|
||||
@@ -226,26 +223,26 @@
|
||||
android:layout_gravity="center_vertical"
|
||||
android:digits="0123456789.::"
|
||||
android:gravity="right|center_vertical"
|
||||
android:hint="IP地址"
|
||||
android:hint="输入指定IP:PORT"
|
||||
android:imeOptions="flagNoExtractUi"
|
||||
android:inputType="number"
|
||||
android:layoutDirection="ltr"
|
||||
android:maxLength="21"
|
||||
android:maxLines="1"
|
||||
android:minWidth="166dp"
|
||||
android:minWidth="206dp"
|
||||
android:paddingStart="40dp"
|
||||
android:textColor="@color/colorWhile"
|
||||
android:textColorHint="#DEDEDE"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
<ImageView
|
||||
android:id="@+id/tv_ip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="right|center_vertical"
|
||||
android:text="指定IP:"
|
||||
android:textColor="@color/colorWhile"
|
||||
android:textSize="16dp"
|
||||
android:textStyle="bold" />
|
||||
android:layout_marginStart="-42dp"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/selector_history_ip" />
|
||||
</LinearLayout>
|
||||
</HorizontalScrollView>
|
||||
</RelativeLayout>
|
||||
@@ -5,7 +5,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:minWidth="100dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:textAppearance="?android:attr/textAppearanceListItemSmall"
|
||||
|
||||
Reference in New Issue
Block a user