Commit b490d94c authored by chenyuling's avatar chenyuling

"新增一个页面:查看接口连接失败情况"

parent 8e25ba8f
Pipeline #1849 canceled with stages
...@@ -20,7 +20,7 @@ android { ...@@ -20,7 +20,7 @@ android {
minSdk 24 minSdk 24
targetSdk 32 targetSdk 32
versionCode 1 versionCode 1
versionName "1.0.2" versionName "1.0.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
......
...@@ -16,13 +16,18 @@ import java.util.List; ...@@ -16,13 +16,18 @@ import java.util.List;
public class DePortStatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { public class DePortStatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private final Context context; private final Context context;
private final List<StatusInfoBean> statusInfoBeans; private List<StatusInfoBean> statusInfoBeans;
private String deviceType; private String deviceType;
public DePortStatusAdapter(Context context, List<StatusInfoBean> statusInfoBeans){ public DePortStatusAdapter(Context context, List<StatusInfoBean> statusInfoBeans){
this.context = context; this.context = context;
this.statusInfoBeans = statusInfoBeans; this.statusInfoBeans = statusInfoBeans;
} }
public void setDataList(List<StatusInfoBean> statusInfoBeans){
this.statusInfoBeans = statusInfoBeans;
notifyDataSetChanged();
}
@NonNull @NonNull
@Override @Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
......
...@@ -66,7 +66,7 @@ public class PersonMgr { ...@@ -66,7 +66,7 @@ public class PersonMgr {
}*/ }*/
//根据名字进行分组 //根据名字进行分组
if (TextUtils.equals(query_name,newPersonName)){ if (TextUtils.equals(query_name,newPersonName)){
query_name +=1; equal_name +=1;
newPersonEntity.setGroup(queryPerson.getGroup()); newPersonEntity.setGroup(queryPerson.getGroup());
isFound = true; isFound = true;
break; break;
......
...@@ -241,11 +241,13 @@ public class MainActivity extends BaseActivity implements NetworkIPMonitor.OnIPC ...@@ -241,11 +241,13 @@ public class MainActivity extends BaseActivity implements NetworkIPMonitor.OnIPC
} }
private void updatePassInfo(List<PersonEntity> passEntities, int type) { private void updatePassInfo(List<PersonEntity> passEntities, int type) {
Log.i(TAG, "updatePassInfo: 获取的总数="+passEntities.size()); if (passEntities != null) {
Log.i(TAG, "updatePassInfo: 进还是出="+type); Log.i(TAG, "updatePassInfo: 获取的总数="+passEntities.size());
for (PersonEntity passEntity : passEntities) {
Log.i(TAG, "updatePassInfo: 获取到的name="+passEntity.getPerson_name());
} }
//Log.i(TAG, "updatePassInfo: 进还是出="+type);
/*for (PersonEntity passEntity : passEntities) {
Log.i(TAG, "updatePassInfo: 获取到的name="+passEntity.getPerson_name());
}*/
if (type ==ENTER_TYPE){ if (type ==ENTER_TYPE){
if (passEntities != null) { if (passEntities != null) {
int size = passEntities.size(); int size = passEntities.size();
......
...@@ -5,7 +5,6 @@ import android.graphics.Color; ...@@ -5,7 +5,6 @@ import android.graphics.Color;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.util.Log;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
...@@ -82,9 +81,6 @@ public class DePortStatusDlgFragment extends DialogFragment { ...@@ -82,9 +81,6 @@ public class DePortStatusDlgFragment extends DialogFragment {
@Override @Override
public void run() { public void run() {
statusInfoBeans = SharedUtil.getInstance(context).readSharedList("statusInfoBeans", StatusInfoBean.class, null); statusInfoBeans = SharedUtil.getInstance(context).readSharedList("statusInfoBeans", StatusInfoBean.class, null);
for (StatusInfoBean statusInfoBean : statusInfoBeans) {
Log.i(TAG, "run: statusInfoBean="+statusInfoBean.toString());
}
updateStatus(); updateStatus();
deHandler.postDelayed(this,1000); deHandler.postDelayed(this,1000);
} }
...@@ -92,8 +88,15 @@ public class DePortStatusDlgFragment extends DialogFragment { ...@@ -92,8 +88,15 @@ public class DePortStatusDlgFragment extends DialogFragment {
private void updateStatus() { private void updateStatus() {
activity.runOnUiThread(() -> { activity.runOnUiThread(() -> {
if (statusInfoBeans.size()>0) {
mBinding.tvDesc.setVisibility(View.GONE);
mBinding.rvPortStatus.setVisibility(View.VISIBLE);
}else{
mBinding.tvDesc.setVisibility(View.VISIBLE);
mBinding.rvPortStatus.setVisibility(View.GONE);
}
if (adapter != null) { if (adapter != null) {
adapter.notifyDataSetChanged(); adapter.setDataList(statusInfoBeans);
} }
}); });
} }
......
...@@ -94,9 +94,10 @@ public class SettingActivity extends BaseActivity implements ConfigCallback, Que ...@@ -94,9 +94,10 @@ public class SettingActivity extends BaseActivity implements ConfigCallback, Que
mBinding.ivBack.setOnClickListener(v->{ mBinding.ivBack.setOnClickListener(v->{
onBackPressed(); onBackPressed();
}); });
/* mBinding.tvDeviceConfig.setOnClickListener(v->{ mBinding.tvDeviceConfig.setOnLongClickListener(v->{
showPortDialog(); showPortDialog();
});*/ return true;
});
} }
private void showConfigDialog(int type) { private void showConfigDialog(int type) {
......
...@@ -12,9 +12,17 @@ ...@@ -12,9 +12,17 @@
android:src="@mipmap/ic_close" android:src="@mipmap/ic_close"
android:padding="10dp" android:padding="10dp"
android:layout_gravity="right"/> android:layout_gravity="right"/>
<TextView
android:id="@+id/tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30sp"
android:text="接口正常!"
android:textColor="@color/red"/>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_port_status" android:id="@+id/rv_port_status"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="gone"
android:layout_margin="10dp"/> android:layout_margin="10dp"/>
</LinearLayout> </LinearLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment