Commit b490d94c authored by chenyuling's avatar chenyuling

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

parent 8e25ba8f
Pipeline #1849 canceled with stages
......@@ -20,7 +20,7 @@ android {
minSdk 24
targetSdk 32
versionCode 1
versionName "1.0.2"
versionName "1.0.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
......
......@@ -16,13 +16,18 @@ import java.util.List;
public class DePortStatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private final Context context;
private final List<StatusInfoBean> statusInfoBeans;
private List<StatusInfoBean> statusInfoBeans;
private String deviceType;
public DePortStatusAdapter(Context context, List<StatusInfoBean> statusInfoBeans){
this.context = context;
this.statusInfoBeans = statusInfoBeans;
}
public void setDataList(List<StatusInfoBean> statusInfoBeans){
this.statusInfoBeans = statusInfoBeans;
notifyDataSetChanged();
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
......
......@@ -66,7 +66,7 @@ public class PersonMgr {
}*/
//根据名字进行分组
if (TextUtils.equals(query_name,newPersonName)){
query_name +=1;
equal_name +=1;
newPersonEntity.setGroup(queryPerson.getGroup());
isFound = true;
break;
......
......@@ -241,11 +241,13 @@ public class MainActivity extends BaseActivity implements NetworkIPMonitor.OnIPC
}
private void updatePassInfo(List<PersonEntity> passEntities, int type) {
Log.i(TAG, "updatePassInfo: 获取的总数="+passEntities.size());
Log.i(TAG, "updatePassInfo: 进还是出="+type);
for (PersonEntity passEntity : passEntities) {
Log.i(TAG, "updatePassInfo: 获取到的name="+passEntity.getPerson_name());
if (passEntities != null) {
Log.i(TAG, "updatePassInfo: 获取的总数="+passEntities.size());
}
//Log.i(TAG, "updatePassInfo: 进还是出="+type);
/*for (PersonEntity passEntity : passEntities) {
Log.i(TAG, "updatePassInfo: 获取到的name="+passEntity.getPerson_name());
}*/
if (type ==ENTER_TYPE){
if (passEntities != null) {
int size = passEntities.size();
......
......@@ -5,7 +5,6 @@ import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
......@@ -82,9 +81,6 @@ public class DePortStatusDlgFragment extends DialogFragment {
@Override
public void run() {
statusInfoBeans = SharedUtil.getInstance(context).readSharedList("statusInfoBeans", StatusInfoBean.class, null);
for (StatusInfoBean statusInfoBean : statusInfoBeans) {
Log.i(TAG, "run: statusInfoBean="+statusInfoBean.toString());
}
updateStatus();
deHandler.postDelayed(this,1000);
}
......@@ -92,8 +88,15 @@ public class DePortStatusDlgFragment extends DialogFragment {
private void updateStatus() {
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) {
adapter.notifyDataSetChanged();
adapter.setDataList(statusInfoBeans);
}
});
}
......
......@@ -94,9 +94,10 @@ public class SettingActivity extends BaseActivity implements ConfigCallback, Que
mBinding.ivBack.setOnClickListener(v->{
onBackPressed();
});
/* mBinding.tvDeviceConfig.setOnClickListener(v->{
mBinding.tvDeviceConfig.setOnLongClickListener(v->{
showPortDialog();
});*/
return true;
});
}
private void showConfigDialog(int type) {
......
......@@ -12,9 +12,17 @@
android:src="@mipmap/ic_close"
android:padding="10dp"
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
android:id="@+id/rv_port_status"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
android:layout_margin="10dp"/>
</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