From 7475bfeadee82878faf2188665ae5ae83875835c Mon Sep 17 00:00:00 2001 From: Administrator <123> Date: Mon, 25 Oct 2021 09:50:29 +0000 Subject: [PATCH] 大厅UI布局 我的UI布局 --- app/src/main/res/layout/fragment_home.xml | 83 +++++++++++++++++++++++++++++++++-------- 1 files changed, 66 insertions(+), 17 deletions(-) diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 7ecfe18..47973db 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -1,23 +1,72 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout +<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" + tools:ignore="MissingConstraints" + tools:context=".ui.home.HomeFragment" android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context=".ui.home.HomeFragment" > - - <TextView - android:id="@+id/text_home" + android:orientation="vertical" + android:layout_height="match_parent"> + <ImageView + android:id="@+id/img_search" + android:layout_width="39dp" + android:layout_height="35dp" + android:src="@android:drawable/ic_search_category_default"/> + <com.scwang.smart.refresh.layout.SmartRefreshLayout + android:id="@+id/smart_refresh" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginStart="8dp" - android:layout_marginTop="8dp" - android:layout_marginEnd="8dp" - android:textAlignment="center" - android:textSize="20sp" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent" /> -</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file + android:layout_height="match_parent" + > + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent" > + + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/recycler_top" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" + app:spanCount="3" + tools:itemCount="3" + tools:listitem="@layout/home_item_top" /> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/recycler_classify" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="10dp" + tools:listitem="@layout/home_item_classify" + app:layout_constraintTop_toBottomOf="@id/recycler_top" + app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" + app:spanCount="5" + tools:itemCount="3" + tools:layout_editor_absoluteX="1dp" + tools:layout_editor_absoluteY="247dp"/> + + <TextView + android:id="@+id/text_recommend" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:layout_constraintTop_toBottomOf="@id/recycler_classify" + app:layout_constraintLeft_toLeftOf="parent" + android:textSize="14dp" + android:text="任务推荐" + android:textColor="@color/black" + android:layout_margin="@dimen/frame_margin_lr" /> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/recycler_recommend" + android:layout_width="match_parent" + android:layout_height="wrap_content" + tools:listitem="@layout/homt_item_recommend" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toBottomOf="@id/text_recommend" + /> + + </androidx.constraintlayout.widget.ConstraintLayout> + </com.scwang.smart.refresh.layout.SmartRefreshLayout> + +</LinearLayout> \ No newline at end of file -- Gitblit v1.9.1