update profile layout

This commit is contained in:
varksyu 2025-02-19 12:57:59 +03:00
parent 5840424b91
commit 9ba4ba21db
5 changed files with 100 additions and 15 deletions

View File

@ -19,7 +19,7 @@ object AuthNetworkDataSource {
suspend fun isUserExist(login: String): Result<Boolean?> = withContext(Dispatchers.IO) {
runCatching {
val result = client.get("$SERVER_ADDRESS/api/user/login/$login") //10.0.2.2
val result = client.get("$SERVER_ADDRESS/api/login/$login") //10.0.2.2
when (result.status) {
HttpStatusCode.OK -> { return@runCatching true }
HttpStatusCode.NotFound -> { return@runCatching false }
@ -30,7 +30,7 @@ object AuthNetworkDataSource {
suspend fun login(token: String): Result<UserDto> = withContext(Dispatchers.IO) {
runCatching {
val result = client.get("$SERVER_ADDRESS/api/user/login") {
val result = client.get("$SERVER_ADDRESS/api/login") {
header(HttpHeaders.Authorization, token)
}
if (result.status == HttpStatusCode.Unauthorized) {

View File

@ -7,19 +7,18 @@
<ImageView
android:id="@+id/logout"
android:elevation="20dp"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="18dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:clickable="true"
android:elevation="20dp"
android:focusable="true"
android:src="@drawable/ic_logout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:clickable="true"
android:focusable="true">
</ImageView>
app:layout_constraintTop_toTopOf="parent" />
<ProgressBar
<ProgressBar
android:id="@+id/loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -67,13 +66,13 @@
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0">
app:layout_constraintVertical_bias="1.0">
<ImageView
android:id="@+id/imageView"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginTop="60dp"
android:layout_marginTop="48dp"
android:src="@drawable/ic_profile"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
@ -84,8 +83,8 @@
android:id="@+id/refresh_for_profile"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginTop="88dp"
android:layout_marginEnd="18dp"
android:layout_marginTop="68dp"
android:layout_marginEnd="16dp"
android:clickable="true"
android:elevation="20dp"
android:focusable="true"
@ -130,10 +129,12 @@
tools:text="Время последнего входа: 12:00 16.09" />
<com.google.android.material.button.MaterialButton
android:id="@+id/materialButton"
android:layout_width="80dp"
android:layout_height="90dp"
android:layout_marginTop="148dp"
android:backgroundTint="@color/orange"
app:cornerRadius="15dp"
app:icon="@drawable/ic_qr_code"
app:iconSize="50dp"
app:layout_constraintEnd_toEndOf="parent"
@ -141,6 +142,82 @@
app:layout_constraintTop_toBottomOf="@+id/imageView" />
<View
android:id="@+id/view2"
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_marginBottom="252dp"
android:background="@color/orange"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent" />
<View
android:id="@+id/view3"
android:layout_width="1dp"
android:layout_height="35dp"
android:layout_marginStart="131dp"
android:layout_marginTop="7dp"
android:background="@color/white"
app:layout_constraintBottom_toBottomOf="@+id/view2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/view2"
app:layout_constraintVertical_bias="1.0" />
<View
android:layout_width="1dp"
android:layout_height="35dp"
android:layout_marginTop="7dp"
android:layout_marginEnd="131dp"
android:background="@color/white"
app:layout_constraintBottom_toBottomOf="@+id/view2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/view2"
app:layout_constraintVertical_bias="1.0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_marginBottom="4dp"
android:text="@string/entry_history"
android:textColor="@color/black"
android:textSize="16sp"
app:layout_constraintBottom_toTopOf="@+id/view2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_marginTop="15dp"
android:gravity="center"
android:text="@string/entry_time"
android:textColor="@color/white"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="@+id/view2"
app:layout_constraintEnd_toStartOf="@+id/view3"
app:layout_constraintHorizontal_bias="0.51"
app:layout_constraintStart_toStartOf="@+id/view2"
app:layout_constraintTop_toTopOf="@+id/view2"
app:layout_constraintVertical_bias="0.0" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view2"
app:layout_constraintVertical_bias="0.0" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="60dp">
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -9,6 +9,6 @@
<color name="white">#FFFFFFFF</color>
<color name="grey">#A7A7A7</color>
<color name="grey_light">#EBEBEB</color>
<color name="orange">#FF6900</color>
<color name="orange">#FF8733</color> <!--FF6900-->
<color name="violet">#9F27FE</color>
</resources>

View File

@ -8,4 +8,6 @@
<string name="error_valid">Ошибка валидации\n</string>
<string name="error_invalid_credentials">Неверный логин или пароль</string>
<string name="error_unknown">Непредвиденная ошибка</string>
<string name="entry_history">История входов\n</string>
<string name="entry_time">Время входа\n</string>
</resources>