code: Сделан главный экрна в XML

Сделан Recycler View XML
This commit is contained in:
veronicagtea 2025-02-19 11:30:17 +03:00
parent d27973528d
commit f69619beee
9 changed files with 290 additions and 108 deletions

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/grey" />
<stroke
android:width="2dp"
android:color="@color/grey" />
<corners android:radius="8dp"/>
</shape>

View File

@ -0,0 +1,41 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="256dp"
android:height="256dp"
android:viewportWidth="256"
android:viewportHeight="256">
<path
android:pathData="M176,40l40,0l0,40"
android:strokeLineJoin="round"
android:strokeWidth="8"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M80,216l-40,0l0,-40"
android:strokeLineJoin="round"
android:strokeWidth="8"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M216,176l0,40l-40,0"
android:strokeLineJoin="round"
android:strokeWidth="8"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M40,80l0,-40l40,0"
android:strokeLineJoin="round"
android:strokeWidth="8"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M88,80L168,80A8,8 0,0 1,176 88L176,168A8,8 0,0 1,168 176L88,176A8,8 0,0 1,80 168L80,88A8,8 0,0 1,88 80z"
android:strokeLineJoin="round"
android:strokeWidth="8"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="32"
android:viewportHeight="32">
<path
android:fillColor="#FF000000"
android:pathData="M27,3V29a1,1 0,0 1,-1 1H6a1,1 0,0 1,-1 -1V27H7v1H25V4H7V7H5V3A1,1 0,0 1,6 2H26A1,1 0,0 1,27 3ZM10.71,20.29 L7.41,17H18V15H7.41l3.3,-3.29L9.29,10.29l-5,5a1,1 0,0 0,0 1.42l5,5Z"/>
</vector>

View File

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:fillColor="#FF000000"
android:pathData="M8,7c1.38,0 2.5,-1.12 2.5,-2.5S9.38,2 8,2S5.5,3.12 5.5,4.5S6.62,7 8,7zM8,3c0.83,0 1.5,0.67 1.5,1.5S8.83,6 8,6S6.5,5.33 6.5,4.5S7.17,3 8,3z"/>
<path
android:fillColor="#FF000000"
android:pathData="M9.71,7.5H6.29C4.47,7.5 3,9.07 3,10.99v2.51C3,13.78 3.22,14 3.5,14h9c0.28,0 0.5,-0.22 0.5,-0.5v-2.51C13,9.07 11.53,7.5 9.71,7.5zM12,13H4v-2.01C4,9.62 5.03,8.5 6.29,8.5h3.43c1.26,0 2.29,1.12 2.29,2.49V13z"/>
</vector>

View File

@ -0,0 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="32dp" android:viewportHeight="128" android:viewportWidth="128" android:width="32dp">
<path android:fillColor="#FF000000" android:pathData="M96.1,103.6c-10.4,8.4 -23.5,12.4 -36.8,11.1c-10.5,-1 -20.3,-5.1 -28.2,-11.8H44v-8H18v26h8v-11.9c9.1,7.7 20.4,12.5 32.6,13.6c1.9,0.2 3.7,0.3 5.5,0.3c13.5,0 26.5,-4.6 37,-13.2c19.1,-15.4 26.6,-40.5 19.1,-63.9l-7.6,2.4C119,68.6 112.6,90.3 96.1,103.6z"/>
<path android:fillColor="#FF000000" android:pathData="M103,19.7c-21.2,-18.7 -53.5,-20 -76.1,-1.6C7.9,33.5 0.4,58.4 7.7,81.7l7.6,-2.4C9,59.2 15.5,37.6 31.9,24.4C51.6,8.4 79.7,9.6 98,26H85v8h26V8h-8V19.7z"/>
</vector>

View File

@ -0,0 +1,41 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="256dp"
android:height="256dp"
android:viewportWidth="256"
android:viewportHeight="256">
<path
android:pathData="M176,40l40,0l0,40"
android:strokeLineJoin="round"
android:strokeWidth="8"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M80,216l-40,0l0,-40"
android:strokeLineJoin="round"
android:strokeWidth="8"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M216,176l0,40l-40,0"
android:strokeLineJoin="round"
android:strokeWidth="8"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M40,80l0,-40l40,0"
android:strokeLineJoin="round"
android:strokeWidth="8"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
<path
android:pathData="M88,80L168,80A8,8 0,0 1,176 88L176,168A8,8 0,0 1,168 176L88,176A8,8 0,0 1,80 168L80,88A8,8 0,0 1,88 80z"
android:strokeLineJoin="round"
android:strokeWidth="8"
android:fillColor="#00000000"
android:strokeColor="#000"
android:strokeLineCap="round"/>
</vector>

View File

