added activities(without fragment) and item for recyclerView

This commit is contained in:
Andrey 2025-02-19 15:33:27 +03:00
parent 2fdc2eac63
commit 1b33ecc800
10 changed files with 92 additions and 279 deletions

View File

@ -35,8 +35,11 @@ android {
} }
dependencies { dependencies {
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.activity:activity:1.10.0")
implementation("androidx.constraintlayout:constraintlayout:2.2.0")
defaultLibrary() defaultLibrary()
implementation(Dependencies.AndroidX.activity) implementation(Dependencies.AndroidX.activity)
implementation(Dependencies.AndroidX.fragment) implementation(Dependencies.AndroidX.fragment)
implementation(Dependencies.AndroidX.constraintLayout) implementation(Dependencies.AndroidX.constraintLayout)

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools" >
<uses-feature android:name="android.hardware.camera.any" /> <uses-feature android:name="android.hardware.camera.any" />
@ -18,10 +18,16 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.Default" android:theme="@style/Theme.Default"
tools:targetApi="31"> tools:targetApi="31" >
<activity <activity
android:name=".ui.RootActivity" android:name=".ui.main.MainActivity"
android:exported="true"> android:exported="false" />
<activity
android:name=".ui.login.LoginActivity"
android:exported="false" />
<activity
android:name=".ui.login.LoginActivity"
android:exported="true" >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true" />
</FrameLayout>

View File

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/login_activity"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/error"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:gravity="center"
android:text="@string/error_message_login_activity"
android:textAlignment="center"
android:textSize="18sp"
android:visibility="gone"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:padding="5dp" />
<EditText
android:id="@+id/username"
android:layout_width="0dp"
android:layout_height="48dp"
android:autofillHints="text"
android:hint="@string/prompt_username"
android:inputType="textEmailAddress"
android:selectAllOnFocus="true"
android:textColor="#000000"
android:textSize="20sp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="150dp" />
<Button
android:id="@+id/login"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:enabled="false"
android:text="@string/action_sign_in"
android:textSize="20sp"
android:layout_below="@+id/username"
android:layout_centerHorizontal="true"
android:layout_marginTop="80dp" />
</RelativeLayout>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true" />
</FrameLayout>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="-29dp"
android:layout_marginBottom="0dp"
android:fontFamily="monospace"
android:text="ccddddvvvve"
android:textColor="@color/black"
android:textSize="75dp" />
</RelativeLayout>

View File

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/login_activity"
android:screenOrientation="portrait"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/error"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:text="@string/error_message_login_activity"
android:gravity="center"
android:textAlignment="center"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:visibility="gone"
android:padding="5dp" />
<EditText
android:id="@+id/username"
android:layout_width="0dp"
android:layout_height="48dp"
android:hint="@string/prompt_username"
android:inputType="textEmailAddress"
android:autofillHints="text"
android:selectAllOnFocus="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="96dp" />
<Button
android:id="@+id/login"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:enabled="false"
android:text="@string/action_sign_in"
android:layout_below="@+id/username"
android:layout_marginTop="40dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>

View File

@ -1,115 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_fragment">
<ImageView
android:id="@+id/photo"
android:layout_width="160dp"
android:layout_height="160dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:contentDescription="@string/content_description" />
<TextView
android:id="@+id/fullname"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_marginStart="30dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_toEndOf="@+id/photo"
android:gravity="center" />
<TextView
android:id="@+id/position"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_below="@+id/fullname"
android:layout_alignParentEnd="true"
android:layout_marginStart="30dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:layout_toEndOf="@+id/photo"
android:gravity="center" />
<TextView
android:id="@+id/lastEntry"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_below="@+id/position"
android:layout_alignParentEnd="true"
android:layout_marginStart="30dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:layout_toEndOf="@+id/photo"
android:gravity="center" />
<Button
android:id="@+id/refresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/lastEntry"
android:layout_alignParentEnd="true"
android:layout_marginStart="30dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="16dp"
android:layout_toEndOf="@+id/photo"
android:text="@string/refresh" />
<Button
android:id="@+id/logout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/photo"
android:layout_alignEnd="@+id/photo"
android:layout_alignParentStart="true"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:text="@string/logout_text" />
<Button
android:id="@+id/scan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/logout"
android:layout_alignParentEnd="true"
android:layout_marginStart="30dp"
android:layout_marginTop="0dp"
android:layout_marginEnd="16dp"
android:layout_toEndOf="@+id/logout"
android:text="@string/scan_text" />
<TextView
android:id="@+id/error"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_centerInParent="true"
android:gravity="center"
android:text="@string/error_message_root_activity"
android:textAlignment="center"
android:visibility="gone"
android:padding="5dp" />
</RelativeLayout>

View File

@ -1,6 +1,80 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="120dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:cardCornerRadius="8dp"
app:cardElevation="4dp"
app:cardBackgroundColor="#B1B1CF"
>
</androidx.constraintlayout.widget.ConstraintLayout> <View
android:layout_width="10dp"
android:layout_height="120dp"
android:layout_marginLeft="273dp"
android:layout_marginRight="-5dp"
android:background="#B1CFBB"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:padding="16dp">
<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:id="@+id/profile_image"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:layout_marginStart="16dp"
android:orientation="vertical">
<TextView
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="30dp"
android:maxLines="1"
android:layout_marginTop="10dp"
android:textColor="@color/black"/>
<TextView
android:id="@+id/user_id"
android:layout_width="match_parent"
android:layout_height="25dp"
android:maxLines="1"
android:layout_marginTop="10dp"
android:textColor="#D9D9D9"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="16dp"
android:orientation="vertical"
android:layout_gravity="right">
<TextView
android:id="@+id/sessionText"
android:layout_width="match_parent"
android:layout_height="30dp"
android:maxLines="1"
android:layout_marginTop="10dp"
android:textColor="@color/black"
android:text="Текущая сессия"/>
<TextView
android:id="@+id/dateAndTimeSession"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginTop="10dp"
android:textColor="@color/black"/>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>

View File

@ -4,4 +4,5 @@ plugins {
kotlinJvm version Version.Kotlin.language apply false kotlinJvm version Version.Kotlin.language apply false
kotlinAnnotationProcessor version Version.Kotlin.language apply false kotlinAnnotationProcessor version Version.Kotlin.language apply false
id("com.google.dagger.hilt.android") version "2.51.1" apply false id("com.google.dagger.hilt.android") version "2.51.1" apply false
id("org.jetbrains.kotlin.android") version "1.9.24" apply false
} }