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" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".ui.nav.device.NavDeviceFragment"> tools:context=".ui.nav.device.NavDeviceFragment">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<androidx.gridlayout.widget.GridLayout <LinearLayout
android:id="@+id/device_gridLayout" android:id="@+id/main_activity_layout_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="50dp"
app:columnCount="2"> 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 <GridView
android:id="@id/device_gv" android:id="@id/device_gv"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:numColumns="2" android:layout_below="@id/main_activity_layout_title"
android:verticalSpacing="12dp"
android:horizontalSpacing="12dp"
android:background="@color/main_bg_color" android:background="@color/main_bg_color"
/> android:horizontalSpacing="12dp"
android:numColumns="2"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:verticalSpacing="12dp" />
</RelativeLayout> </RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

1
iconfront/add.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1666249178268" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2525" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 149.333333c200.298667 0 362.666667 162.368 362.666667 362.666667s-162.368 362.666667-362.666667 362.666667S149.333333 712.298667 149.333333 512 311.701333 149.333333 512 149.333333z m0 64c-164.949333 0-298.666667 133.717333-298.666667 298.666667s133.717333 298.666667 298.666667 298.666667 298.666667-133.717333 298.666667-298.666667-133.717333-298.666667-298.666667-298.666667z m32 106.666667v160H704v64h-160V704h-64v-160.021333L320 544v-64l160-0.021333V320h64z" p-id="2526"></path></svg>

After

Width:  |  Height:  |  Size: 825 B