Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
e9d0beaa1e | |||
fc86c76656 | |||
6d75ee149c |
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-feature android:name="android.hardware.camera.any" />
|
||||
|
||||
@ -8,22 +7,24 @@
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:allowBackup="false"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:icon="@drawable/application_icon"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Default"
|
||||
tools:targetApi="31">
|
||||
android:usesCleartextTraffic="true"
|
||||
android:theme="@style/splashScreenTheme">
|
||||
|
||||
<meta-data android:name="com.google.android.geo.API_KEY"
|
||||
android:value="AIzaSyBtIU8oX16f9I0oLvoevw2T332vr10_Sw8"/>
|
||||
|
||||
<activity
|
||||
android:name=".ui.main.MainActivity"
|
||||
android:name=".ui.screens.LoginActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.login.LoginActivity"
|
||||
android:exported="true">
|
||||
android:name=".ui.screens.MainActivity"
|
||||
android:exported="true" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@ -31,5 +32,4 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</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.network.RetrofitFactory;
|
||||
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.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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@ -85,22 +83,22 @@ public class EmployeeRepositoryImpl implements EmployeeRepository {
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void getAllEmployees(@NonNull Consumer<Status<List<EmpolyeeEntity>>> callback) {
|
||||
public void getAllEmployees(@NonNull Consumer<Status<List<EmployeeEntity>>> callback) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemEmployeeEntity getEmployeeById(long id, @NonNull Consumer<Status<EmpolyeeEntity>> callback) {
|
||||
public ItemEmployeeEntity getEmployeeById(long id, @NonNull Consumer<Status<EmployeeEntity>> callback) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getEmployeeByEmail(@NonNull String email, @NonNull Consumer<Status<EmpolyeeEntity>> callback) {
|
||||
public void getEmployeeByEmail(@NonNull String email, @NonNull Consumer<Status<EmployeeEntity>> callback) {
|
||||
|
||||
}
|
||||
|
||||
@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
|
||||
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;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
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.domain.SignRepository;
|
||||
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 {
|
||||
private static SignRepositoryImpl INSTANCE;
|
||||
@ -27,7 +29,7 @@ public class SignRepositoryImpl implements SignRepository {
|
||||
}
|
||||
|
||||
@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<>(
|
||||
callback,
|
||||
employeeDTO -> {
|
||||
@ -42,32 +44,27 @@ public class SignRepositoryImpl implements SignRepository {
|
||||
final long officeId = employeeDTO.officeId;
|
||||
final String officeName = employeeDTO.officeName;
|
||||
final String officeUrl= employeeDTO.officeImageUrl;
|
||||
final String possition = employeeDTO.position;
|
||||
final String position = employeeDTO.position;
|
||||
final String role = employeeDTO.role;
|
||||
final String profileImageUrl= employeeDTO.profileImageUrl;
|
||||
final boolean visitStatus= employeeDTO.visitStatus;
|
||||
final String startVisit= employeeDTO.startVisitDateTime;
|
||||
final List<Long> visitIdLast30Days = employeeDTO.visitsIdLast30Days;
|
||||
final long totalVisitTimeLast30Days = employeeDTO.totalTimeVisitsLast30Days;
|
||||
final String curentOfficeName = employeeDTO.currentOfficeName;
|
||||
final String currentOfficeName = employeeDTO.currentOfficeName;
|
||||
final String createdAt= employeeDTO.createAt;
|
||||
|
||||
if (name != null && surname != null && telephone != null &&
|
||||
email_ != null && officeName != null && officeUrl != null &&
|
||||
possition != null && role != null && startVisit != null &&
|
||||
visitIdLast30Days != null && curentOfficeName != null &&
|
||||
createdAt != null) {
|
||||
|
||||
return new EmpolyeeEntity(id_, name, surname, patronymic,
|
||||
telephone, email_, officeId, officeName, officeUrl, possition, role, profileImageUrl,
|
||||
visitStatus, startVisit, visitIdLast30Days, totalVisitTimeLast30Days, curentOfficeName, createdAt);
|
||||
if (name != null && surname != null && telephone != null && email_ != null && officeName != null && officeUrl != null && position != null &&
|
||||
role != null && startVisit != null && profileImageUrl != null && visitIdLast30Days != null && currentOfficeName != null && createdAt != null) {
|
||||
return new EmployeeEntity(id_, name, surname, patronymic, telephone, email_, officeId, officeName, officeUrl, position, role, profileImageUrl,
|
||||
visitStatus, startVisit, visitIdLast30Days, totalVisitTimeLast30Days, currentOfficeName, createdAt);
|
||||
} else return null;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@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);
|
||||
signApi.login().enqueue(new CallToConsumer<>(callback, employeeDTO -> {
|
||||
if (employeeDTO == null) return null;
|
||||
@ -81,25 +78,22 @@ public class SignRepositoryImpl implements SignRepository {
|
||||
final long officeId = employeeDTO.officeId;
|
||||
final String officeName = employeeDTO.officeName;
|
||||
final String officeUrl= employeeDTO.officeImageUrl;
|
||||
final String possition = employeeDTO.position;
|
||||
final String position = employeeDTO.position;
|
||||
final String role = employeeDTO.role;
|
||||
final String profileImageUrl= employeeDTO.profileImageUrl;
|
||||
final String profileImageUrl = employeeDTO.profileImageUrl;
|
||||
final boolean visitStatus= employeeDTO.visitStatus;
|
||||
final String startVisit= employeeDTO.startVisitDateTime;
|
||||
final String startVisit = employeeDTO.startVisitDateTime;
|
||||
final List<Long> visitIdLast30Days = employeeDTO.visitsIdLast30Days;
|
||||
final long totalVisitTimeLast30Days = employeeDTO.totalTimeVisitsLast30Days;
|
||||
final String curentOfficeName = employeeDTO.currentOfficeName;
|
||||
final String createdAt= employeeDTO.createAt;
|
||||
final String currentOfficeName = employeeDTO.currentOfficeName;
|
||||
final String createdAt = employeeDTO.createAt;
|
||||
|
||||
if (name != null && surname != null && telephone != null &&
|
||||
email_ != null && officeName != null && officeUrl != null &&
|
||||
possition != null && role != null && startVisit != null &&
|
||||
visitIdLast30Days != null && curentOfficeName != null &&
|
||||
createdAt != null) {
|
||||
if (name != null && surname != null && telephone != null && email_ != null && officeName != null && officeUrl != null
|
||||
&& position != null && role != null && profileImageUrl != null && startVisit != null && visitIdLast30Days != null
|
||||
&& currentOfficeName != null && createdAt != null) {
|
||||
|
||||
return new EmpolyeeEntity(id_, name, surname, patronymic,
|
||||
telephone, email_, officeId, officeName, officeUrl, possition, role, profileImageUrl,
|
||||
visitStatus, startVisit, visitIdLast30Days, totalVisitTimeLast30Days, curentOfficeName, createdAt);
|
||||
return new EmployeeEntity(id_, name, surname, patronymic, telephone, email_, officeId, officeName, officeUrl, position, role, profileImageUrl,
|
||||
visitStatus, startVisit, visitIdLast30Days, totalVisitTimeLast30Days, currentOfficeName, createdAt);
|
||||
} else return null;
|
||||
}));
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class EmployeeDTO {
|
||||
@SerializedName("officeImageUrl")
|
||||
public String officeImageUrl;
|
||||
@Nullable
|
||||
@SerializedName("position")
|
||||
@SerializedName("positionName")
|
||||
public String position; // Название должности
|
||||
@Nullable
|
||||
@SerializedName("role")
|
||||
|
@ -1,6 +1,6 @@
|
||||
package ru.myitschool.work.api.data.network;
|
||||
|
||||
import com.example.myapplication.core.UrlConstants;
|
||||
import ru.myitschool.work.core.UrlConstants;
|
||||
|
||||
import okhttp3.OkHttpClient;
|
||||
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;
|
||||
|
||||
public interface SignApi {
|
||||
@POST("api/v1/employees/authorization/register")
|
||||
@POST("api/v1/authorization/register")
|
||||
Call<EmployeeDTO> register(@Body EmployeeCreateDTO employeeCreateDTO);
|
||||
|
||||
@GET("api/v1/employees/authorization//login")
|
||||
@GET("api/v1/authorization/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.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;
|
||||
|
||||
public interface EmployeeRepository {
|
||||
void getAllEmployees(@NonNull Consumer<Status<List<EmpolyeeEntity>>> callback);
|
||||
ItemEmployeeEntity getEmployeeById(long id, @NonNull Consumer<Status<EmpolyeeEntity>> callback);
|
||||
void getEmployeeByEmail(@NonNull String email, @NonNull Consumer<Status<EmpolyeeEntity>> callback);
|
||||
void getEmployeeByTelephone(@NonNull String telephone, @NonNull Consumer<Status<EmpolyeeEntity>> callback);
|
||||
void getAllEmployees(@NonNull Consumer<Status<List<EmployeeEntity>>> callback);
|
||||
ItemEmployeeEntity getEmployeeById(long id, @NonNull Consumer<Status<EmployeeEntity>> callback);
|
||||
void getEmployeeByEmail(@NonNull String email, @NonNull Consumer<Status<EmployeeEntity>> 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 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);
|
||||
}
|
||||
|
@ -6,10 +6,10 @@ import java.util.function.Consumer;
|
||||
|
||||
import ru.myitschool.work.api.data.dto.employee.EmployeeCreateDTO;
|
||||
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 {
|
||||
void createEmployee(@NonNull EmployeeCreateDTO employeeRegisterDTO, @NonNull Consumer<Status<EmpolyeeEntity>> callback);
|
||||
void login(@NonNull String email, @NonNull String password, @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<EmployeeEntity>> callback);
|
||||
void logout();
|
||||
}
|
||||
|
@ -1,21 +1,20 @@
|
||||
package ru.myitschool.work.api.domain.entity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public class Status<T> {
|
||||
final int statusCod;
|
||||
final int statusCode;
|
||||
@Nullable private final T value;
|
||||
@Nullable private final Throwable errors;
|
||||
|
||||
public Status(int statusCod, @Nullable T value, @Nullable Throwable errors) {
|
||||
this.statusCod = statusCod;
|
||||
public Status(int statusCode, @Nullable T value, @Nullable Throwable errors) {
|
||||
this.statusCode = statusCode;
|
||||
this.value = value;
|
||||
this.errors = errors;
|
||||
}
|
||||
|
||||
public int getStatusCod() {
|
||||
return statusCod;
|
||||
public int getStatusCode() {
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -3,18 +3,17 @@ package ru.myitschool.work.api.domain.entity.employee;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class EmpolyeeEntity {
|
||||
@NonNull private final long id;
|
||||
public class EmployeeEntity {
|
||||
private final long id;
|
||||
@NonNull private final String name;
|
||||
@NonNull private final String surname;
|
||||
@NonNull private final String patronymic;
|
||||
@Nullable private final String patronymic;
|
||||
@NonNull private final String telephone;
|
||||
@NonNull private final String email;
|
||||
|
||||
@NonNull private final long officeId;
|
||||
private final long officeId;
|
||||
@NonNull private final String officeName;
|
||||
@NonNull private final String officeImageUrl;
|
||||
|
||||
@ -24,7 +23,7 @@ public class EmpolyeeEntity {
|
||||
@NonNull private final String profileImageUrl;
|
||||
|
||||
// Текущее состояние входа: false - visit (посещение) ещё не началось, true - visit идёт
|
||||
@NonNull private final boolean visitStatus;
|
||||
private final boolean visitStatus;
|
||||
|
||||
// Если visitStatus true, то возвращает дату и время начала посещения в формате LocalDateTime.toString(),
|
||||
// превратить обратно можно с помощью LocalDateTime.parse().
|
||||
@ -33,7 +32,7 @@ public class EmpolyeeEntity {
|
||||
@NonNull private final List<Long> visitsIdLast30Days; // Список Id посещений за последние 30 дней.
|
||||
|
||||
// Возвращает количество отработанных часов за последний месяц.
|
||||
@NonNull private final long totalTimeVisitsLast30Days;
|
||||
private final long totalTimeVisitsLast30Days;
|
||||
|
||||
// (Возможно это стоит убрать) Название офиса, в котором сейчас находится работник.
|
||||
// Если visitStatus false, возвращает null.
|
||||
@ -43,7 +42,7 @@ public class EmpolyeeEntity {
|
||||
// превратить обратно можно с помощью LocalDateTime.parse().
|
||||
@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.name = name;
|
||||
this.surname = surname;
|
||||
@ -64,52 +63,37 @@ public class EmpolyeeEntity {
|
||||
this.createAt = createAt;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
@NonNull
|
||||
public String getCreateAt() {
|
||||
return createAt;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getName() {
|
||||
return name;
|
||||
public String getCurrentOfficeName() {
|
||||
return currentOfficeName;
|
||||
}
|
||||
|
||||
public long getTotalTimeVisitsLast30Days() {
|
||||
return totalTimeVisitsLast30Days;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getSurname() {
|
||||
return surname;
|
||||
public List<Long> getVisitsIdLast30Days() {
|
||||
return visitsIdLast30Days;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getPatronymic() {
|
||||
return patronymic;
|
||||
public String getStartVisitDateTime() {
|
||||
return startVisitDateTime;
|
||||
}
|
||||
|
||||
public boolean isVisitStatus() {
|
||||
return visitStatus;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getTelephone() {
|
||||
return telephone;
|
||||
}
|
||||
|
||||
@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;
|
||||
public String getProfileImageUrl() {
|
||||
return profileImageUrl;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@ -118,35 +102,50 @@ public class EmpolyeeEntity {
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getProfileImageUrl() {
|
||||
return profileImageUrl;
|
||||
}
|
||||
|
||||
public boolean isVisitStatus() {
|
||||
return visitStatus;
|
||||
public String getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getStartVisitDateTime() {
|
||||
return startVisitDateTime;
|
||||
public String getOfficeImageUrl() {
|
||||
return officeImageUrl;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public List<Long> getVisitsIdLast30Days() {
|
||||
return visitsIdLast30Days;
|
||||
public String getOfficeName() {
|
||||
return officeName;
|
||||
}
|
||||
|
||||
public long getTotalTimeVisitsLast30Days() {
|
||||
return totalTimeVisitsLast30Days;
|
||||
public long getOfficeId() {
|
||||
return officeId;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getCurrentOfficeName() {
|
||||
return currentOfficeName;
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getCreateAt() {
|
||||
return createAt;
|
||||
public String getTelephone() {
|
||||
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.entity.Status;
|
||||
import ru.myitschool.work.api.domain.entity.employee.EmpolyeeEntity;
|
||||
import ru.myitschool.work.api.domain.entity.employee.EmployeeEntity;
|
||||
|
||||
public class DeleteEmployeeUseCase {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import java.util.function.Consumer;
|
||||
|
||||
import ru.myitschool.work.api.domain.EmployeeRepository;
|
||||
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 {
|
||||
private final EmployeeRepository employeeRepository;
|
||||
@ -16,7 +16,7 @@ public class GetAllEmployees {
|
||||
this.employeeRepository = employeeRepository;
|
||||
}
|
||||
|
||||
public void execute(@NonNull Consumer<Status<List<EmpolyeeEntity>>> callback) {
|
||||
public void execute(@NonNull Consumer<Status<List<EmployeeEntity>>> 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.entity.Status;
|
||||
import ru.myitschool.work.api.domain.entity.employee.EmpolyeeEntity;
|
||||
import ru.myitschool.work.api.domain.entity.employee.EmployeeEntity;
|
||||
|
||||
public class GetEmloyeeByIdUseCase {
|
||||
private final EmployeeRepository employeeRepository;
|
||||
@ -17,7 +17,7 @@ public class GetEmloyeeByIdUseCase {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import java.util.function.Consumer;
|
||||
|
||||
import ru.myitschool.work.api.domain.EmployeeRepository;
|
||||
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 {
|
||||
private final ru.myitschool.work.api.domain.EmployeeRepository employeeRepository;
|
||||
@ -15,6 +15,6 @@ public class GetEmployeeByEmailUseCase {
|
||||
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);
|
||||
}}
|
||||
|
@ -7,7 +7,7 @@ import java.util.function.Consumer;
|
||||
import ru.myitschool.work.api.data.dto.employee.EmployeeCreateDTO;
|
||||
import ru.myitschool.work.api.domain.SignRepository;
|
||||
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 {
|
||||
private final SignRepository signRepository;
|
||||
@ -16,7 +16,7 @@ public class CreateEmployeeUseCase {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import java.util.function.Consumer;
|
||||
|
||||
import ru.myitschool.work.api.domain.SignRepository;
|
||||
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 {
|
||||
private final SignRepository signRepository;
|
||||
@ -15,9 +15,9 @@ public class LoginEmployeeUseCase {
|
||||
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 -> {
|
||||
//if (employeeEntityStatus.getStatusCode() != 200) signRepository.logout();
|
||||
if (employeeEntityStatus.getStatusCode() != 200) signRepository.logout();
|
||||
callback.accept(employeeEntityStatus);
|
||||
});
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.example.myapplication.core
|
||||
package ru.myitschool.work.core
|
||||
|
||||
object UrlConstants {
|
||||
// url для эмулятора http://10.0.2.2:8080/
|
||||
const val BASE_URL: String = "http://192.168.0.105:8080"
|
||||
const val DOWNLOAD_URL: String = "$BASE_URL/api/v1/images/"
|
||||
const val BASE_URL: String = "http://10.6.66.151:8080"
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
package ru.myitschool.work.ui.createemployee;
|
||||
|
||||
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 CreateUserFragment extends Fragment {
|
||||
|
||||
private CreateUserViewModel mViewModel;
|
||||
|
||||
public static CreateUserFragment newInstance() {
|
||||
return new CreateUserFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.fragment_create_user, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
mViewModel = new ViewModelProvider(this).get(CreateUserViewModel.class);
|
||||
// TODO: Use the ViewModel
|
||||
}
|
||||
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
package ru.myitschool.work.ui.createemployee;
|
||||
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
public class CreateUserViewModel extends ViewModel {
|
||||
// TODO: Implement the ViewModel
|
||||
}
|
@ -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(LoginViewModel.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(this, error -> {
|
||||
binding.btEnter.setEnabled(true);
|
||||
Snackbar.make(findViewById(android.R.id.content), error, Snackbar.LENGTH_LONG).show();
|
||||
});
|
||||
viewModel.openLiveData.observe(this, employee -> {
|
||||
binding.btEnter.setEnabled(true);
|
||||
|
||||
SharedPreferences settings = this.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,76 +0,0 @@
|
||||
package ru.myitschool.work.ui.main
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.example.myapplication.core.RoleConstants
|
||||
import com.example.myapplication.core.SettingConstants
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
import ru.myitschool.work.R
|
||||
import ru.myitschool.work.ui.createemployee.CreateUserFragment
|
||||
import ru.myitschool.work.ui.login.LoginActivity
|
||||
import ru.myitschool.work.ui.profile.ProfileFragment
|
||||
import ru.myitschool.work.ui.qr.scan.QrScanFragment
|
||||
import ru.myitschool.work.ui.userlist.CompanyInfoFragment
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
private lateinit var settings: SharedPreferences
|
||||
|
||||
private lateinit var bottomNavigationView: BottomNavigationView
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
setContentView(R.layout.activity_main)
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
|
||||
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||
insets
|
||||
}
|
||||
|
||||
settings = getSharedPreferences(SettingConstants.PREFS_FILE, Context.MODE_PRIVATE)
|
||||
|
||||
if (settings.getLong(SettingConstants.PREF_ID, SettingConstants.ERROR_ID) == SettingConstants.ERROR_ID) {
|
||||
Log.d("Test", "(MainActivity) Пользователь не зарегистрирован, запускаем регистрацию.")
|
||||
startActivity(Intent(this, LoginActivity::class.java))
|
||||
finish()
|
||||
return
|
||||
}
|
||||
|
||||
window.navigationBarColor = ContextCompat.getColor(this, R.color.teal_200)
|
||||
|
||||
bottomNavigationView = findViewById(R.id.bottom_navigation_view)
|
||||
|
||||
if (settings.getString(SettingConstants.PREF_ROLE, SettingConstants.DEF_VALUE) == RoleConstants.ROLE_USER) {
|
||||
val menuItem = bottomNavigationView.menu.getItem(1);
|
||||
menuItem.setVisible(false)
|
||||
}
|
||||
|
||||
bottomNavigationView.setOnItemSelectedListener{ item ->
|
||||
// if (item.itemId == bottomNavigationView.selectedItemId) return@setOnItemSelectedListener false
|
||||
|
||||
when (item.itemId) {
|
||||
R.id.scaner -> replaceFragment(QrScanFragment())
|
||||
R.id.office -> replaceFragment(CompanyInfoFragment())
|
||||
R.id.createEmployee -> replaceFragment(CreateUserFragment())
|
||||
//R.id.employees -> replaceFragment(EmployeesListFragment())
|
||||
R.id.profile -> replaceFragment(ProfileFragment())
|
||||
}
|
||||
window.statusBarColor = ContextCompat.getColor(this, R.color.grey)
|
||||
|
||||
return@setOnItemSelectedListener true
|
||||
}
|
||||
}
|
||||
|
||||
private fun replaceFragment(fragment: Fragment) {
|
||||
supportFragmentManager.beginTransaction().replace(R.id.container, fragment).commit()
|
||||
}
|
||||
}
|
@ -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
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
package ru.myitschool.work.ui.qr.scan
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.core.os.bundleOf
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
// НЕ ИЗМЕНЯЙТЕ ЭТОТ ФАЙЛ. В ТЕСТАХ ОН БУДЕМ ВОЗВРАЩЁН В ИСХОДНОЕ СОСТОЯНИЕ
|
||||
@Serializable
|
||||
data object QrScanDestination {
|
||||
const val REQUEST_KEY = "qr_result"
|
||||
private const val KEY_QR_DATA = "key_qr"
|
||||
|
||||
fun newInstance(): QrScanFragment {
|
||||
return QrScanFragment()
|
||||
}
|
||||
|
||||
fun getDataIfExist(bundle: Bundle): String? {
|
||||
return if (bundle.containsKey(KEY_QR_DATA)) {
|
||||
bundle.getString(KEY_QR_DATA)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
internal fun packToBundle(data: String): Bundle {
|
||||
return bundleOf(
|
||||
KEY_QR_DATA to data
|
||||
)
|
||||
}
|
||||
}
|
@ -1,139 +0,0 @@
|
||||
package ru.myitschool.work.ui.qr.scan
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.camera.core.ImageAnalysis
|
||||
import androidx.camera.mlkit.vision.MlKitAnalyzer
|
||||
import androidx.camera.view.LifecycleCameraController
|
||||
import androidx.camera.view.PreviewView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.setFragmentResult
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.navigation.NavController
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import com.google.mlkit.vision.barcode.BarcodeScanner
|
||||
import com.google.mlkit.vision.barcode.BarcodeScannerOptions
|
||||
import com.google.mlkit.vision.barcode.BarcodeScanning
|
||||
import com.google.mlkit.vision.barcode.common.Barcode
|
||||
import ru.myitschool.work.R
|
||||
import ru.myitschool.work.databinding.FragmentQrScanBinding
|
||||
import ru.myitschool.work.utils.collectWhenStarted
|
||||
import ru.myitschool.work.utils.visibleOrGone
|
||||
|
||||
// НЕ ИЗМЕНЯЙТЕ ЭТОТ ФАЙЛ. В ТЕСТАХ ОН БУДЕМ ВОЗВРАЩЁН В ИСХОДНОЕ СОСТОЯНИЕ
|
||||
class QrScanFragment : Fragment(R.layout.fragment_qr_scan) {
|
||||
private var _binding: FragmentQrScanBinding? = null
|
||||
private val binding: FragmentQrScanBinding get() = _binding!!
|
||||
|
||||
private var barcodeScanner: BarcodeScanner? = null
|
||||
private var isCameraInit: Boolean = false
|
||||
private val permissionLauncher = registerForActivityResult(
|
||||
ActivityResultContracts.RequestPermission()
|
||||
) { isGranted -> viewModel.onPermissionResult(isGranted) }
|
||||
|
||||
private val viewModel: QrScanViewModel by viewModels()
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
_binding = FragmentQrScanBinding.bind(view)
|
||||
sendResult(bundleOf())
|
||||
subscribe()
|
||||
initCallback()
|
||||
}
|
||||
|
||||
private fun initCallback() {
|
||||
binding.close.setOnClickListener { viewModel.close() }
|
||||
}
|
||||
|
||||
private fun subscribe() {
|
||||
viewModel.state.collectWhenStarted(this) { state ->
|
||||
binding.loading.visibleOrGone(state is QrScanViewModel.State.Loading)
|
||||
binding.viewFinder.visibleOrGone(state is QrScanViewModel.State.Scan)
|
||||
if (!isCameraInit && state is QrScanViewModel.State.Scan) {
|
||||
startCamera()
|
||||
isCameraInit = true
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.action.collectWhenStarted(this) { action ->
|
||||
when (action) {
|
||||
is QrScanViewModel.Action.RequestPermission -> requestPermission(action.permission)
|
||||
is QrScanViewModel.Action.CloseWithCancel -> {
|
||||
goBack()
|
||||
}
|
||||
is QrScanViewModel.Action.CloseWithResult -> {
|
||||
sendResult(QrScanDestination.packToBundle(action.result))
|
||||
goBack()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun requestPermission(permission: String) {
|
||||
permissionLauncher.launch(permission)
|
||||
}
|
||||
|
||||
private fun startCamera() {
|
||||
val context = requireContext()
|
||||
val cameraController = LifecycleCameraController(context)
|
||||
val previewView: PreviewView = binding.viewFinder
|
||||
val executor = ContextCompat.getMainExecutor(context)
|
||||
|
||||
val options = BarcodeScannerOptions.Builder()
|
||||
.setBarcodeFormats(Barcode.FORMAT_QR_CODE)
|
||||
.build()
|
||||
val barcodeScanner = BarcodeScanning.getClient(options)
|
||||
this.barcodeScanner = barcodeScanner
|
||||
|
||||
cameraController.setImageAnalysisAnalyzer(
|
||||
executor,
|
||||
MlKitAnalyzer(
|
||||
listOf(barcodeScanner),
|
||||
ImageAnalysis.COORDINATE_SYSTEM_VIEW_REFERENCED,
|
||||
executor
|
||||
) { result ->
|
||||
result?.getValue(barcodeScanner)?.firstOrNull()?.let { value ->
|
||||
viewModel.findBarcode(value)
|
||||
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
cameraController.bindToLifecycle(this)
|
||||
previewView.controller = cameraController
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
barcodeScanner?.close()
|
||||
barcodeScanner = null
|
||||
_binding = null
|
||||
super.onDestroyView()
|
||||
}
|
||||
|
||||
private fun goBack() {
|
||||
findNavControllerOrNull()?.popBackStack()
|
||||
?: requireActivity().onBackPressedDispatcher.onBackPressed()
|
||||
}
|
||||
|
||||
private fun sendResult(bundle: Bundle) {
|
||||
setFragmentResult(
|
||||
QrScanDestination.REQUEST_KEY,
|
||||
bundle
|
||||
)
|
||||
findNavControllerOrNull()
|
||||
?.previousBackStackEntry
|
||||
?.savedStateHandle
|
||||
?.set(QrScanDestination.REQUEST_KEY, bundle)
|
||||
}
|
||||
|
||||
private fun findNavControllerOrNull(): NavController? {
|
||||
return try {
|
||||
findNavController()
|
||||
} catch (_: Throwable) {
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
package ru.myitschool.work.ui.qr.scan
|
||||
|
||||
import android.Manifest
|
||||
import android.app.Application
|
||||
import android.content.pm.PackageManager
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.lifecycle.AndroidViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.google.mlkit.vision.barcode.common.Barcode
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.asSharedFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.launch
|
||||
import ru.myitschool.work.utils.MutablePublishFlow
|
||||
|
||||
// НЕ ИЗМЕНЯЙТЕ ЭТОТ ФАЙЛ. В ТЕСТАХ ОН БУДЕМ ВОЗВРАЩЁН В ИСХОДНОЕ СОСТОЯНИЕ
|
||||
class QrScanViewModel(
|
||||
application: Application
|
||||
) : AndroidViewModel(application) {
|
||||
|
||||
private val _action = MutablePublishFlow<Action>()
|
||||
val action = _action.asSharedFlow()
|
||||
|
||||
private val _state = MutableStateFlow<State>(initialState)
|
||||
val state = _state.asStateFlow()
|
||||
|
||||
init {
|
||||
checkPermission()
|
||||
}
|
||||
|
||||
fun onPermissionResult(isGranted: Boolean) {
|
||||
viewModelScope.launch {
|
||||
if (isGranted) {
|
||||
_state.update { State.Scan }
|
||||
} else {
|
||||
_action.emit(Action.CloseWithCancel)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkPermission() {
|
||||
viewModelScope.launch {
|
||||
val isPermissionGranted = ContextCompat.checkSelfPermission(
|
||||
getApplication(),
|
||||
CAMERA_PERMISSION
|
||||
) == PackageManager.PERMISSION_GRANTED
|
||||
if (isPermissionGranted) {
|
||||
_state.update { State.Scan }
|
||||
} else {
|
||||
delay(1000)
|
||||
_action.emit(Action.RequestPermission(CAMERA_PERMISSION))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun findBarcode(barcode: Barcode) {
|
||||
viewModelScope.launch {
|
||||
barcode.rawValue?.let { value ->
|
||||
_action.emit(Action.CloseWithResult(value))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun close() {
|
||||
viewModelScope.launch {
|
||||
_action.emit(Action.CloseWithCancel)
|
||||
}
|
||||
}
|
||||
|
||||
sealed interface State {
|
||||
data object Loading : State
|
||||
|
||||
data object Scan : State
|
||||
}
|
||||
|
||||
sealed interface Action {
|
||||
data class RequestPermission(
|
||||
val permission: String
|
||||
) : Action
|
||||
data object CloseWithCancel : Action
|
||||
data class CloseWithResult(
|
||||
val result: String
|
||||
) : Action
|
||||
}
|
||||
|
||||
private companion object {
|
||||
val initialState = State.Loading
|
||||
|
||||
const val CAMERA_PERMISSION = Manifest.permission.CAMERA
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package ru.myitschool.work.ui.screens;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
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 com.example.myapplication.core.SettingConstants;
|
||||
|
||||
import ru.myitschool.work.R;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
private SharedPreferences settings;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
EdgeToEdge.enable(this);
|
||||
setContentView(R.layout.activity_main);
|
||||
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;
|
||||
});
|
||||
|
||||
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,23 +1,24 @@
|
||||
package ru.myitschool.work.ui.login;
|
||||
package ru.myitschool.work.ui.viewModel;
|
||||
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
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;
|
||||
|
||||
public class LoginViewModel extends ViewModel {
|
||||
private final MutableLiveData<String> mutableErrorLiveData = new MutableLiveData<>();
|
||||
public final LiveData<String> errorLiveData = mutableErrorLiveData;
|
||||
|
||||
private final MutableLiveData<EmpolyeeEntity> mutableOpenLiveData = new MutableLiveData<>();
|
||||
public final LiveData<EmpolyeeEntity> openLiveData = mutableOpenLiveData;
|
||||
private final MutableLiveData<EmployeeEntity> mutableOpenLiveData = new MutableLiveData<>();
|
||||
public final LiveData<EmployeeEntity> openLiveData = mutableOpenLiveData;
|
||||
|
||||
private final LoginEmployeeUseCase loginEmployeeUseCase = new LoginEmployeeUseCase(
|
||||
private final LoginEmployeeUseCase loginVolunteerUseCase = new LoginEmployeeUseCase(
|
||||
SignRepositoryImpl.getInstance()
|
||||
);
|
||||
|
||||
@ -39,19 +40,19 @@ public class LoginViewModel extends ViewModel {
|
||||
final String currentPassword = password;
|
||||
|
||||
if (currentEmail == null || currentEmail.isEmpty()) {
|
||||
mutableErrorLiveData.postValue("Пароль пустой!");
|
||||
return;
|
||||
}
|
||||
if (currentPassword == null || currentPassword.isEmpty()) {
|
||||
mutableErrorLiveData.postValue("email пустой!");
|
||||
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) {
|
||||
mutableOpenLiveData.postValue(status.getValue());
|
||||
} else if (status.getStatusCode() == 401) mutableErrorLiveData.postValue("Данные не верны. Попробуйте ещё разок :(");
|
||||
else mutableErrorLiveData.postValue("Вы не подключены к интернету :(");
|
||||
} else if (status.getStatusCode() == 401)
|
||||
mutableErrorLiveData.postValue("Данные не верны. Попробуйте ещё разок :(");
|
||||
else mutableErrorLiveData.postValue("Вы не подключены к интернету :( " + status.getStatusCode() + " " + status.getValue());
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -4,7 +4,7 @@ import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
|
||||
public abstract class TextChangedListener<T> implements TextWatcher {
|
||||
private final T target;
|
||||
private final T target;
|
||||
|
||||
public TextChangedListener(T target) {
|
||||
this.target = target;
|
||||
|
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
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
After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 505 B |
BIN
app/src/main/res/drawable/qr_code.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 564 B After Width: | Height: | Size: 409 B |
BIN
app/src/main/res/drawable/small_application_icon.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
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>
|
Before Width: | Height: | Size: 505 B |
@ -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,93 +5,87 @@
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.login.LoginActivity"
|
||||
android:background="@drawable/background">
|
||||
tools:context=".ui.screens.LoginActivity"
|
||||
android:background="@drawable/background_login">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
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"
|
||||
android:layout_width="360dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
app:cardCornerRadius="20dp">
|
||||
|
||||
<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
|
||||
android:layout_width="104dp"
|
||||
android:layout_height="46dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="115dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="115dp"
|
||||
android:text="Вход"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="40dp" />
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/login_text"
|
||||
android:textSize="40sp"
|
||||
android:textAlignment="center"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/email_lay"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="80dp"
|
||||
android:layout_marginTop="110dp"
|
||||
android:layout_marginEnd="80dp">
|
||||
android:id="@+id/email_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:shapeAppearance="@style/rounded"
|
||||
android:layout_marginTop="20dp"
|
||||
|
||||
app:boxStrokeColor="@color/login_main_color"
|
||||
app:cursorColor="#49454F"
|
||||
app:hintTextColor="@color/login_main_color">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/email"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:hint="Email"/>
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:hint="@string/email"
|
||||
android:maxLines="1"
|
||||
android:inputType="text"/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/password_lay"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="80dp"
|
||||
android:layout_marginTop="180dp"
|
||||
android:layout_marginEnd="80dp">
|
||||
android:id="@+id/password_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
|
||||
app:shapeAppearance="@style/rounded"
|
||||
|
||||
app:endIconMode="password_toggle"
|
||||
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
|
||||
android:id="@+id/password"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:hint="Пароль"/>
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:hint="@string/password"
|
||||
android:inputType="textPassword"
|
||||
android:maxLines="1" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/bt_enter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Войти в систему"
|
||||
android:textColor="@color/white"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="80dp"
|
||||
android:layout_marginTop="250dp"
|
||||
android:layout_marginEnd="80dp"
|
||||
app:backgroundTint="#B1B1CF"/>
|
||||
<Button
|
||||
android:id="@+id/loginButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:text="@string/login"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:backgroundTint="@color/login_main_color"
|
||||
app:cornerRadius="20dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
||||
</RelativeLayout>
|
@ -1,17 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
<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/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
tools:context=".ui.screens.MainActivity"
|
||||
android:background="@color/white">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/container"
|
||||
android:layout_width="79dp"
|
||||
android:layout_height="131dp"
|
||||
android:id="@+id/fragment_container_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:name="ru.myitschool.work.ui.screens.QrFragment"
|
||||
android:layout_above="@+id/bottom_navigation_view"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
@ -19,7 +20,7 @@
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_marginBottom="0dp" />
|
||||
android:layout_marginBottom="0dp"/>
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/bottom_navigation_view"
|
||||
|
@ -1,234 +0,0 @@
|
||||
<?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.profile.ProfileFragment">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<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>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
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:backgroundTint="#B1B1CF"
|
||||
app:cardCornerRadius="15dp">
|
||||
|
||||
|
||||
<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:layout_marginBottom="10dp"
|
||||
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="15dp"
|
||||
android:layout_marginEnd="279dp"
|
||||
android:text="@string/description" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
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:backgroundTint="#B1B1CF"
|
||||
app:cardCornerRadius="15dp">
|
||||
|
||||
|
||||
<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="75dp"
|
||||
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="40dp"
|
||||
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="5dp"
|
||||
android:layout_marginEnd="270dp"
|
||||
android:text="@string/contacts" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
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:backgroundTint="#B1B1CF"
|
||||
app:cardCornerRadius="15dp">
|
||||
|
||||
|
||||
<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="10dp"
|
||||
android:layout_marginEnd="301dp"
|
||||
android:text="@string/address" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</RelativeLayout>
|
||||
|
||||
</FrameLayout>
|
@ -1,57 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout 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">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<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>
|
||||
</FrameLayout>
|
@ -1,248 +0,0 @@
|
||||
<?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.createemployee.CreateUserFragment"
|
||||
android:background="@drawable/background">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<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"
|
||||
android:background="@color/white">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:background="@drawable/ic_user" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:text="@string/addEmployee"
|
||||
android:textSize="25dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/name_create_lay"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="70dp"
|
||||
android:layout_marginTop="119dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
app:shapeAppearance="@style/rounded">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/name_create"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:hint="Имя"
|
||||
android:background="#FFFFFF" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/surname_create_lay"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@+id/name_create_lay"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="70dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
app:shapeAppearance="@style/rounded">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/surname_create"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:hint="Фамилия"
|
||||
android:background="#FFFFFF"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/patronomic_create_lay"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@+id/surname_create_lay"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="70dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
app:shapeAppearance="@style/rounded">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/patronomic_create"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:hint="Отчество"
|
||||
android:background="#FFFFFF"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/telephone_create_lay"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@+id/patronomic_create_lay"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="70dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
app:shapeAppearance="@style/rounded">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/telephone_create"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:hint="Телефон"
|
||||
android:background="#FFFFFF"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/email_create_lay"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@+id/telephone_create_lay"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="70dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
app:shapeAppearance="@style/rounded">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/email_create"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:hint="Электронная почта"
|
||||
android:background="#FFFFFF"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/password_create_lay"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@+id/email_create_lay"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="70dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
app:shapeAppearance="@style/rounded">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/password_create"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:hint="Пароль"
|
||||
android:background="#FFFFFF"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/officename_create_lay"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@+id/password_create_lay"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="70dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
app:shapeAppearance="@style/rounded">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/officename_create"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:hint="Название офиса"
|
||||
android:background="#FFFFFF"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/possition_create_lay"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@+id/officename_create_lay"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="70dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
app:shapeAppearance="@style/rounded">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/position_create"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:hint="Должность"
|
||||
android:background="#FFFFFF"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/role_create_lay"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@+id/possition_create_lay"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="70dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
android:background="@color/white"
|
||||
android:entries="@array/roles"/>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_create_lay"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_below="@+id/role_create_lay"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="70dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
android:text="Создать"
|
||||
android:backgroundTint="#B1CFBB"
|
||||
android:textColor="@color/black"
|
||||
app:shapeAppearance="@style/rounded"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</FrameLayout>
|
@ -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,224 +0,0 @@
|
||||
<?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.profile.ProfileFragment">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<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>
|
||||
</FrameLayout>
|
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"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
<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">
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.screens.QrScanFragment">
|
||||
|
||||
<androidx.camera.view.PreviewView
|
||||
android:id="@+id/viewFinder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_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
|
||||
android:id="@+id/close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:contentDescription="@string/close_button"
|
||||
android:src="@drawable/ic_close"
|
||||
app:elevation="0dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="Сканирование qr кода"
|
||||
android:textAlignment="center"
|
||||
android:textSize="30sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
</FrameLayout>
|
@ -1,217 +0,0 @@
|
||||
<?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.profile.ProfileFragment">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<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/profile_image_view"
|
||||
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"
|
||||
android:background="@color/black" />
|
||||
|
||||
<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:id="@+id/changeProfile"
|
||||
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_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/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_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/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>
|
||||
</FrameLayout>
|
@ -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,82 +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:cardElevation="4dp"
|
||||
app:cardBackgroundColor="#B1B1CF"
|
||||
app:cardCornerRadius="15dp"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<View
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginLeft="265dp"
|
||||
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"
|
||||
style="@style/Circle"
|
||||
android:background="@color/black"/>
|
||||
<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>
|
@ -15,13 +15,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/createEmployee"
|
||||
android:title="@string/createEmployee"
|
||||
android:icon="@drawable/ic_create_employee"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/employees"
|
||||
android:title="@string/employees"
|
||||
|
@ -7,5 +7,11 @@
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="grey">#11FFFFFF</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>
|
@ -1,5 +1,5 @@
|
||||
<resources>
|
||||
<string name="app_name">NTO Client 2024</string>
|
||||
<string name="app_name">QRP</string>
|
||||
|
||||
<!-- Всё, что относится к LoginActivity -->
|
||||
<string name="title_activity_login">LoginActivity</string>
|
||||
@ -23,7 +23,7 @@
|
||||
<string name="profile">Профиль</string>
|
||||
<string name="office">Офис</string>
|
||||
<string name="scaning">Сканировать</string>
|
||||
|
||||
<!-- TODO: Remove or change this placeholder text -->
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
<string name="info">Информация о сотруднике</string>
|
||||
<string name="redact">Редактировать</string>
|
||||
@ -39,11 +39,10 @@
|
||||
<string name="address">Адрес</string>
|
||||
<string name="contacts">Контакты</string>
|
||||
<string name="description">Описание</string>
|
||||
<string name="createEmployee">Создать сотрудника</string>
|
||||
<string name="addEmployee">Добавить сотрудника</string>
|
||||
|
||||
<string-array name="roles">
|
||||
<item>Админ</item>
|
||||
<item>Пользователь</item>
|
||||
</string-array>
|
||||
<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>
|
@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Widget.Theme.MyApplication.ButtonBar.Fullscreen" parent="">
|
||||
<item name="android:background">@color/black</item>
|
||||
<item name="android:background">@color/black_overlay</item>
|
||||
<item name="android:buttonBarStyle">?android:attr/buttonBarStyle</item>
|
||||
</style>
|
||||
|
||||
@ -23,6 +22,10 @@
|
||||
<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>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Default" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<style name="AppTheme.NoActionBar" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
|