设备在线情况 进度页面完成
parent
be984e0d2f
commit
761ec4b0fd
@ -0,0 +1,56 @@
|
|||||||
|
package com.rehome.zhdcoa.bean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DeviceOnlineStatusBean extends DeviceAlarmBaseBean{
|
||||||
|
private DeviceOnlineStatusData data;
|
||||||
|
|
||||||
|
public DeviceOnlineStatusData getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(DeviceOnlineStatusData data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class DeviceOnlineStatusData {
|
||||||
|
// --- 在线
|
||||||
|
private Integer onlineCount;
|
||||||
|
// --- 离线
|
||||||
|
private Integer offlineCount;
|
||||||
|
private List<String> onlineDevices;
|
||||||
|
private List<String> offlineDevices;
|
||||||
|
|
||||||
|
public Integer getOnlineCount() {
|
||||||
|
return onlineCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnlineCount(Integer onlineCount) {
|
||||||
|
this.onlineCount = onlineCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getOfflineCount() {
|
||||||
|
return offlineCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOfflineCount(Integer offlineCount) {
|
||||||
|
this.offlineCount = offlineCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getOnlineDevices() {
|
||||||
|
return onlineDevices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnlineDevices(List<String> onlineDevices) {
|
||||||
|
this.onlineDevices = onlineDevices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getOfflineDevices() {
|
||||||
|
return offlineDevices;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOfflineDevices(List<String> offlineDevices) {
|
||||||
|
this.offlineDevices = offlineDevices;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,151 @@
|
|||||||
|
package com.rehome.zhdcoa.ui.activity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.GridView;
|
||||||
|
|
||||||
|
import androidx.activity.EdgeToEdge;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.graphics.Insets;
|
||||||
|
import androidx.core.view.ViewCompat;
|
||||||
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
|
import com.rehome.zhdcoa.App;
|
||||||
|
import com.rehome.zhdcoa.R;
|
||||||
|
import com.rehome.zhdcoa.adapter.GridViewYXAdapter;
|
||||||
|
import com.rehome.zhdcoa.base.BaseActivity2;
|
||||||
|
import com.rehome.zhdcoa.bean.GridViewBean;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class DeviceEntryActivity extends BaseActivity2 {
|
||||||
|
|
||||||
|
private GridView gv;
|
||||||
|
// private final String[] str = {"设备报表查询", "设备预警信息", "设备在线情况", "设备总览", "设备管理"};
|
||||||
|
// private final int[] imageId = {R.drawable.icon_baobiao, R.drawable.icon_yujing,
|
||||||
|
// R.drawable.icon_device_online_status, R.drawable.icon_device_all_show,
|
||||||
|
// R.drawable.icon_device_manager};
|
||||||
|
|
||||||
|
private final String[] str = {"设备报表查询", "设备预警信息", "设备在线情况"};
|
||||||
|
private final int[] imageId = {R.drawable.icon_baobiao, R.drawable.icon_yujing,
|
||||||
|
R.drawable.icon_device_online_status};
|
||||||
|
|
||||||
|
private boolean flag = true;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getContentViewID() {
|
||||||
|
return R.layout.activity_device_entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void initView() {
|
||||||
|
gv = findViewById(R.id.gv);
|
||||||
|
|
||||||
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||||
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initData() {
|
||||||
|
|
||||||
|
//yxToolbar.setBackgroundColor(Color.parseColor("#00000000"));
|
||||||
|
this.setStatusBar();
|
||||||
|
setTitle("设备在线情况");
|
||||||
|
setBack();
|
||||||
|
|
||||||
|
List<Integer> item = new ArrayList<>();
|
||||||
|
|
||||||
|
String name = App.getInstance().getUserInfo().getManid().toUpperCase();
|
||||||
|
|
||||||
|
if (name.contains("CKCX")) {
|
||||||
|
item.add(0);
|
||||||
|
item.add(8);
|
||||||
|
item.add(9);
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
gv.setSelector(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
gv.setAdapter(new GridViewYXAdapter(this, getGridViewData(), item, flag));
|
||||||
|
gv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
||||||
|
Intent intent;
|
||||||
|
switch (i) {
|
||||||
|
case 0:
|
||||||
|
intent = new Intent(DeviceEntryActivity.this, SbinfoActivity.class);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
intent = new Intent(DeviceEntryActivity.this, DeviceAlarmInfoActivity.class);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
intent = new Intent(DeviceEntryActivity.this, DeviceOnlineStatusActivity.class);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
// intent = new Intent(DeviceEntryActivity.this, MaterialIssue.class);
|
||||||
|
// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
// startActivity(intent);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
// intent = new Intent(DeviceEntryActivity.this, TlrkActivity.class);
|
||||||
|
// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
// startActivity(intent);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
intent = new Intent(DeviceEntryActivity.this, JstkActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
intent = new Intent(DeviceEntryActivity.this, ShelvesShift.class);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
intent = new Intent(DeviceEntryActivity.this, WztpScActivity.class);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
intent = new Intent(DeviceEntryActivity.this, TmdyActivity.class);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
intent = new Intent(DeviceEntryActivity.this, HjbqdyActivity.class);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
intent = new Intent(DeviceEntryActivity.this, WztpblScActivity.class);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<GridViewBean> getGridViewData() {
|
||||||
|
List<GridViewBean> datas = new ArrayList<>();
|
||||||
|
for (int i = 0; i < str.length; i++) {
|
||||||
|
GridViewBean bean = new GridViewBean();
|
||||||
|
bean.setTitle(str[i]);
|
||||||
|
bean.setImageid(imageId[i]);
|
||||||
|
bean.setShow(false);
|
||||||
|
datas.add(bean);
|
||||||
|
}
|
||||||
|
return datas;
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
@ -0,0 +1,20 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="30dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="30"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M0,0h30v24H0z"
|
||||||
|
android:strokeAlpha="0.2"
|
||||||
|
android:fillAlpha="0.2"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M29,1v22H1V1h28m1,-1H0v24h30V0z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M7.9,19.69a0.71,0.71 0,0 1,-0.51 -0.21,0.718 0.718,0 0,1 0,-1.03L13.82,12 7.38,5.56a0.718,0.718 0,0 1,0 -1.03c0.28,-0.29 0.75,-0.29 1.03,0l6.96,6.96c0.29,0.28 0.29,0.75 0,1.03l-6.96,6.96c-0.14,0.14 -0.33,0.21 -0.51,0.21z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M15.14,19.69a0.71,0.71 0,0 1,-0.51 -0.21,0.718 0.718,0 0,1 0,-1.03L21.07,12l-6.44,-6.44a0.718,0.718 0,0 1,0 -1.03c0.28,-0.29 0.75,-0.29 1.03,0l6.96,6.96c0.29,0.28 0.29,0.75 0,1.03l-6.96,6.96c-0.14,0.14 -0.33,0.21 -0.52,0.21z"/>
|
||||||
|
</vector>
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@mipmap/background"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".ui.activity.DeviceEntryActivity">
|
||||||
|
|
||||||
|
<include layout="@layout/toolbar_yx"/>
|
||||||
|
|
||||||
|
<GridView
|
||||||
|
android:id="@+id/gv"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="@dimen/gridview_interval"
|
||||||
|
android:horizontalSpacing="@dimen/gridview_interval"
|
||||||
|
android:listSelector="@null"
|
||||||
|
android:numColumns="2"
|
||||||
|
android:scrollbars="none"
|
||||||
|
android:stretchMode="columnWidth"
|
||||||
|
android:verticalSpacing="@dimen/gridview_interval" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@ -0,0 +1,184 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:background="@mipmap/background"
|
||||||
|
android:id="@+id/basd_ll"
|
||||||
|
tools:context=".ui.activity.DeviceOnlineStatusActivity">
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/toolbarView"
|
||||||
|
layout="@layout/layout_base" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="30dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<!-- android:background="#B2002D55"-->
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="250dp">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="250dp"
|
||||||
|
android:layout_height="250dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<!--圆环进度条-->
|
||||||
|
<com.rehome.zhdcoa.weiget.CircularProgressBar
|
||||||
|
android:id="@+id/circularProgressBar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:maxProgress="100"
|
||||||
|
app:progress="0"
|
||||||
|
app:progressbarBackgroundColor="@color/ring_bg"
|
||||||
|
app:progressbarColor="@color/green_dark"
|
||||||
|
app:radius="80dp"
|
||||||
|
app:strokeWidth="16dp"
|
||||||
|
app:text="0%"
|
||||||
|
app:textColor="@color/white"
|
||||||
|
app:textSize="40sp"
|
||||||
|
app:gradient="true"
|
||||||
|
app:customAngle="top"
|
||||||
|
app:counterClockwise="false"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="250dp"
|
||||||
|
android:layout_height="250dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<!--圆环进度条-->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_tip"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_marginTop="80dp"
|
||||||
|
android:textColor="#ffffff"
|
||||||
|
android:text="在线率"
|
||||||
|
android:textSize="20sp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</FrameLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_temperature"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="30sp"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:text="在线:"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_online"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="30sp"
|
||||||
|
android:textColor="#C0FF3E"
|
||||||
|
android:text="115"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="30sp"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:text="离线:"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_offline"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="30sp"
|
||||||
|
android:textColor="@color/red"
|
||||||
|
android:text="151"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="30sp"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:text="总数:"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_total"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="30sp"
|
||||||
|
android:textColor="#000000"
|
||||||
|
android:text="266"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_more"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_more"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:paddingEnd="10dp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:text="查看更多"
|
||||||
|
app:drawableRightCompat="@drawable/icon_more_vector_asset" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
<View
|
||||||
|
android:layout_width="5dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:background="#ffffff" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_audit_kq"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_audit_kq"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:text="审核"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
Loading…
Reference in New Issue