@ -1,123 +1,162 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/main_fragment">
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:id="@+id/topButtonLayout"
android:layout_width="match_parent"
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="16dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintGuide_percent="0.3" />
<View
android:id="@+id/logout"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:background="@drawable/icon_exit"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/logout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:contentDescription="@string/contentDescriptionLogout"
android:padding="8dp"
android:src="@drawable/ic_logout"
android:minHeight="64dp"
android:minWidth="64dp"/>
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageButton
android:id="@+id/refresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:contentDescription="@string/contentDescriptionRefresh"
android:padding="8dp"
android:src="@drawable/ic_refresh"
android:minHeight="64dp"
android:minWidth="64dp"/>
<ImageButton
android:id="@+id/scan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:contentDescription="@string/contentDescriptionScan"
android:padding="8dp"
android:src="@drawable/ic_qr_code"
android:minHeight="64dp"
android:minWidth="64dp"/>
</LinearLayout>
<LinearLayout
android:id="@+id/profileLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="16dp"
app:layout_constraintTop_toBottomOf="@id/topButtonLayout"
app:layout_constraintStart_toStartOf="parent"
<View
android:id="@+id/refresh"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
android:background="@drawable/icon_refresh"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent">
app:layout_constraintTop_toTopOf="parent" />
<!-- Существующие TextView и ImageView -->
<ImageView
android:id="@+id/photo"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/contentDescriptionPhoto"
android:src="@drawable/ic_no_img" />
<View
android:id="@+id/icon_profile"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/icon_profile"
app:layout_constraintBottom_toTopOf="@+id/guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:text="@string/fullNameText"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold" />
<View
android:id="@+id/username_field"
android:layout_width="320dp"
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:background="@drawable/button_grestroke_whiteback"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.494"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/guideline" />
<TextView
android:id="@+id/position"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:text="@string/jobText"
android:textColor="@color/black"
android:textSize="16sp" />
<TextView
android:id="@+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:layout_marginStart="10dp"
android:text="@string/fullNameText"
app:layout_constraintBottom_toBottomOf="@+id/username_field"
app:layout_constraintStart_toStartOf="@+id/username_field"
app:layout_constraintTop_toTopOf="@+id/username_field"
android:textColor="@color/black"/>
<TextView
android:id="@+id/lastEntry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
android:text="@string/lastLoginText"
android:textColor="@color/black"
android:textSize="14sp" />
<View
android:id="@+id/photo_field"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginTop="20dp"
android:background="@drawable/button_grestroke_whiteback"
app:layout_constraintStart_toStartOf="@+id/username_field"
app:layout_constraintTop_toBottomOf="@+id/username_field" />
<TextView
android:id="@+id/error"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:text="@string/errorText"
android:textColor="@color/black"
android:textSize="16sp"
android:visibility="gone" />
</LinearLayout>
<ImageView
android:id="@+id/photo"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center_horizontal"
android:contentDescription="@string/contentDescriptionPhoto"
android:src="@drawable/ic_no_img"
app:layout_constraintBottom_toBottomOf="@+id/photo_field"
app:layout_constraintEnd_toEndOf="@+id/photo_field"
app:layout_constraintStart_toStartOf="@+id/photo_field"
app:layout_constraintTop_toTopOf="@+id/photo_field" />
<View
android:id="@+id/position_field"
android:layout_width="220dp"
android:layout_height="40dp"
android:background="@drawable/button_grestroke_whiteback"
app:layout_constraintEnd_toEndOf="@+id/username_field"
app:layout_constraintTop_toTopOf="@+id/photo_field" />
<TextView
android:id="@+id/position"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/jobText"
android:textColor="@color/black"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="@+id/position_field"
app:layout_constraintStart_toStartOf="@+id/position_field"
app:layout_constraintTop_toTopOf="@+id/position_field" />
<View
android:id="@+id/scan"
android:layout_width="320dp"
android:layout_height="80dp"
android:layout_marginTop="40dp"
android:background="@drawable/button_grey"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/photo_field" />
<TextView
android:id="@+id/text_scan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="15dp"
android:text="@string/text_scan"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@+id/scan"
app:layout_constraintTop_toTopOf="@+id/scan" />
<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="@string/text_qr"
android:textColor="@color/black"
app:layout_constraintStart_toStartOf="@+id/text_scan"
app:layout_constraintTop_toBottomOf="@+id/text_scan" />
<View
android:id="@+id/scan_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginEnd="30dp"
android:background="@drawable/icon_scan"
app:layout_constraintBottom_toBottomOf="@+id/scan"
app:layout_constraintEnd_toEndOf="@+id/scan"
app:layout_constraintTop_toTopOf="@+id/scan" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/entrance_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/scan" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:layout_gravity="center">
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/text_scan_time"
android:textSize="16sp"
android:textColor="@color/grey"
android:gravity="center_horizontal"/>
</LinearLayout>

View File

@ -1,6 +1,6 @@
<resources>
<string name="app_name">NTO Pass</string>
<string name="loginText">Логин</string>
<string name="loginText">логин</string>
<string name="welcomeText">Добро пожаловать!</string>
<string name="inputLoginText">Введите свой логин</string>
<string name="welcomeDescriptionLoginText">для авторизации в приложении</string>
@ -9,7 +9,7 @@
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="errorText">Ошибка</string>
<string name="lastLoginText">Последний вход: 01.01.2023 12:00</string>
<string name="jobText">Должность: Менеджер</string>
<string name="jobText">Менеджер</string>
<string name="fullNameText">Андрей Андреевич Андреев</string>
<string name="contentDescriptionScan">scan</string>
<string name="contentDescriptionRefresh">refresh</string>
@ -17,10 +17,16 @@
<string name="contentDescriptionPhoto">photo</string>
<string name="resulText">Вход выполнен успешно</string>
<string name="closeText">Закрыть/Close</string>
<string name="errorGoText">Ошибка перехода</string>
<string name="errorLoginText">Ошибка входа</string>
<string name="text_last_enter">Последний вход 12.12.1212</string>
<string name="text_scan_time">Время сканирования 12:12</string>
<string name="text_identificator">Идентификатор</string>
<string name="text_type">Тип прохода</string>
<string name="passwordText">пароль</string>
<string name="text_scan">Сканировать</string>
<string name="text_qr">QR код</string>
<string name="errorGoText">Ошибка перехода</string>
<string name="errorGoText">Ошибка перехода</string>
<string name="serverError">Ошибка сервера</string>
<string name="userNotFing">Пользователь не найден</string>
<string name="passwordText">Пароль</string>
</resources>