Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StatInfo_1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenyuling
StatInfo_1
Commits
b490d94c
Commit
b490d94c
authored
Oct 31, 2023
by
chenyuling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"新增一个页面:查看接口连接失败情况"
parent
8e25ba8f
Pipeline
#1849
canceled with stages
Changes
7
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
14 deletions
+33
-14
build.gradle
app/build.gradle
+1
-1
DePortStatusAdapter.java
...a/com/srthinker/statinfo/adapter/DePortStatusAdapter.java
+6
-1
PersonMgr.java
.../main/java/com/srthinker/statinfo/database/PersonMgr.java
+1
-1
MainActivity.java
...rc/main/java/com/srthinker/statinfo/uis/MainActivity.java
+6
-4
DePortStatusDlgFragment.java
.../srthinker/statinfo/uis/news/DePortStatusDlgFragment.java
+8
-5
SettingActivity.java
...java/com/srthinker/statinfo/uis/news/SettingActivity.java
+3
-2
dialog_port_status.xml
app/src/main/res/layout/dialog_port_status.xml
+8
-0
No files found.
app/build.gradle
View file @
b490d94c
...
@@ -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"
}
}
...
...
app/src/main/java/com/srthinker/statinfo/adapter/DePortStatusAdapter.java
View file @
b490d94c
...
@@ -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
)
{
...
...
app/src/main/java/com/srthinker/statinfo/database/PersonMgr.java
View file @
b490d94c
...
@@ -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
;
...
...
app/src/main/java/com/srthinker/statinfo/uis/MainActivity.java
View file @
b490d94c
...
@@ -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
)
{
if
(
passEntities
!=
null
)
{
Log
.
i
(
TAG
,
"updatePassInfo: 获取的总数="
+
passEntities
.
size
());
Log
.
i
(
TAG
,
"updatePassInfo: 获取的总数="
+
passEntities
.
size
());
Log
.
i
(
TAG
,
"updatePassInfo: 进还是出="
+
type
);
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
();
...
...
app/src/main/java/com/srthinker/statinfo/uis/news/DePortStatusDlgFragment.java
View file @
b490d94c
...
@@ -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
);
}
}
});
});
}
}
...
...
app/src/main/java/com/srthinker/statinfo/uis/news/SettingActivity.java
View file @
b490d94c
...
@@ -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.setOn
ClickListener(v->{
mBinding
.
tvDeviceConfig
.
setOnLong
ClickListener
(
v
->{
showPortDialog
();
showPortDialog
();
});*/
return
true
;
});
}
}
private
void
showConfigDialog
(
int
type
)
{
private
void
showConfigDialog
(
int
type
)
{
...
...
app/src/main/res/layout/dialog_port_status.xml
View file @
b490d94c
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment