Newer
Older
SmartTown / app / src / main / res / layout / fragment_statistics.xml
<?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="@color/white"
    android:orientation="vertical">

    <View
        android:id="@+id/statusBarView"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="@color/mainThemeColor" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="@dimen/titleViewHeight"
        android:background="@color/mainThemeColor">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:text="统计"
            android:textColor="@color/white"
            android:textSize="@dimen/sp_18" />

        <ImageView
            android:id="@+id/refreshImageView"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_alignParentEnd="true"
            android:paddingHorizontal="@dimen/dp_5"
            android:src="@drawable/ic_refresh" />
    </RelativeLayout>

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:id="@+id/coordinatorLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <!--内容区域,放统计图-->
        <androidx.core.widget.NestedScrollView
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:paddingHorizontal="@dimen/dp_10">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:paddingVertical="@dimen/dp_10">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="管网报警统计"
                        android:textColor="@color/mainTextColor"
                        android:textSize="@dimen/sp_16" />

                    <TextView
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="end"
                        android:text="总报警数:" />

                    <TextView
                        android:id="@+id/totalAlarmView"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:fontFamily="@font/agencyr"
                        android:text="9999"
                        android:textColor="@color/redTextColor"
                        android:textSize="@dimen/sp_20" />
                </LinearLayout>

                <androidx.cardview.widget.CardView style="@style/ChartWrapStyle">

                    <com.github.mikephil.charting.charts.BarChart
                        android:id="@+id/alarmBarChart"
                        android:layout_width="match_parent"
                        android:layout_height="@dimen/AndroidChartHeight" />
                </androidx.cardview.widget.CardView>

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingVertical="@dimen/dp_10"
                    android:text="管网健康状态"
                    android:textColor="@color/mainTextColor"
                    android:textSize="@dimen/sp_16" />

                <androidx.cardview.widget.CardView style="@style/ChartWrapStyle">

                    <com.github.mikephil.charting.charts.LineChart
                        android:id="@+id/healthStatusChart"
                        android:layout_width="match_parent"
                        android:layout_height="@dimen/AndroidChartHeight" />
                </androidx.cardview.widget.CardView>
            </LinearLayout>
        </androidx.core.widget.NestedScrollView>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/bg_solid_layout_white_radius_top_20"
            android:orientation="vertical"
            app:behavior_fitToContents="false"
            app:behavior_halfExpandedRatio="0.25"
            app:behavior_hideable="false"
            app:behavior_peekHeight="30dp"
            app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

            <!--顶部短横线-->
            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="@dimen/dp_30">

                <View
                    android:layout_width="@dimen/dp_30"
                    android:layout_height="@dimen/dp_3"
                    android:layout_centerInParent="true"
                    android:background="@drawable/bottom_short_line" />
            </RelativeLayout>

            <androidx.core.widget.NestedScrollView
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <LinearLayout
                    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_marginHorizontal="@dimen/dp_10"
                        android:background="@drawable/bg_solid_layout_white_radius_10"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:paddingVertical="@dimen/dp_5"
                            android:text="园区数据"
                            android:textColor="@color/mainTextColor"
                            android:textSize="@dimen/sp_18" />

                        <View style="@style/dividerViewStyle" />

                        <androidx.recyclerview.widget.RecyclerView
                            android:id="@+id/infrastructureRv"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
                            app:spanCount="3"
                            tools:itemCount="6" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="@dimen/dp_10"
                        android:background="@drawable/bg_solid_layout_white_radius_10"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:paddingVertical="@dimen/dp_5"
                            android:text="窨井统计"
                            android:textColor="@color/mainTextColor"
                            android:textSize="@dimen/sp_18" />

                        <View style="@style/dividerViewStyle" />

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:orientation="horizontal">

                            <LinearLayout style="@style/homeLayoutStyle">

                                <TextView
                                    android:id="@+id/cfWellView"
                                    style="@style/homeDataTextViewStyle"
                                    android:text="0"
                                    android:textColor="@color/redTextColor" />

                                <TextView
                                    style="@style/homeTextViewStyle"
                                    android:text="已撤防" />
                            </LinearLayout>

                            <LinearLayout style="@style/homeLayoutStyle">

                                <TextView
                                    android:id="@+id/bfWellView"
                                    style="@style/homeDataTextViewStyle"
                                    android:text="0"
                                    android:textColor="@color/yellowTextColor" />

                                <TextView
                                    style="@style/homeTextViewStyle"
                                    android:text="已布防" />
                            </LinearLayout>

                            <LinearLayout style="@style/homeLayoutStyle">

                                <TextView
                                    android:id="@+id/allWellDataView"
                                    style="@style/homeDataTextViewStyle"
                                    android:text="0"
                                    android:textColor="@color/greenTextColor" />

                                <TextView
                                    style="@style/homeTextViewStyle"
                                    android:text="全部" />
                            </LinearLayout>
                        </LinearLayout>
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginHorizontal="@dimen/dp_10"
                        android:background="@drawable/bg_solid_layout_white_radius_10"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:paddingVertical="@dimen/dp_5"
                            android:text="设备统计"
                            android:textColor="@color/mainTextColor"
                            android:textSize="@dimen/sp_18" />

                        <View style="@style/dividerViewStyle" />

                        <androidx.recyclerview.widget.RecyclerView
                            android:id="@+id/deviceRecyclerView"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
                    </LinearLayout>

                    <!--TODO 简单实现-->
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="@dimen/dp_10"
                        android:background="@drawable/bg_solid_layout_white_radius_10"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:paddingVertical="@dimen/dp_5"
                            android:text="企业总览"
                            android:textColor="@color/mainTextColor"
                            android:textSize="@dimen/sp_18" />

                        <View style="@style/dividerViewStyle" />

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:orientation="horizontal">

                            <LinearLayout style="@style/homeLayoutStyle">

                                <TextView
                                    style="@style/homeDataTextViewStyle"
                                    android:text="100"
                                    android:textColor="@color/mainThemeColor" />

                                <TextView
                                    style="@style/homeTextViewStyle"
                                    android:text="入驻企业" />
                            </LinearLayout>
                        </LinearLayout>
                    </LinearLayout>
                </LinearLayout>
            </androidx.core.widget.NestedScrollView>
        </LinearLayout>
    </androidx.coordinatorlayout.widget.CoordinatorLayout>
</LinearLayout>