Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
e9d0beaa1e | |||
fc86c76656 | |||
6d75ee149c |
@ -1,6 +1,5 @@
|
|||||||
<?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">
|
|
||||||
|
|
||||||
<uses-feature android:name="android.hardware.camera.any" />
|
<uses-feature android:name="android.hardware.camera.any" />
|
||||||
|
|
||||||
@ -8,22 +7,24 @@
|
|||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="false"
|
||||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
android:fullBackupContent="@xml/backup_rules"
|
android:fullBackupContent="@xml/backup_rules"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@drawable/application_icon"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:networkSecurityConfig="@xml/network_security_config"
|
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.Default"
|
android:usesCleartextTraffic="true"
|
||||||
tools:targetApi="31">
|
android:theme="@style/splashScreenTheme">
|
||||||
|
|
||||||
|
<meta-data android:name="com.google.android.geo.API_KEY"
|
||||||
|
android:value="AIzaSyBtIU8oX16f9I0oLvoevw2T332vr10_Sw8"/>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.main.MainActivity"
|
android:name=".ui.screens.LoginActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.login.LoginActivity"
|
android:name=".ui.screens.MainActivity"
|
||||||
android:exported="true">
|
android:exported="true" >
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
@ -31,5 +32,4 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
</manifest>
|
||||||
</manifest>
|
|
||||||
|
@ -5,13 +5,11 @@ import androidx.annotation.NonNull;
|
|||||||
import ru.myitschool.work.api.data.dto.employee.EmployeeDTO;
|
import ru.myitschool.work.api.data.dto.employee.EmployeeDTO;
|
||||||
import ru.myitschool.work.api.data.network.RetrofitFactory;
|
import ru.myitschool.work.api.data.network.RetrofitFactory;
|
||||||
import ru.myitschool.work.api.data.source.EmployeeApi;
|
import ru.myitschool.work.api.data.source.EmployeeApi;
|
||||||
import ru.myitschool.work.api.data.utils.CallToConsumer;
|
|
||||||
import ru.myitschool.work.api.domain.EmployeeRepository;
|
import ru.myitschool.work.api.domain.EmployeeRepository;
|
||||||
import ru.myitschool.work.api.domain.entity.Status;
|
import ru.myitschool.work.api.domain.entity.Status;
|
||||||
import ru.myitschool.work.api.domain.entity.employee.EmpolyeeEntity;
|
import ru.myitschool.work.api.domain.entity.employee.EmployeeEntity;
|
||||||
import ru.myitschool.work.api.domain.entity.employee.ItemEmployeeEntity;
|
import ru.myitschool.work.api.domain.entity.employee.ItemEmployeeEntity;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
@ -85,22 +83,22 @@ public class EmployeeRepositoryImpl implements EmployeeRepository {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getAllEmployees(@NonNull Consumer<Status<List<EmpolyeeEntity>>> callback) {
|
public void getAllEmployees(@NonNull Consumer<Status<List<EmployeeEntity>>> callback) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemEmployeeEntity getEmployeeById(long id, @NonNull Consumer<Status<EmpolyeeEntity>> callback) {
|
public ItemEmployeeEntity getEmployeeById(long id, @NonNull Consumer<Status<EmployeeEntity>> callback) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getEmployeeByEmail(@NonNull String email, @NonNull Consumer<Status<EmpolyeeEntity>> callback) {
|
public void getEmployeeByEmail(@NonNull String email, @NonNull Consumer<Status<EmployeeEntity>> callback) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getEmployeeByTelephone(@NonNull String telephone, @NonNull Consumer<Status<EmpolyeeEntity>> callback) {
|
public void getEmployeeByTelephone(@NonNull String telephone, @NonNull Consumer<Status<EmployeeEntity>> callback) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +108,7 @@ public class EmployeeRepositoryImpl implements EmployeeRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteEmployee(long id, @NonNull Consumer<Status<EmpolyeeEntity>> callback) {
|
public void deleteEmployee(long id, @NonNull Consumer<Status<EmployeeEntity>> callback) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package ru.myitschool.work.api.data;
|
package ru.myitschool.work.api.data;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -11,7 +13,7 @@ import ru.myitschool.work.api.data.source.SignApi;
|
|||||||
import ru.myitschool.work.api.data.utils.CallToConsumer;
|
import ru.myitschool.work.api.data.utils.CallToConsumer;
|
||||||
import ru.myitschool.work.api.domain.SignRepository;
|
import ru.myitschool.work.api.domain.SignRepository;
|
||||||
import ru.myitschool.work.api.domain.entity.Status;
|
import ru.myitschool.work.api.domain.entity.Status;
|
||||||
import ru.myitschool.work.api.domain.entity.employee.EmpolyeeEntity;
|
import ru.myitschool.work.api.domain.entity.employee.EmployeeEntity;
|
||||||
|
|
||||||
public class SignRepositoryImpl implements SignRepository {
|
public class SignRepositoryImpl implements SignRepository {
|
||||||
private static SignRepositoryImpl INSTANCE;
|
private static SignRepositoryImpl INSTANCE;
|
||||||
@ -27,7 +29,7 @@ public class SignRepositoryImpl implements SignRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createEmployee(@NonNull EmployeeCreateDTO employeeCreateDTO, @NonNull Consumer<Status<EmpolyeeEntity>> callback) {
|
public void createEmployee(@NonNull EmployeeCreateDTO employeeCreateDTO, @NonNull Consumer<Status<EmployeeEntity>> callback) {
|
||||||
signApi.register(employeeCreateDTO).enqueue(new CallToConsumer<>(
|
signApi.register(employeeCreateDTO).enqueue(new CallToConsumer<>(
|
||||||
callback,
|
callback,
|
||||||
employeeDTO -> {
|
employeeDTO -> {
|
||||||
@ -42,32 +44,27 @@ public class SignRepositoryImpl implements SignRepository {
|
|||||||
final long officeId = employeeDTO.officeId;
|
final long officeId = employeeDTO.officeId;
|
||||||
final String officeName = employeeDTO.officeName;
|
final String officeName = employeeDTO.officeName;
|
||||||
final String officeUrl= employeeDTO.officeImageUrl;
|
final String officeUrl= employeeDTO.officeImageUrl;
|
||||||
final String possition = employeeDTO.position;
|
final String position = employeeDTO.position;
|
||||||
final String role = employeeDTO.role;
|
final String role = employeeDTO.role;
|
||||||
final String profileImageUrl= employeeDTO.profileImageUrl;
|
final String profileImageUrl= employeeDTO.profileImageUrl;
|
||||||
final boolean visitStatus= employeeDTO.visitStatus;
|
final boolean visitStatus= employeeDTO.visitStatus;
|
||||||
final String startVisit= employeeDTO.startVisitDateTime;
|
final String startVisit= employeeDTO.startVisitDateTime;
|
||||||
final List<Long> visitIdLast30Days = employeeDTO.visitsIdLast30Days;
|
final List<Long> visitIdLast30Days = employeeDTO.visitsIdLast30Days;
|
||||||
final long totalVisitTimeLast30Days = employeeDTO.totalTimeVisitsLast30Days;
|
final long totalVisitTimeLast30Days = employeeDTO.totalTimeVisitsLast30Days;
|
||||||
final String curentOfficeName = employeeDTO.currentOfficeName;
|
final String currentOfficeName = employeeDTO.currentOfficeName;
|
||||||
final String createdAt= employeeDTO.createAt;
|
final String createdAt= employeeDTO.createAt;
|
||||||
|
|
||||||
if (name != null && surname != null && telephone != null &&
|
if (name != null && surname != null && telephone != null && email_ != null && officeName != null && officeUrl != null && position != null &&
|
||||||
email_ != null && officeName != null && officeUrl != null &&
|
role != null && startVisit != null && profileImageUrl != null && visitIdLast30Days != null && currentOfficeName != null && createdAt != null) {
|
||||||
possition != null && role != null && startVisit != null &&
|
return new EmployeeEntity(id_, name, surname, patronymic, telephone, email_, officeId, officeName, officeUrl, position, role, profileImageUrl,
|
||||||
visitIdLast30Days != null && curentOfficeName != null &&
|
visitStatus, startVisit, visitIdLast30Days, totalVisitTimeLast30Days, currentOfficeName, createdAt);
|
||||||
createdAt != null) {
|
|
||||||
|
|
||||||
return new EmpolyeeEntity(id_, name, surname, patronymic,
|
|
||||||
telephone, email_, officeId, officeName, officeUrl, possition, role, profileImageUrl,
|
|
||||||
visitStatus, startVisit, visitIdLast30Days, totalVisitTimeLast30Days, curentOfficeName, createdAt);
|
|
||||||
} else return null;
|
} else return null;
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void login(@NonNull String email, @NonNull String password, @NonNull Consumer<Status<EmpolyeeEntity>> callback) {
|
public void login(@NonNull String email, @NonNull String password, @NonNull Consumer<Status<EmployeeEntity>> callback) {
|
||||||
credentialsDataSource.updateLogin(email, password);
|
credentialsDataSource.updateLogin(email, password);
|
||||||
signApi.login().enqueue(new CallToConsumer<>(callback, employeeDTO -> {
|
signApi.login().enqueue(new CallToConsumer<>(callback, employeeDTO -> {
|
||||||
if (employeeDTO == null) return null;
|
if (employeeDTO == null) return null;
|
||||||
@ -81,25 +78,22 @@ public class SignRepositoryImpl implements SignRepository {
|
|||||||
final long officeId = employeeDTO.officeId;
|
final long officeId = employeeDTO.officeId;
|
||||||
final String officeName = employeeDTO.officeName;
|
final String officeName = employeeDTO.officeName;
|
||||||
final String officeUrl= employeeDTO.officeImageUrl;
|
final String officeUrl= employeeDTO.officeImageUrl;
|
||||||
final String possition = employeeDTO.position;
|
final String position = employeeDTO.position;
|
||||||
final String role = employeeDTO.role;
|
final String role = employeeDTO.role;
|
||||||
final String profileImageUrl= employeeDTO.profileImageUrl;
|
final String profileImageUrl = employeeDTO.profileImageUrl;
|
||||||
final boolean visitStatus= employeeDTO.visitStatus;
|
final boolean visitStatus= employeeDTO.visitStatus;
|
||||||
final String startVisit= employeeDTO.startVisitDateTime;
|
final String startVisit = employeeDTO.startVisitDateTime;
|
||||||
final List<Long> visitIdLast30Days = employeeDTO.visitsIdLast30Days;
|
final List<Long> visitIdLast30Days = employeeDTO.visitsIdLast30Days;
|
||||||
final long totalVisitTimeLast30Days = employeeDTO.totalTimeVisitsLast30Days;
|
final long totalVisitTimeLast30Days = employeeDTO.totalTimeVisitsLast30Days;
|
||||||
final String curentOfficeName = employeeDTO.currentOfficeName;
|
final String currentOfficeName = employeeDTO.currentOfficeName;
|
||||||
final String createdAt= employeeDTO.createAt;
|
final String createdAt = employeeDTO.createAt;
|
||||||
|
|
||||||
if (name != null && surname != null && telephone != null &&
|
if (name != null && surname != null && telephone != null && email_ != null && officeName != null && officeUrl != null
|
||||||
email_ != null && officeName != null && officeUrl != null &&
|
&& position != null && role != null && profileImageUrl != null && startVisit != null && visitIdLast30Days != null
|
||||||
possition != null && role != null && startVisit != null &&
|
&& currentOfficeName != null && createdAt != null) {
|
||||||
visitIdLast30Days != null && curentOfficeName != null &&
|
|
||||||
createdAt != null) {
|
|
||||||
|
|
||||||
return new EmpolyeeEntity(id_, name, surname, patronymic,
|
return new EmployeeEntity(id_, name, surname, patronymic, telephone, email_, officeId, officeName, officeUrl, position, role, profileImageUrl,
|
||||||
telephone, email_, officeId, officeName, officeUrl, possition, role, profileImageUrl,
|
visitStatus, startVisit, visitIdLast30Days, totalVisitTimeLast30Days, currentOfficeName, createdAt);
|
||||||
visitStatus, startVisit, visitIdLast30Days, totalVisitTimeLast30Days, curentOfficeName, createdAt);
|
|
||||||
} else return null;
|
} else return null;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ public class EmployeeDTO {
|
|||||||
@SerializedName("officeImageUrl")
|
@SerializedName("officeImageUrl")
|
||||||
public String officeImageUrl;
|
public String officeImageUrl;
|
||||||
@Nullable
|
@Nullable
|
||||||
@SerializedName("position")
|
@SerializedName("positionName")
|
||||||
public String position; // Название должности
|
public String position; // Название должности
|
||||||
@Nullable
|
@Nullable
|
||||||
@SerializedName("role")
|
@SerializedName("role")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package ru.myitschool.work.api.data.network;
|
package ru.myitschool.work.api.data.network;
|
||||||
|
|
||||||
import com.example.myapplication.core.UrlConstants;
|
import ru.myitschool.work.core.UrlConstants;
|
||||||
|
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
|
@ -9,10 +9,9 @@ import ru.myitschool.work.api.data.dto.employee.EmployeeCreateDTO;
|
|||||||
import ru.myitschool.work.api.data.dto.employee.EmployeeDTO;
|
import ru.myitschool.work.api.data.dto.employee.EmployeeDTO;
|
||||||
|
|
||||||
public interface SignApi {
|
public interface SignApi {
|
||||||
@POST("api/v1/employees/authorization/register")
|
@POST("api/v1/authorization/register")
|
||||||
Call<EmployeeDTO> register(@Body EmployeeCreateDTO employeeCreateDTO);
|
Call<EmployeeDTO> register(@Body EmployeeCreateDTO employeeCreateDTO);
|
||||||
|
|
||||||
@GET("api/v1/employees/authorization//login")
|
@GET("api/v1/authorization/login")
|
||||||
Call<EmployeeDTO> login();
|
Call<EmployeeDTO> login();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,15 +7,15 @@ import java.util.function.Consumer;
|
|||||||
|
|
||||||
import ru.myitschool.work.api.data.dto.employee.EmployeeDTO;
|
import ru.myitschool.work.api.data.dto.employee.EmployeeDTO;
|
||||||
import ru.myitschool.work.api.domain.entity.Status;
|
import ru.myitschool.work.api.domain.entity.Status;
|
||||||
import ru.myitschool.work.api.domain.entity.employee.EmpolyeeEntity;
|
import ru.myitschool.work.api.domain.entity.employee.EmployeeEntity;
|
||||||
import ru.myitschool.work.api.domain.entity.employee.ItemEmployeeEntity;
|
import ru.myitschool.work.api.domain.entity.employee.ItemEmployeeEntity;
|
||||||
|
|
||||||
public interface EmployeeRepository {
|
public interface EmployeeRepository {
|
||||||
void getAllEmployees(@NonNull Consumer<Status<List<EmpolyeeEntity>>> callback);
|
void getAllEmployees(@NonNull Consumer<Status<List<EmployeeEntity>>> callback);
|
||||||
ItemEmployeeEntity getEmployeeById(long id, @NonNull Consumer<Status<EmpolyeeEntity>> callback);
|
ItemEmployeeEntity getEmployeeById(long id, @NonNull Consumer<Status<EmployeeEntity>> callback);
|
||||||
void getEmployeeByEmail(@NonNull String email, @NonNull Consumer<Status<EmpolyeeEntity>> callback);
|
void getEmployeeByEmail(@NonNull String email, @NonNull Consumer<Status<EmployeeEntity>> callback);
|
||||||
void getEmployeeByTelephone(@NonNull String telephone, @NonNull Consumer<Status<EmpolyeeEntity>> callback);
|
void getEmployeeByTelephone(@NonNull String telephone, @NonNull Consumer<Status<EmployeeEntity>> callback);
|
||||||
void updateEmployee(long id, @NonNull EmployeeDTO employeeDTO, @NonNull Consumer<Status<Void>> callback);//переделай после dto
|
void updateEmployee(long id, @NonNull EmployeeDTO employeeDTO, @NonNull Consumer<Status<Void>> callback);//переделай после dto
|
||||||
void deleteEmployee(long id, @NonNull Consumer<Status<EmpolyeeEntity>> callback);
|
void deleteEmployee(long id, @NonNull Consumer<Status<EmployeeEntity>> callback);
|
||||||
void patchEmployeerOfficeId(long id, long officeId, @NonNull Consumer<Status<Void>> callback);
|
void patchEmployeerOfficeId(long id, long officeId, @NonNull Consumer<Status<Void>> callback);
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,10 @@ import java.util.function.Consumer;
|
|||||||
|
|
||||||
import ru.myitschool.work.api.data.dto.employee.EmployeeCreateDTO;
|
import ru.myitschool.work.api.data.dto.employee.EmployeeCreateDTO;
|
||||||
import ru.myitschool.work.api.domain.entity.Status;
|
import ru.myitschool.work.api.domain.entity.Status;
|
||||||
import ru.myitschool.work.api.domain.entity.employee.EmpolyeeEntity;
|
import ru.myitschool.work.api.domain.entity.employee.EmployeeEntity;
|
||||||
|
|
||||||
public interface SignRepository {
|
public interface SignRepository {
|
||||||
void createEmployee(@NonNull EmployeeCreateDTO employeeRegisterDTO, @NonNull Consumer<Status<EmpolyeeEntity>> callback);
|
void createEmployee(@NonNull EmployeeCreateDTO employeeRegisterDTO, @NonNull Consumer<Status<EmployeeEntity>> callback);
|
||||||
void login(@NonNull String email, @NonNull String password, @NonNull Consumer<Status<EmpolyeeEntity>> callback);
|
void login(@NonNull String email, @NonNull String password, @NonNull Consumer<Status<EmployeeEntity>> callback);
|
||||||
void logout();
|
void logout();
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
package ru.myitschool.work.api.domain.entity;
|
package ru.myitschool.work.api.domain.entity;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
public class Status<T> {
|
public class Status<T> {
|
||||||
final int statusCod;
|
final int statusCode;
|
||||||
@Nullable private final T value;
|
@Nullable private final T value;
|
||||||
@Nullable private final Throwable errors;
|
@Nullable private final Throwable errors;
|
||||||
|
|
||||||
public Status(int statusCod, @Nullable T value, @Nullable Throwable errors) {
|
public Status(int statusCode, @Nullable T value, @Nullable Throwable errors) {
|
||||||
this.statusCod = statusCod;
|
this.statusCode = statusCode;
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.errors = errors;
|
this.errors = errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getStatusCod() {
|
public int getStatusCode() {
|
||||||
return statusCod;
|
return statusCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
@ -3,18 +3,17 @@ package ru.myitschool.work.api.domain.entity.employee;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class EmpolyeeEntity {
|
public class EmployeeEntity {
|
||||||
@NonNull private final long id;
|
private final long id;
|
||||||
@NonNull private final String name;
|
@NonNull private final String name;
|
||||||
@NonNull private final String surname;
|
@NonNull private final String surname;
|
||||||
@NonNull private final String patronymic;
|
@Nullable private final String patronymic;
|
||||||
@NonNull private final String telephone;
|
@NonNull private final String telephone;
|
||||||
@NonNull private final String email;
|
@NonNull private final String email;
|
||||||
|
|
||||||
@NonNull private final long officeId;
|
private final long officeId;
|
||||||
@NonNull private final String officeName;
|
@NonNull private final String officeName;
|
||||||
@NonNull private final String officeImageUrl;
|
@NonNull private final String officeImageUrl;
|
||||||
|
|
||||||
@ -24,7 +23,7 @@ public class EmpolyeeEntity {
|
|||||||
@NonNull private final String profileImageUrl;
|
@NonNull private final String profileImageUrl;
|
||||||
|
|
||||||
// Текущее состояние входа: false - visit (посещение) ещё не началось, true - visit идёт
|
// Текущее состояние входа: false - visit (посещение) ещё не началось, true - visit идёт
|
||||||
@NonNull private final boolean visitStatus;
|
private final boolean visitStatus;
|
||||||
|
|
||||||
// Если visitStatus true, то возвращает дату и время начала посещения в формате LocalDateTime.toString(),
|
// Если visitStatus true, то возвращает дату и время начала посещения в формате LocalDateTime.toString(),
|
||||||
// превратить обратно можно с помощью LocalDateTime.parse().
|
// превратить обратно можно с помощью LocalDateTime.parse().
|
||||||
@ -33,7 +32,7 @@ public class EmpolyeeEntity {
|
|||||||
@NonNull private final List<Long> visitsIdLast30Days; // Список Id посещений за последние 30 дней.
|
@NonNull private final List<Long> visitsIdLast30Days; // Список Id посещений за последние 30 дней.
|
||||||
|
|
||||||
// Возвращает количество отработанных часов за последний месяц.
|
// Возвращает количество отработанных часов за последний месяц.
|
||||||
@NonNull private final long totalTimeVisitsLast30Days;
|
private final long totalTimeVisitsLast30Days;
|
||||||
|
|
||||||
// (Возможно это стоит убрать) Название офиса, в котором сейчас находится работник.
|
// (Возможно это стоит убрать) Название офиса, в котором сейчас находится работник.
|
||||||
// Если visitStatus false, возвращает null.
|
// Если visitStatus false, возвращает null.
|
||||||
@ -43,7 +42,7 @@ public class EmpolyeeEntity {
|
|||||||
// превратить обратно можно с помощью LocalDateTime.parse().
|
// превратить обратно можно с помощью LocalDateTime.parse().
|
||||||
@NonNull private final String createAt;
|
@NonNull private final String createAt;
|
||||||
|
|
||||||
public EmpolyeeEntity(long id, @NonNull String name, @NonNull String surname, @NonNull String patronymic, @NonNull String telephone, @NonNull String email, long officeId, @NonNull String officeName, @NonNull String officeImageUrl, @NonNull String position, @NonNull String role, @NonNull String profileImageUrl, boolean visitStatus, @NonNull String startVisitDateTime, @NonNull List<Long> visitsIdLast30Days, long totalTimeVisitsLast30Days, @NonNull String currentOfficeName, @NonNull String createAt) {
|
public EmployeeEntity(long id, @NonNull String name, @NonNull String surname, @Nullable String patronymic, @NonNull String telephone, @NonNull String email, long officeId, @NonNull String officeName, @NonNull String officeImageUrl, @NonNull String position, @NonNull String role, @NonNull String profileImageUrl, boolean visitStatus, @NonNull String startVisitDateTime, @NonNull List<Long> visitsIdLast30Days, long totalTimeVisitsLast30Days, @NonNull String currentOfficeName, @NonNull String createAt) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.surname = surname;
|
this.surname = surname;
|
||||||
@ -64,52 +63,37 @@ public class EmpolyeeEntity {
|
|||||||
this.createAt = createAt;
|
this.createAt = createAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getId() {
|
@NonNull
|
||||||
return id;
|
public String getCreateAt() {
|
||||||
|
return createAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public String getName() {
|
public String getCurrentOfficeName() {
|
||||||
return name;
|
return currentOfficeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getTotalTimeVisitsLast30Days() {
|
||||||
|
return totalTimeVisitsLast30Days;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public String getSurname() {
|
public List<Long> getVisitsIdLast30Days() {
|
||||||
return surname;
|
return visitsIdLast30Days;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public String getPatronymic() {
|
public String getStartVisitDateTime() {
|
||||||
return patronymic;
|
return startVisitDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isVisitStatus() {
|
||||||
|
return visitStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public String getTelephone() {
|
public String getProfileImageUrl() {
|
||||||
return telephone;
|
return profileImageUrl;
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
public String getEmail() {
|
|
||||||
return email;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getOfficeId() {
|
|
||||||
return officeId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
public String getOfficeName() {
|
|
||||||
return officeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
public String getOfficeImageUrl() {
|
|
||||||
return officeImageUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
public String getPosition() {
|
|
||||||
return position;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@ -118,35 +102,50 @@ public class EmpolyeeEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public String getProfileImageUrl() {
|
public String getPosition() {
|
||||||
return profileImageUrl;
|
return position;
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isVisitStatus() {
|
|
||||||
return visitStatus;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public String getStartVisitDateTime() {
|
public String getOfficeImageUrl() {
|
||||||
return startVisitDateTime;
|
return officeImageUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public List<Long> getVisitsIdLast30Days() {
|
public String getOfficeName() {
|
||||||
return visitsIdLast30Days;
|
return officeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTotalTimeVisitsLast30Days() {
|
public long getOfficeId() {
|
||||||
return totalTimeVisitsLast30Days;
|
return officeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public String getCurrentOfficeName() {
|
public String getEmail() {
|
||||||
return currentOfficeName;
|
return email;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public String getCreateAt() {
|
public String getTelephone() {
|
||||||
return createAt;
|
return telephone;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public String getPatronymic() {
|
||||||
|
return patronymic;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public String getSurname() {
|
||||||
|
return surname;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,7 +6,7 @@ import java.util.function.Consumer;
|
|||||||
|
|
||||||
import ru.myitschool.work.api.domain.EmployeeRepository;
|
import ru.myitschool.work.api.domain.EmployeeRepository;
|
||||||
import ru.myitschool.work.api.domain.entity.Status;
|
import ru.myitschool.work.api.domain.entity.Status;
|
||||||
import ru.myitschool.work.api.domain.entity.employee.EmpolyeeEntity;
|
import ru.myitschool.work.api.domain.entity.employee.EmployeeEntity;
|
||||||
|
|
||||||
public class DeleteEmployeeUseCase {
|
public class DeleteEmployeeUseCase {
|
||||||
private final EmployeeRepository employeeRepository;
|
private final EmployeeRepository employeeRepository;
|
||||||
@ -16,7 +16,7 @@ public class DeleteEmployeeUseCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void execute(long id, @NonNull Consumer<Status<EmpolyeeEntity>> callback) {
|
public void execute(long id, @NonNull Consumer<Status<EmployeeEntity>> callback) {
|
||||||
employeeRepository.deleteEmployee(id,callback);
|
employeeRepository.deleteEmployee(id,callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import java.util.function.Consumer;
|
|||||||
|
|
||||||
import ru.myitschool.work.api.domain.EmployeeRepository;
|
import ru.myitschool.work.api.domain.EmployeeRepository;
|
||||||
import ru.myitschool.work.api.domain.entity.Status;
|
import ru.myitschool.work.api.domain.entity.Status;
|
||||||
import ru.myitschool.work.api.domain.entity.employee.EmpolyeeEntity;
|
import ru.myitschool.work.api.domain.entity.employee.EmployeeEntity;
|
||||||
|
|
||||||
public class GetAllEmployees {
|
public class GetAllEmployees {
|
||||||
private final EmployeeRepository employeeRepository;
|
private final EmployeeRepository employeeRepository;
|
||||||
@ -16,7 +16,7 @@ public class GetAllEmployees {
|
|||||||
this.employeeRepository = employeeRepository;
|
this.employeeRepository = employeeRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void execute(@NonNull Consumer<Status<List<EmpolyeeEntity>>> callback) {
|
public void execute(@NonNull Consumer<Status<List<EmployeeEntity>>> callback) {
|
||||||
employeeRepository.getAllEmployees(callback);
|
employeeRepository.getAllEmployees(callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import java.util.function.Consumer;
|
|||||||
|
|
||||||
import ru.myitschool.work.api.domain.EmployeeRepository;
|
import ru.myitschool.work.api.domain.EmployeeRepository;
|
||||||
import ru.myitschool.work.api.domain.entity.Status;
|
import ru.myitschool.work.api.domain.entity.Status;
|
||||||
import ru.myitschool.work.api.domain.entity.employee.EmpolyeeEntity;
|
import ru.myitschool.work.api.domain.entity.employee.EmployeeEntity;
|
||||||
|
|
||||||
public class GetEmloyeeByIdUseCase {
|
public class GetEmloyeeByIdUseCase {
|
||||||
private final EmployeeRepository employeeRepository;
|
private final EmployeeRepository employeeRepository;
|
||||||
@ -17,7 +17,7 @@ public class GetEmloyeeByIdUseCase {
|
|||||||
this.employeeRepository = employeeRepository;
|
this.employeeRepository = employeeRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void execute(long id, @NonNull Consumer<Status<EmpolyeeEntity>> callback) {
|
public void execute(long id, @NonNull Consumer<Status<EmployeeEntity>> callback) {
|
||||||
employeeRepository.getEmployeeById(id, callback);
|
employeeRepository.getEmployeeById(id, callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import java.util.function.Consumer;
|
|||||||
|
|
||||||
import ru.myitschool.work.api.domain.EmployeeRepository;
|
import ru.myitschool.work.api.domain.EmployeeRepository;
|
||||||
import ru.myitschool.work.api.domain.entity.Status;
|
import ru.myitschool.work.api.domain.entity.Status;
|
||||||
import ru.myitschool.work.api.domain.entity.employee.EmpolyeeEntity;
|
import ru.myitschool.work.api.domain.entity.employee.EmployeeEntity;
|
||||||
|
|
||||||
public class GetEmployeeByEmailUseCase {
|
public class GetEmployeeByEmailUseCase {
|
||||||
private final ru.myitschool.work.api.domain.EmployeeRepository employeeRepository;
|
private final ru.myitschool.work.api.domain.EmployeeRepository employeeRepository;
|
||||||
@ -15,6 +15,6 @@ public class GetEmployeeByEmailUseCase {
|
|||||||
this.employeeRepository = employeeRepository;
|
this.employeeRepository = employeeRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void execute(@NonNull String email, @NonNull Consumer<Status<EmpolyeeEntity>> callback) {
|
public void execute(@NonNull String email, @NonNull Consumer<Status<EmployeeEntity>> callback) {
|
||||||
employeeRepository.getEmployeeByEmail(email, callback);
|
employeeRepository.getEmployeeByEmail(email, callback);
|
||||||
}}
|
}}
|
||||||
|
@ -7,7 +7,7 @@ import java.util.function.Consumer;
|
|||||||
import ru.myitschool.work.api.data.dto.employee.EmployeeCreateDTO;
|
import ru.myitschool.work.api.data.dto.employee.EmployeeCreateDTO;
|
||||||
import ru.myitschool.work.api.domain.SignRepository;
|
import ru.myitschool.work.api.domain.SignRepository;
|
||||||
import ru.myitschool.work.api.domain.entity.Status;
|
import ru.myitschool.work.api.domain.entity.Status;
|
||||||
import ru.myitschool.work.api.domain.entity.employee.EmpolyeeEntity;
|
import ru.myitschool.work.api.domain.entity.employee.EmployeeEntity;
|
||||||
|
|
||||||
public class CreateEmployeeUseCase {
|
public class CreateEmployeeUseCase {
|
||||||
private final SignRepository signRepository;
|
private final SignRepository signRepository;
|
||||||
@ -16,7 +16,7 @@ public class CreateEmployeeUseCase {
|
|||||||
this.signRepository = signRepository;
|
this.signRepository = signRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void execute(@NonNull EmployeeCreateDTO employeeRegisterDTO, Consumer<Status<EmpolyeeEntity>> callback) {
|
public void execute(@NonNull EmployeeCreateDTO employeeRegisterDTO, Consumer<Status<EmployeeEntity>> callback) {
|
||||||
signRepository.createEmployee(employeeRegisterDTO, callback);
|
signRepository.createEmployee(employeeRegisterDTO, callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import java.util.function.Consumer;
|
|||||||
|
|
||||||
import ru.myitschool.work.api.domain.SignRepository;
|
import ru.myitschool.work.api.domain.SignRepository;
|
||||||
import ru.myitschool.work.api.domain.entity.Status;
|
import ru.myitschool.work.api.domain.entity.Status;
|
||||||
import ru.myitschool.work.api.domain.entity.employee.EmpolyeeEntity;
|
import ru.myitschool.work.api.domain.entity.employee.EmployeeEntity;
|
||||||
|
|
||||||
public class LoginEmployeeUseCase {
|
public class LoginEmployeeUseCase {
|
||||||
private final SignRepository signRepository;
|
private final SignRepository signRepository;
|
||||||
@ -15,9 +15,9 @@ public class LoginEmployeeUseCase {
|
|||||||
this.signRepository = signRepository;
|
this.signRepository = signRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void execute(@NonNull String email, @NonNull String password, Consumer<Status<EmpolyeeEntity>> callback) {
|
public void execute(@NonNull String email, @NonNull String password, Consumer<Status<EmployeeEntity>> callback) {
|
||||||
signRepository.login(email, password, employeeEntityStatus -> {
|
signRepository.login(email, password, employeeEntityStatus -> {
|
||||||
//if (employeeEntityStatus.getStatusCode() != 200) signRepository.logout();
|
if (employeeEntityStatus.getStatusCode() != 200) signRepository.logout();
|
||||||
callback.accept(employeeEntityStatus);
|
callback.accept(employeeEntityStatus);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.example.myapplication.core
|
package ru.myitschool.work.core
|
||||||
|
|
||||||
object UrlConstants {
|
object UrlConstants {
|
||||||
// url для эмулятора http://10.0.2.2:8080/
|
// url для эмулятора http://10.0.2.2:8080/
|
||||||
const val BASE_URL: String = "http://192.168.0.105:8080"
|
const val BASE_URL: String = "http://10.6.66.151:8080"
|
||||||
const val DOWNLOAD_URL: String = "$BASE_URL/api/v1/images/"
|
|
||||||
}
|
}
|
@ -1,115 +0,0 @@
|
|||||||
package ru.myitschool.work.ui.login;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.text.Editable;
|
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
import androidx.activity.EdgeToEdge;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.core.graphics.Insets;
|
|
||||||
import androidx.core.view.ViewCompat;
|
|
||||||
import androidx.core.view.WindowInsetsCompat;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
|
||||||
|
|
||||||
import com.example.myapplication.core.SettingConstants;
|
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
|
||||||
import com.google.android.material.textfield.TextInputEditText;
|
|
||||||
|
|
||||||
import ru.myitschool.work.R;
|
|
||||||
import ru.myitschool.work.databinding.ActivityLoginBinding;
|
|
||||||
import ru.myitschool.work.ui.main.MainActivity;
|
|
||||||
|
|
||||||
public class LoginActivity extends AppCompatActivity {
|
|
||||||
|
|
||||||
private ActivityLoginBinding binding;
|
|
||||||
private LoginViewModel viewModel;
|
|
||||||
|
|
||||||
|
|
||||||
public LoginActivity() {
|
|
||||||
super(R.layout.activity_login);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
EdgeToEdge.enable(this);
|
|
||||||
setContentView(R.layout.activity_login);
|
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
|
||||||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
|
||||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
|
||||||
return insets;
|
|
||||||
|
|
||||||
binding = ActivityLoginBinding.bind(v);
|
|
||||||
viewModel = new ViewModelProvider(this).get(ActivityLoginBinding.class);
|
|
||||||
|
|
||||||
binding.email.addTextChangedListener(new TextChangedListener<>(binding.email) {
|
|
||||||
@Override
|
|
||||||
public void onTextChanged(TextInputEditText target, Editable s) {
|
|
||||||
listenerEmailEditText(s);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
binding.password.addTextChangedListener(new TextChangedListener<>(binding.password) {
|
|
||||||
@Override
|
|
||||||
public void onTextChanged(TextInputEditText target, Editable s) {
|
|
||||||
listenerPasswordEditText(s);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
binding.btEnter.setOnClickListener(this.onClickListenerLoginButton);
|
|
||||||
|
|
||||||
subscribe();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void subscribe() {
|
|
||||||
viewModel.errorLiveData.observe(getViewLifecycleOwner(), error -> {
|
|
||||||
binding.btEnter.setEnabled(true);
|
|
||||||
Snackbar.make(requireView(), error, Snackbar.LENGTH_LONG).show();
|
|
||||||
});
|
|
||||||
viewModel.openLiveData.observe(getViewLifecycleOwner(), employee -> {
|
|
||||||
binding.btEnter.setEnabled(true);
|
|
||||||
|
|
||||||
SharedPreferences settings = requireView().getContext().getSharedPreferences(
|
|
||||||
SettingConstants.PREFS_FILE, Context.MODE_PRIVATE
|
|
||||||
);
|
|
||||||
settings.edit().putLong(SettingConstants.PREF_ID, employee.getId()).apply();
|
|
||||||
settings.edit().putString(SettingConstants.PREF_ROLE, employee.getRole()).apply();
|
|
||||||
|
|
||||||
startActivity(new Intent(getApplicationContext(), MainActivity.class));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void listenerEmailEditText(Editable s) {
|
|
||||||
if (s.toString().isEmpty()) {
|
|
||||||
binding.email.setError("Обязательное поле");
|
|
||||||
} else if (!isEmailValid(s.toString())) {
|
|
||||||
binding.emailLay.setError("Неверный формат");
|
|
||||||
} else {
|
|
||||||
binding.emailLay.setErrorEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void listenerPasswordEditText(Editable s) {
|
|
||||||
if (s.toString().isEmpty()) {
|
|
||||||
binding.passwordLay.setError("Обязательное поле");
|
|
||||||
} else {
|
|
||||||
binding.passwordLay.setErrorEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onClickListenerLoginButton(View view) {
|
|
||||||
binding.btEnter.setEnabled(false);
|
|
||||||
|
|
||||||
viewModel.changeEmail(String.valueOf(binding.email.getText()));
|
|
||||||
viewModel.changePassword(String.valueOf(binding.password.getText()));
|
|
||||||
viewModel.confirm();
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isEmailValid(String email) {
|
|
||||||
return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
package ru.myitschool.work.ui.profile;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import ru.myitschool.work.R;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A simple {@link Fragment} subclass.
|
|
||||||
* Use the {@link ProfileFragment#newInstance} factory method to
|
|
||||||
* create an instance of this fragment.
|
|
||||||
*/
|
|
||||||
public class ProfileFragment extends Fragment {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
|
||||||
Bundle savedInstanceState) {
|
|
||||||
// Inflate the layout for this fragment
|
|
||||||
return inflater.inflate(R.layout.fragment_profile, container, false);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
package ru.myitschool.work.ui.profile;
|
|
||||||
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import ru.myitschool.work.R;
|
|
||||||
|
|
||||||
public class RedactProfileFragment extends Fragment {
|
|
||||||
|
|
||||||
private RedactProfileViewModel mViewModel;
|
|
||||||
|
|
||||||
public static RedactProfileFragment newInstance() {
|
|
||||||
return new RedactProfileFragment();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
|
||||||
@Nullable Bundle savedInstanceState) {
|
|
||||||
return inflater.inflate(R.layout.fragment_redact_profile, container, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
|
||||||
super.onActivityCreated(savedInstanceState);
|
|
||||||
mViewModel = new ViewModelProvider(this).get(RedactProfileViewModel.class);
|
|
||||||
// TODO: Use the ViewModel
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
package ru.myitschool.work.ui.profile;
|
|
||||||
|
|
||||||
import androidx.lifecycle.ViewModel;
|
|
||||||
|
|
||||||
public class RedactProfileViewModel extends ViewModel {
|
|
||||||
// TODO: Implement the ViewModel
|
|
||||||
}
|
|
@ -0,0 +1,120 @@
|
|||||||
|
package ru.myitschool.work.ui.screens;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
|
||||||
|
import androidx.activity.EdgeToEdge;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.graphics.Insets;
|
||||||
|
import androidx.core.view.ViewCompat;
|
||||||
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
|
||||||
|
import com.example.myapplication.core.SettingConstants;
|
||||||
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
import com.google.android.material.textfield.TextInputEditText;
|
||||||
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
|
|
||||||
|
import ru.myitschool.work.R;
|
||||||
|
import ru.myitschool.work.ui.viewModel.LoginViewModel;
|
||||||
|
import ru.myitschool.work.utils.TextChangedListener;
|
||||||
|
|
||||||
|
public class LoginActivity extends AppCompatActivity {
|
||||||
|
private Button loginButton;
|
||||||
|
private TextInputEditText email;
|
||||||
|
private TextInputLayout emailLayout;
|
||||||
|
private TextInputEditText password;
|
||||||
|
private TextInputLayout passwordLayout;
|
||||||
|
private LoginViewModel viewModel;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
EdgeToEdge.enable(this);
|
||||||
|
setContentView(R.layout.activity_login);
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||||
|
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||||
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
|
return insets;
|
||||||
|
});
|
||||||
|
|
||||||
|
loginButton = findViewById(R.id.loginButton);
|
||||||
|
email = findViewById(R.id.email);
|
||||||
|
emailLayout = findViewById(R.id.email_layout);
|
||||||
|
password = findViewById(R.id.password);
|
||||||
|
passwordLayout = findViewById(R.id.password_layout);
|
||||||
|
|
||||||
|
viewModel = new ViewModelProvider(this).get(LoginViewModel.class);
|
||||||
|
|
||||||
|
email.addTextChangedListener(new TextChangedListener<>(email) {
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(TextInputEditText target, Editable s) {
|
||||||
|
listenerEmailEditText(s);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
password.addTextChangedListener(new TextChangedListener<>(password) {
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(TextInputEditText target, Editable s) {
|
||||||
|
listenerPasswordEditText(s);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
loginButton.setOnClickListener(this::onClickListenerLoginButton);
|
||||||
|
subscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void subscribe() {
|
||||||
|
viewModel.errorLiveData.observe(this, error -> {
|
||||||
|
loginButton.setEnabled(true);
|
||||||
|
Snackbar.make(findViewById(android.R.id.content), error, Snackbar.LENGTH_LONG).show();
|
||||||
|
});
|
||||||
|
viewModel.openLiveData.observe(this, employee -> {
|
||||||
|
loginButton.setEnabled(true);
|
||||||
|
|
||||||
|
SharedPreferences settings = getSharedPreferences(
|
||||||
|
SettingConstants.PREFS_FILE, Context.MODE_PRIVATE
|
||||||
|
);
|
||||||
|
settings.edit().putLong(SettingConstants.PREF_ID, employee.getId()).apply();
|
||||||
|
settings.edit().putString(SettingConstants.PREF_ROLE, employee.getRole()).apply();
|
||||||
|
|
||||||
|
startActivity(new Intent(this, MainActivity.class));
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void listenerEmailEditText(Editable s) {
|
||||||
|
if (s.toString().isEmpty()) {
|
||||||
|
emailLayout.setError("Обязательное поле");
|
||||||
|
} else if (!isEmailValid(s.toString())) {
|
||||||
|
emailLayout.setError("Неверный формат");
|
||||||
|
} else {
|
||||||
|
emailLayout.setErrorEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void listenerPasswordEditText(Editable s) {
|
||||||
|
if (s.toString().isEmpty()) {
|
||||||
|
passwordLayout.setError("Обязательное поле");
|
||||||
|
} else {
|
||||||
|
passwordLayout.setErrorEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onClickListenerLoginButton(View view) {
|
||||||
|
loginButton.setEnabled(false);
|
||||||
|
|
||||||
|
viewModel.changeEmail(String.valueOf(email.getText()));
|
||||||
|
viewModel.changePassword(String.valueOf(password.getText()));
|
||||||
|
viewModel.confirm();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isEmailValid(String email) {
|
||||||
|
return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches();
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,9 @@
|
|||||||
package ru.myitschool.work.ui.main;
|
package ru.myitschool.work.ui.screens;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.activity.EdgeToEdge;
|
import androidx.activity.EdgeToEdge;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
@ -8,9 +11,12 @@ import androidx.core.graphics.Insets;
|
|||||||
import androidx.core.view.ViewCompat;
|
import androidx.core.view.ViewCompat;
|
||||||
import androidx.core.view.WindowInsetsCompat;
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
|
import com.example.myapplication.core.SettingConstants;
|
||||||
|
|
||||||
import ru.myitschool.work.R;
|
import ru.myitschool.work.R;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
private SharedPreferences settings;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -22,5 +28,13 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
return insets;
|
return insets;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
settings = getSharedPreferences(SettingConstants.PREFS_FILE, MODE_PRIVATE);
|
||||||
|
|
||||||
|
if (settings.getLong(SettingConstants.PREF_ID, SettingConstants.ERROR_ID) == SettingConstants.ERROR_ID) {
|
||||||
|
Log.d("Test", "(MainActivity) Пользователь не авторизован!");
|
||||||
|
startActivity(new Intent(this, LoginActivity.class));
|
||||||
|
finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package ru.myitschool.work.ui.screens;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import ru.myitschool.work.R;
|
||||||
|
import ru.myitschool.work.databinding.FragmentQrBinding;
|
||||||
|
|
||||||
|
public class QrFragment extends Fragment {
|
||||||
|
private FragmentQrBinding binding;
|
||||||
|
|
||||||
|
public QrFragment() { super(R.layout.fragment_qr); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
binding = FragmentQrBinding.bind(view);
|
||||||
|
|
||||||
|
binding.qrButton.setOnClickListener(this::qrScanListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void qrScanListener(View view) {
|
||||||
|
this.requireActivity().getSupportFragmentManager().beginTransaction()
|
||||||
|
.replace(R.id.fragment_container_view, QrScanFragment.class, null)
|
||||||
|
.addToBackStack("").commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyView() {
|
||||||
|
binding = null;
|
||||||
|
super.onDestroyView();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package ru.myitschool.work.ui.screens;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import ru.myitschool.work.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple {@link Fragment} subclass.
|
||||||
|
* Use the {@link QrScanFragment#newInstance} factory method to
|
||||||
|
* create an instance of this fragment.
|
||||||
|
*/
|
||||||
|
public class QrScanFragment extends Fragment {
|
||||||
|
|
||||||
|
// TODO: Rename parameter arguments, choose names that match
|
||||||
|
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
||||||
|
private static final String ARG_PARAM1 = "param1";
|
||||||
|
private static final String ARG_PARAM2 = "param2";
|
||||||
|
|
||||||
|
// TODO: Rename and change types of parameters
|
||||||
|
private String mParam1;
|
||||||
|
private String mParam2;
|
||||||
|
|
||||||
|
public QrScanFragment() {
|
||||||
|
// Required empty public constructor
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this factory method to create a new instance of
|
||||||
|
* this fragment using the provided parameters.
|
||||||
|
*
|
||||||
|
* @param param1 Parameter 1.
|
||||||
|
* @param param2 Parameter 2.
|
||||||
|
* @return A new instance of fragment QrScanFragment.
|
||||||
|
*/
|
||||||
|
// TODO: Rename and change types and number of parameters
|
||||||
|
public static QrScanFragment newInstance(String param1, String param2) {
|
||||||
|
QrScanFragment fragment = new QrScanFragment();
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
args.putString(ARG_PARAM1, param1);
|
||||||
|
args.putString(ARG_PARAM2, param2);
|
||||||
|
fragment.setArguments(args);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
if (getArguments() != null) {
|
||||||
|
mParam1 = getArguments().getString(ARG_PARAM1);
|
||||||
|
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
// Inflate the layout for this fragment
|
||||||
|
return inflater.inflate(R.layout.fragment_qr_scan, container, false);
|
||||||
|
}
|
||||||
|
}
|
@ -1,38 +0,0 @@
|
|||||||
package ru.myitschool.work.ui.userlist;
|
|
||||||
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import ru.myitschool.work.R;
|
|
||||||
|
|
||||||
public class CompanyInfoFragment extends Fragment {
|
|
||||||
|
|
||||||
private CompanyInfoViewModel mViewModel;
|
|
||||||
|
|
||||||
public static CompanyInfoFragment newInstance() {
|
|
||||||
return new CompanyInfoFragment();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
|
||||||
@Nullable Bundle savedInstanceState) {
|
|
||||||
return inflater.inflate(R.layout.company_info_fragment, container, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
|
||||||
super.onActivityCreated(savedInstanceState);
|
|
||||||
mViewModel = new ViewModelProvider(this).get(CompanyInfoViewModel.class);
|
|
||||||
// TODO: Use the ViewModel
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
package ru.myitschool.work.ui.userlist;
|
|
||||||
|
|
||||||
import androidx.lifecycle.ViewModel;
|
|
||||||
|
|
||||||
public class CompanyInfoViewModel extends ViewModel {
|
|
||||||
// TODO: Implement the ViewModel
|
|
||||||
}
|
|
@ -1,4 +1,6 @@
|
|||||||
package ru.myitschool.work.ui.login;
|
package ru.myitschool.work.ui.viewModel;
|
||||||
|
|
||||||
|
import androidx.lifecycle.ViewModel;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@ -6,17 +8,17 @@ import androidx.lifecycle.LiveData;
|
|||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
import ru.myitschool.work.api.data.SignRepositoryImpl;
|
import ru.myitschool.work.api.data.SignRepositoryImpl;
|
||||||
import ru.myitschool.work.api.domain.entity.employee.EmpolyeeEntity;
|
import ru.myitschool.work.api.domain.entity.employee.EmployeeEntity;
|
||||||
import ru.myitschool.work.api.domain.useCases.sign.LoginEmployeeUseCase;
|
import ru.myitschool.work.api.domain.useCases.sign.LoginEmployeeUseCase;
|
||||||
|
|
||||||
public class LoginViewModel {
|
public class LoginViewModel extends ViewModel {
|
||||||
private final MutableLiveData<String> mutableErrorLiveData = new MutableLiveData<>();
|
private final MutableLiveData<String> mutableErrorLiveData = new MutableLiveData<>();
|
||||||
public final LiveData<String> errorLiveData = mutableErrorLiveData;
|
public final LiveData<String> errorLiveData = mutableErrorLiveData;
|
||||||
|
|
||||||
private final MutableLiveData<EmpolyeeEntity> mutableOpenLiveData = new MutableLiveData<>();
|
private final MutableLiveData<EmployeeEntity> mutableOpenLiveData = new MutableLiveData<>();
|
||||||
public final LiveData<EmpolyeeEntity> openLiveData = mutableOpenLiveData;
|
public final LiveData<EmployeeEntity> openLiveData = mutableOpenLiveData;
|
||||||
|
|
||||||
private final LoginEmployeeUseCase loginEmployeeUseCase = new LoginEmployeeUseCase(
|
private final LoginEmployeeUseCase loginVolunteerUseCase = new LoginEmployeeUseCase(
|
||||||
SignRepositoryImpl.getInstance()
|
SignRepositoryImpl.getInstance()
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -38,19 +40,19 @@ public class LoginViewModel {
|
|||||||
final String currentPassword = password;
|
final String currentPassword = password;
|
||||||
|
|
||||||
if (currentEmail == null || currentEmail.isEmpty()) {
|
if (currentEmail == null || currentEmail.isEmpty()) {
|
||||||
mutableErrorLiveData.postValue("Пароль пустой!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (currentPassword == null || currentPassword.isEmpty()) {
|
|
||||||
mutableErrorLiveData.postValue("email пустой!");
|
mutableErrorLiveData.postValue("email пустой!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loginEmployeeUseCase.execute(currentEmail, currentPassword, status -> {
|
if (currentPassword == null || currentPassword.isEmpty()) {
|
||||||
|
mutableErrorLiveData.postValue("Пароль пустой!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
loginVolunteerUseCase.execute("example1@gmail.com", "password", status -> {
|
||||||
if (status.getStatusCode() == 200 && status.getErrors() == null && status.getValue() != null) {
|
if (status.getStatusCode() == 200 && status.getErrors() == null && status.getValue() != null) {
|
||||||
mutableOpenLiveData.postValue(status.getValue());
|
mutableOpenLiveData.postValue(status.getValue());
|
||||||
} else if (status.getStatusCode() == 401) mutableErrorLiveData.postValue("Данные не верны. Попробуйте ещё разок :(");
|
} else if (status.getStatusCode() == 401)
|
||||||
else mutableErrorLiveData.postValue("Вы не подключены к интернету :(");
|
mutableErrorLiveData.postValue("Данные не верны. Попробуйте ещё разок :(");
|
||||||
|
else mutableErrorLiveData.postValue("Вы не подключены к интернету :( " + status.getStatusCode() + " " + status.getValue());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
36
app/src/main/res/drawable/activity_main.xml
Normal file
36
app/src/main/res/drawable/activity_main.xml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout
|
||||||
|
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:id="@+id/main"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<androidx.fragment.app.FragmentContainerView
|
||||||
|
android:id="@+id/container"
|
||||||
|
android:layout_width="79dp"
|
||||||
|
android:layout_height="131dp"
|
||||||
|
android:layout_above="@+id/bottom_navigation_view"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginStart="0dp"
|
||||||
|
android:layout_marginTop="0dp"
|
||||||
|
android:layout_marginEnd="0dp"
|
||||||
|
android:layout_marginBottom="0dp" />
|
||||||
|
|
||||||
|
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||||
|
android:id="@+id/bottom_navigation_view"
|
||||||
|
style="@style/Widget.Material3.ActionMode"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginBottom="0dp"
|
||||||
|
android:paddingBottom="0dp"
|
||||||
|
app:itemIconSize="30dp"
|
||||||
|
app:labelVisibilityMode="unlabeled"
|
||||||
|
app:menu="@menu/bottom_nav_menu" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
BIN
app/src/main/res/drawable/application_icon.png
Normal file
BIN
app/src/main/res/drawable/application_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
BIN
app/src/main/res/drawable/background_qr_fragment.png
Normal file
BIN
app/src/main/res/drawable/background_qr_fragment.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
BIN
app/src/main/res/drawable/qr_code.png
Normal file
BIN
app/src/main/res/drawable/qr_code.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.0 KiB |
BIN
app/src/main/res/drawable/small_application_icon.png
Normal file
BIN
app/src/main/res/drawable/small_application_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
11
app/src/main/res/drawable/splash_screen.xml
Normal file
11
app/src/main/res/drawable/splash_screen.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">
|
||||||
|
<!-- The background color, preferably the same as your normal theme -->
|
||||||
|
<item android:drawable="@color/application_icon_color"/>
|
||||||
|
<!-- Your product logo - 144dp color version of your app icon -->
|
||||||
|
<item>
|
||||||
|
<bitmap
|
||||||
|
android:src="@drawable/small_application_icon"
|
||||||
|
android:gravity="center"/>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
@ -1,122 +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="300dp"
|
|
||||||
android:layout_height="300dp"
|
|
||||||
|
|
||||||
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="50dp"
|
|
||||||
|
|
||||||
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"
|
|
||||||
android:textSize="26sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/position"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
|
|
||||||
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"
|
|
||||||
android:textSize="26sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/lastEntry"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
|
|
||||||
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"
|
|
||||||
android:textSize="26sp" />
|
|
||||||
|
|
||||||
<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"
|
|
||||||
android:textSize="26sp" />
|
|
||||||
|
|
||||||
<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"
|
|
||||||
android:textSize="26sp" />
|
|
||||||
|
|
||||||
<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"
|
|
||||||
android:textSize="26sp" />
|
|
||||||
|
|
||||||
<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"
|
|
||||||
android:textSize="26sp" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
@ -1,27 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:id="@+id/fragment_result"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:screenOrientation="portrait" >
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/result"
|
|
||||||
android:layout_width="570dp"
|
|
||||||
android:layout_height="305dp"
|
|
||||||
|
|
||||||
android:layout_above="@+id/close"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:layout_marginBottom="100dp"
|
|
||||||
|
|
||||||
android:padding="5dp"
|
|
||||||
android:textSize="30sp" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/close"
|
|
||||||
android:layout_width="533dp"
|
|
||||||
android:layout_height="76dp"
|
|
||||||
android:layout_centerInParent="true"
|
|
||||||
android:text="@string/close"
|
|
||||||
android:textSize="30sp" />
|
|
||||||
</RelativeLayout>
|
|
@ -5,92 +5,87 @@
|
|||||||
android:id="@+id/main"
|
android:id="@+id/main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".ui.login.LoginActivity"
|
tools:context=".ui.screens.LoginActivity"
|
||||||
android:background="@drawable/background">
|
android:background="@drawable/background_login">
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:layout_width="50dp"
|
android:layout_width="360dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_centerInParent="true"
|
||||||
android:layout_alignParentTop="true"
|
app:cardCornerRadius="20dp">
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_marginStart="40dp"
|
|
||||||
android:layout_marginTop="220dp"
|
|
||||||
android:layout_marginEnd="50dp"
|
|
||||||
android:layout_marginBottom="270dp"
|
|
||||||
app:cardBackgroundColor="@color/white">
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent">
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:padding="24dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="104dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="46dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentStart="true"
|
android:text="@string/login_text"
|
||||||
android:layout_alignParentTop="true"
|
android:textSize="40sp"
|
||||||
android:layout_alignParentEnd="true"
|
android:textAlignment="center"
|
||||||
android:layout_marginStart="115dp"
|
android:textStyle="bold" />
|
||||||
android:layout_marginTop="40dp"
|
|
||||||
android:layout_marginEnd="115dp"
|
|
||||||
android:text="Вход"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="40dp" />
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/email_lay"
|
android:id="@+id/email_layout"
|
||||||
android:layout_width="10dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentStart="true"
|
app:shapeAppearance="@style/rounded"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_marginTop="20dp"
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="80dp"
|
app:boxStrokeColor="@color/login_main_color"
|
||||||
android:layout_marginTop="110dp"
|
app:cursorColor="#49454F"
|
||||||
android:layout_marginEnd="80dp">
|
app:hintTextColor="@color/login_main_color">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/email"
|
android:id="@+id/email"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="55dp"
|
||||||
android:hint="Email"/>
|
android:hint="@string/email"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:inputType="text"/>
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/password_lay"
|
android:id="@+id/password_layout"
|
||||||
android:layout_width="10dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_marginTop="5dp"
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
app:shapeAppearance="@style/rounded"
|
||||||
android:layout_marginStart="80dp"
|
|
||||||
android:layout_marginTop="180dp"
|
app:endIconMode="password_toggle"
|
||||||
android:layout_marginEnd="80dp">
|
app:helperTextTextColor="@color/red"
|
||||||
|
|
||||||
|
app:boxStrokeColor="@color/login_main_color"
|
||||||
|
app:cursorColor="#49454F"
|
||||||
|
app:hintTextColor="@color/login_main_color">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/password"
|
android:id="@+id/password"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="55dp"
|
||||||
android:hint="Пароль"/>
|
android:hint="@string/password"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:maxLines="1" />
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<Button
|
||||||
android:id="@+id/bt_enter"
|
android:id="@+id/loginButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="60dp"
|
||||||
android:text="Войти в систему"
|
android:text="@string/login"
|
||||||
android:textColor="@color/white"
|
android:textStyle="bold"
|
||||||
android:layout_alignParentStart="true"
|
android:textSize="16sp"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_marginTop="20dp"
|
||||||
android:layout_alignParentEnd="true"
|
android:backgroundTint="@color/login_main_color"
|
||||||
android:layout_marginStart="80dp"
|
app:cornerRadius="20dp" />
|
||||||
android:layout_marginTop="250dp"
|
|
||||||
android:layout_marginEnd="80dp"
|
</LinearLayout>
|
||||||
app:backgroundTint="#B1B1CF"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -1,17 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
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"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/main"
|
android:id="@+id/main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal">
|
tools:context=".ui.screens.MainActivity"
|
||||||
|
android:background="@color/white">
|
||||||
|
|
||||||
<androidx.fragment.app.FragmentContainerView
|
<androidx.fragment.app.FragmentContainerView
|
||||||
android:id="@+id/container"
|
android:id="@+id/fragment_container_view"
|
||||||
android:layout_width="79dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="131dp"
|
android:layout_height="match_parent"
|
||||||
|
android:name="ru.myitschool.work.ui.screens.QrFragment"
|
||||||
android:layout_above="@+id/bottom_navigation_view"
|
android:layout_above="@+id/bottom_navigation_view"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
@ -19,7 +20,7 @@
|
|||||||
android:layout_marginStart="0dp"
|
android:layout_marginStart="0dp"
|
||||||
android:layout_marginTop="0dp"
|
android:layout_marginTop="0dp"
|
||||||
android:layout_marginEnd="0dp"
|
android:layout_marginEnd="0dp"
|
||||||
android:layout_marginBottom="0dp" />
|
android:layout_marginBottom="0dp"/>
|
||||||
|
|
||||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||||
android:id="@+id/bottom_navigation_view"
|
android:id="@+id/bottom_navigation_view"
|
||||||
|
@ -1,225 +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:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
tools:context=".ui.profile.ProfileFragment">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginEnd="0dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/ic_user"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginLeft="5dp"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:text="@string/company_info"
|
|
||||||
android:textSize="25dp"
|
|
||||||
android:layout_gravity="center"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/imageCompany"
|
|
||||||
android:layout_width="140dp"
|
|
||||||
android:layout_height="140dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginTop="90dp"
|
|
||||||
android:layout_marginEnd="0dp" />
|
|
||||||
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/relllLay"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:layout_below="@+id/imageCompany"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginTop="0dp"
|
|
||||||
android:layout_marginEnd="0dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/nameCompany"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="20dp"
|
|
||||||
android:layout_marginTop="14dp"
|
|
||||||
android:layout_marginEnd="38dp"
|
|
||||||
android:maxLines="1" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/descriptionLay"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/workTimeLay"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:background="#B1B1CF">
|
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_marginStart="15dp"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:background="@drawable/info" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/description"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="50dp"
|
|
||||||
android:layout_marginTop="40dp"
|
|
||||||
android:layout_marginEnd="36dp"
|
|
||||||
android:maxLines="10" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_below="@+id/description"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="50dp"
|
|
||||||
android:layout_marginTop="-45dp"
|
|
||||||
android:layout_marginEnd="270dp"
|
|
||||||
android:text="@string/description" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/workTimeLay"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="120dp"
|
|
||||||
android:layout_below="@+id/relLay"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:background="#B1B1CF">
|
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_marginStart="15dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:background="@drawable/contacts" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/telephone_tv"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="50dp"
|
|
||||||
android:layout_marginTop="37dp"
|
|
||||||
android:layout_marginEnd="36dp"
|
|
||||||
android:maxLines="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/email_tv"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_below="@+id/telephone_tv"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="50dp"
|
|
||||||
android:layout_marginTop="6dp"
|
|
||||||
android:layout_marginEnd="36dp"
|
|
||||||
android:maxLines="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_below="@+id/telephone_tv"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="50dp"
|
|
||||||
android:layout_marginTop="-54dp"
|
|
||||||
android:layout_marginEnd="270dp"
|
|
||||||
android:text="@string/contacts" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/relLay"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="80dp"
|
|
||||||
android:layout_below="@+id/relllLay"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
android:background="#B1B1CF">
|
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_marginStart="5dp"
|
|
||||||
android:layout_marginTop="15dp"
|
|
||||||
android:background="@drawable/ic_address" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/address"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="50dp"
|
|
||||||
android:layout_marginTop="37dp"
|
|
||||||
android:layout_marginEnd="36dp"
|
|
||||||
android:maxLines="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_below="@+id/address"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="50dp"
|
|
||||||
android:layout_marginTop="-54dp"
|
|
||||||
android:layout_marginEnd="301dp"
|
|
||||||
android:text="@string/address" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
@ -1,51 +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"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/search_lay"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginEnd="0dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/ic_user"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginLeft="5dp"/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.SearchView
|
|
||||||
android:id="@+id/search"
|
|
||||||
android:layout_width="340dp"
|
|
||||||
android:layout_marginStart="5dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_marginEnd="0dp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
android:layout_width="10dp"
|
|
||||||
android:layout_height="10dp"
|
|
||||||
android:layout_below="@+id/search_lay"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginEnd="0dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginBottom="5dp">
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/recycler"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"/>
|
|
||||||
</ScrollView>
|
|
||||||
</RelativeLayout>
|
|
@ -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>
|
|
@ -1,218 +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:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
tools:context=".ui.profile.ProfileFragment">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginEnd="0dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/ic_user"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginLeft="5dp"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:text="@string/info"
|
|
||||||
android:textSize="25dp"
|
|
||||||
android:layout_gravity="center"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/imageView2"
|
|
||||||
android:layout_width="140dp"
|
|
||||||
android:layout_height="140dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="140dp"
|
|
||||||
android:layout_marginTop="90dp"
|
|
||||||
android:layout_marginEnd="140dp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/linearLayout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginTop="265dp"
|
|
||||||
android:layout_marginEnd="0dp"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:padding="8dp">
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:layout_marginLeft="20dp"
|
|
||||||
android:text="@string/redact"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
app:backgroundTint="@color/white"
|
|
||||||
app:cornerRadius="30dp"
|
|
||||||
app:strokeColor="@color/design_default_color_on_primary" />
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:layout_marginLeft="30dp"
|
|
||||||
android:text="@string/bloked"
|
|
||||||
app:backgroundTint="#D46A6C" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/relLay"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="200dp"
|
|
||||||
android:layout_below="@+id/linearLayout"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginTop="0dp"
|
|
||||||
android:layout_marginEnd="0dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/fio"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="22dp"
|
|
||||||
android:layout_marginEnd="33dp"
|
|
||||||
android:maxLines="1"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_below="@+id/fio"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="300dp"
|
|
||||||
android:text="@string/FIO"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/role"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_below="@+id/fio"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="32dp"
|
|
||||||
android:layout_marginEnd="33dp"
|
|
||||||
android:maxLines="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_below="@+id/role"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="300dp"
|
|
||||||
android:text="@string/role"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/id_user"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_below="@+id/role"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="32dp"
|
|
||||||
android:layout_marginEnd="33dp"
|
|
||||||
android:maxLines="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_below="@+id/id_user"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="300dp"
|
|
||||||
android:text="@string/id"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="200dp"
|
|
||||||
android:layout_below="@+id/relLay"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginTop="0dp"
|
|
||||||
android:layout_marginEnd="0dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/telephone"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="22dp"
|
|
||||||
android:layout_marginEnd="33dp"
|
|
||||||
android:maxLines="1"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_below="@+id/telephone"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="300dp"
|
|
||||||
android:text="@string/phoneNum"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/email"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_below="@+id/telephone"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="32dp"
|
|
||||||
android:layout_marginEnd="33dp"
|
|
||||||
android:maxLines="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_below="@+id/email"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="230dp"
|
|
||||||
android:text="@string/email"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
</RelativeLayout>
|
|
50
app/src/main/res/layout/fragment_qr.xml
Normal file
50
app/src/main/res/layout/fragment_qr.xml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
tools:context=".ui.screens.QrFragment"
|
||||||
|
android:background="@drawable/background_qr_fragment">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/session_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
android:text="@string/session_30_days"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="24sp" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/session_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginTop="90dp"
|
||||||
|
android:text="@string/hours_500"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="22sp" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/qr_button"
|
||||||
|
android:layout_width="180dp"
|
||||||
|
android:layout_height="180dp"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginBottom="176dp"
|
||||||
|
android:contentDescription="@string/qr_code"
|
||||||
|
android:src="@drawable/qr_code"
|
||||||
|
android:background="#1E1F5C"/>
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</FrameLayout>
|
@ -1,35 +1,22 @@
|
|||||||
<?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"
|
<FrameLayout 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"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".ui.screens.QrScanFragment">
|
||||||
|
|
||||||
<androidx.camera.view.PreviewView
|
<RelativeLayout
|
||||||
android:id="@+id/viewFinder"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="0dp"
|
android:layout_height="match_parent">
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:id="@+id/loading"
|
|
||||||
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_toTopOf="parent" />
|
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
<TextView
|
||||||
android:id="@+id/close"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_centerInParent="true"
|
||||||
android:layout_margin="16dp"
|
android:text="Сканирование qr кода"
|
||||||
android:contentDescription="@string/close_button"
|
android:textAlignment="center"
|
||||||
android:src="@drawable/ic_close"
|
android:textSize="30sp" />
|
||||||
app:elevation="0dp"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
</RelativeLayout>
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
</FrameLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,209 +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:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
tools:context=".ui.profile.ProfileFragment">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginEnd="0dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/ic_user"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginLeft="5dp"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:text="@string/setProfile"
|
|
||||||
android:textSize="25dp"
|
|
||||||
android:layout_gravity="center"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/imageView2"
|
|
||||||
android:layout_width="140dp"
|
|
||||||
android:layout_height="140dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="140dp"
|
|
||||||
android:layout_marginTop="90dp"
|
|
||||||
android:layout_marginEnd="140dp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/linearLayout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginTop="265dp"
|
|
||||||
android:layout_marginEnd="0dp"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:padding="8dp">
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginLeft="100dp"
|
|
||||||
android:text="@string/redacting"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="10dp"
|
|
||||||
app:backgroundTint="@color/white" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/relLay"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="200dp"
|
|
||||||
android:layout_below="@+id/linearLayout"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginTop="0dp"
|
|
||||||
android:layout_marginEnd="0dp">
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/fio"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="22dp"
|
|
||||||
android:layout_marginEnd="33dp"
|
|
||||||
android:maxLines="1"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_below="@+id/fio_et"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="300dp"
|
|
||||||
android:text="@string/FIO"/>
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/role_et"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_below="@+id/fio"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="32dp"
|
|
||||||
android:layout_marginEnd="33dp"
|
|
||||||
android:maxLines="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_below="@+id/role_et"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="300dp"
|
|
||||||
android:text="@string/role"/>
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/id_user_et"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_below="@+id/role_et"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="32dp"
|
|
||||||
android:layout_marginEnd="33dp"
|
|
||||||
android:maxLines="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_below="@+id/id_user_et"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="300dp"
|
|
||||||
android:text="@string/id"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="200dp"
|
|
||||||
android:layout_below="@+id/relLay"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginTop="0dp"
|
|
||||||
android:layout_marginEnd="0dp">
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/telephone_et"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="22dp"
|
|
||||||
android:layout_marginEnd="33dp"
|
|
||||||
android:maxLines="1"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_below="@+id/telephone_et"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="300dp"
|
|
||||||
android:text="@string/phoneNum"/>
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/email_et"
|
|
||||||
android:layout_width="350dp"
|
|
||||||
android:layout_height="30dp"
|
|
||||||
android:layout_below="@+id/telephone_et"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="32dp"
|
|
||||||
android:layout_marginEnd="33dp"
|
|
||||||
android:maxLines="1" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="20dp"
|
|
||||||
android:layout_below="@+id/email_et"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginStart="32dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginEnd="230dp"
|
|
||||||
android:text="@string/email"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
</RelativeLayout>
|
|
@ -1,26 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RelativeLayout 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"
|
|
||||||
android:id="@+id/fragment_result"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/result"
|
|
||||||
android:layout_width="180dp"
|
|
||||||
android:layout_height="80dp"
|
|
||||||
|
|
||||||
android:layout_above="@+id/close"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:layout_marginBottom="100dp"
|
|
||||||
|
|
||||||
android:padding="5dp" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/close"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerInParent="true"
|
|
||||||
android:text="@string/close" />
|
|
||||||
</RelativeLayout>
|
|
@ -1,80 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="120dp"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
app:cardCornerRadius="8dp"
|
|
||||||
app:cardElevation="4dp"
|
|
||||||
app:cardBackgroundColor="#B1B1CF"
|
|
||||||
>
|
|
||||||
|
|
||||||
<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>
|
|
@ -7,4 +7,11 @@
|
|||||||
<color name="teal_700">#FF018786</color>
|
<color name="teal_700">#FF018786</color>
|
||||||
<color name="black">#FF000000</color>
|
<color name="black">#FF000000</color>
|
||||||
<color name="white">#FFFFFFFF</color>
|
<color name="white">#FFFFFFFF</color>
|
||||||
|
|
||||||
|
<color name="black_overlay">#66000000</color>
|
||||||
|
<color name="application_icon_color">#040827</color>
|
||||||
|
<color name="login_main_color">#B1B1CF</color>
|
||||||
|
|
||||||
|
<color name="green">#678B78</color>
|
||||||
|
<color name="red">#FF0000</color>
|
||||||
</resources>
|
</resources>
|
@ -1,5 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">NTO Client 2024</string>
|
<string name="app_name">QRP</string>
|
||||||
|
|
||||||
<!-- Всё, что относится к LoginActivity -->
|
<!-- Всё, что относится к LoginActivity -->
|
||||||
<string name="title_activity_login">LoginActivity</string>
|
<string name="title_activity_login">LoginActivity</string>
|
||||||
@ -39,4 +39,10 @@
|
|||||||
<string name="address">Адрес</string>
|
<string name="address">Адрес</string>
|
||||||
<string name="contacts">Контакты</string>
|
<string name="contacts">Контакты</string>
|
||||||
<string name="description">Описание</string>
|
<string name="description">Описание</string>
|
||||||
|
<string name="login">Войти</string>
|
||||||
|
<string name="password">Пароль</string>
|
||||||
|
<string name="login_text">Вход</string>
|
||||||
|
<string name="qr_code">qr_code</string>
|
||||||
|
<string name="hours_500">500 часов</string>
|
||||||
|
<string name="session_30_days">Сессии за последние 30 дней:</string>
|
||||||
</resources>
|
</resources>
|
33
app/src/main/res/values/styles.xml
Normal file
33
app/src/main/res/values/styles.xml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<resources>
|
||||||
|
<style name="Widget.Theme.MyApplication.ButtonBar.Fullscreen" parent="">
|
||||||
|
<item name="android:background">@color/black_overlay</item>
|
||||||
|
<item name="android:buttonBarStyle">?android:attr/buttonBarStyle</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="App.Custom.Indicator" parent="Widget.Material3.BottomNavigationView.ActiveIndicator">
|
||||||
|
<item name="android:color">@color/white</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="rounded" parent="ShapeAppearance.MaterialComponents.SmallComponent">
|
||||||
|
<item name="cornerFamily">rounded</item>
|
||||||
|
<item name="cornerSize">20dp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="roundedImageView" parent="">
|
||||||
|
<item name="cornerFamily">rounded</item>
|
||||||
|
<item name="cornerSize">16dp</item>
|
||||||
|
</style>
|
||||||
|
<style name="roundedImageViewSmall" parent="">
|
||||||
|
<item name="cornerFamily">rounded</item>
|
||||||
|
<item name="cornerSize">6dp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="splashScreenTheme" parent="@style/AppTheme.NoActionBar">
|
||||||
|
<item name="android:windowBackground">@drawable/splash_screen</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="circleImageView" parent="">
|
||||||
|
<item name="cornerFamily">rounded</item>
|
||||||
|
<item name="cornerSize">50%</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
@ -1,6 +1,6 @@
|
|||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="Theme.Default" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
<style name="AppTheme.NoActionBar" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
<!-- Primary brand color. -->
|
<!-- Primary brand color. -->
|
||||||
<item name="colorPrimary">@color/purple_500</item>
|
<item name="colorPrimary">@color/purple_500</item>
|
||||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user