fix: 调整首页布局,增加设备添加按钮

This commit is contained in:
niushuai233
2022-10-20 15:32:47 +08:00
parent 7d805defeb
commit 03feef076e
3 changed files with 41 additions and 12 deletions

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#FF000000"
android:pathData="M512,149.33c200.3,0 362.67,162.37 362.67,362.67s-162.37,362.67 -362.67,362.67S149.33,712.3 149.33,512 311.7,149.33 512,149.33zM512,213.33c-164.95,0 -298.67,133.72 -298.67,298.67s133.72,298.67 298.67,298.67 298.67,-133.72 298.67,-298.67 -133.72,-298.67 -298.67,-298.67zM544,320v160L704,480v64h-160L544,704h-64v-160.02L320,544v-64l160,-0.02L480,320h64z"/>
</vector>

View File

@@ -3,32 +3,51 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".ui.nav.device.NavDeviceFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.gridlayout.widget.GridLayout
android:id="@+id/device_gridLayout"
<LinearLayout
android:id="@+id/main_activity_layout_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:columnCount="2">
android:layout_height="50dp"
android:background="@color/main_bg_color"
android:gravity="center">
</androidx.gridlayout.widget.GridLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_weight="15"
android:gravity="center_vertical"
android:text="@string/app_name"
android:textSize="24dp" />
<!--标题栏 更多设置-->
<androidx.appcompat.widget.AppCompatImageButton
android:id="@id/activity_title_more_set"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:background="@color/empty"
android:scaleType="centerInside"
android:src="@drawable/ic_add_bg" />
</LinearLayout>
<GridView
android:id="@id/device_gv"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:numColumns="2"
android:verticalSpacing="12dp"
android:horizontalSpacing="12dp"
android:layout_below="@id/main_activity_layout_title"
android:background="@color/main_bg_color"
/>
android:horizontalSpacing="12dp"
android:numColumns="2"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:verticalSpacing="12dp" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>