feat: History is working, small changes in Login

This commit is contained in:
SunZar 2025-02-20 14:42:33 +03:00
parent ae7a743d41
commit d5a49dfa1e
21 changed files with 213 additions and 148 deletions

View File

@ -62,13 +62,13 @@ public class UserRepositoryImpl implements UserRepository, SignUserRepository {
historiesDto -> { historiesDto -> {
ArrayList<HistoryEntity> result1 = new ArrayList<>(historiesDto.size()); ArrayList<HistoryEntity> result1 = new ArrayList<>(historiesDto.size());
for (HistoryDto history : historiesDto) { for (HistoryDto history : historiesDto) {
final Integer id1 = history.id; final Long id1 = history.id;
final String username1 = history.username; final String username1 = history.username;
final Long time = history.time; final String time = history.time;
final String type = history.type; final String type = history.type;
final Integer code = history.code; final Long code = history.code;
if (username1 != null && id1 != null){ if (username1 != null && id1 != null){
result1.add(new HistoryEntity(id1, username1, time, type, code)); result1.add(new HistoryEntity(id1, username1, type, time, code));
} }
} }
return result1; return result1;
@ -111,13 +111,14 @@ public class UserRepositoryImpl implements UserRepository, SignUserRepository {
callback, callback,
user -> { user -> {
if (user != null) { if (user != null) {
final Integer id1 = user.id;
final String username1 = user.username; final String username1 = user.username;
final String name = user.name;
final String photo = user.photo; final String photo = user.photo;
final Long lastVisit = user.lastVisit;
final Integer idUser = user.idUser;
final String position = user.position; final String position = user.position;
if (idUser != null && username != null){ final String authority = user.authority;
return new UserEntity(username1, photo, lastVisit, idUser, position); if (id1 != null && username != null){
return new UserEntity(id1, username1, name, photo, position, authority);
} }
else{ else{
return null; return null;

View File

@ -7,7 +7,7 @@ import com.google.gson.annotations.SerializedName;
public class HistoryDto { public class HistoryDto {
@Nullable @Nullable
@SerializedName("id") @SerializedName("id")
public Integer id; public Long id;
@Nullable @Nullable
@SerializedName("username") @SerializedName("username")
@ -15,7 +15,7 @@ public class HistoryDto {
@Nullable @Nullable
@SerializedName("time") @SerializedName("time")
public Long time; public String time;
@Nullable @Nullable
@SerializedName("type") @SerializedName("type")
@ -23,6 +23,6 @@ public class HistoryDto {
@Nullable @Nullable
@SerializedName("code") @SerializedName("code")
public Integer code; public Long code;
} }

View File

@ -5,35 +5,32 @@ import androidx.annotation.Nullable;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
public class UserDto { public class UserDto {
@Nullable
@SerializedName("id")
public Integer id;
@Nullable @Nullable
@SerializedName("username") @SerializedName("username")
public String username; public String username;
@Nullable @Nullable
@SerializedName("password") @SerializedName("name")
public String password; public String name;
@Nullable @Nullable
@SerializedName("photo") @SerializedName("photo")
public String photo; public String photo;
@Nullable
@SerializedName("lastVisit")
public Long lastVisit;
@Nullable
@SerializedName("idUser")
public Integer idUser;
@Nullable
@SerializedName("status")
public int status;
@Nullable @Nullable
@SerializedName("position") @SerializedName("position")
public String position; public String position;
public UserDto(@Nullable String username, @Nullable String password, @Nullable String photo, @Nullable Long lastVisit, @Nullable Integer idUser, int status, @Nullable String position) { @Nullable
@SerializedName("authority")
public String authority;
/*public UserDto(@Nullable String username, @Nullable String password, @Nullable String photo, @Nullable Long lastVisit, @Nullable Integer idUser, int status, @Nullable String position) {
this.username = username; this.username = username;
this.password = password; this.password = password;
this.photo = photo; this.photo = photo;
@ -108,7 +105,7 @@ public class UserDto {
*/

View File

@ -15,14 +15,14 @@ import ru.myitschool.work.ui.History;
public interface UserApi { public interface UserApi {
@GET("api/user") @GET("api/user")
Call<List<UserDto>> getAllUsers(); Call<List<UserDto>> getAllUsers();
@GET("api/user/{id}") @GET("api/user/{id}")
Call<UserDto> getUserByUsername(@Path("username") String Username); Call<UserDto> getUserByUsername(@Path("username") String Username);
@GET("api/user/username/{username}") @GET("api/{username}/auth")
Call<UserDto> isExistUser(@Path("username") String username); Call<Void> isExistUser(@Path("username") String username);
@GET("api/user/login") @GET("api/login")
Call<Void> login(); Call<Void> login();
@GET("api/history/user/{id}") @GET("api/{username}/passing")
Call<List<HistoryDto>> getAllUserHistory(@Path("id") String username); Call<List<HistoryDto>> getAllUserHistory(@Path("username") String username);
/* @GET("api/history/{id}") /* @GET("api/history/{id}")
Call<HistoryDto> getHistoryById(@Path("id") Integer id); Call<HistoryDto> getHistoryById(@Path("id") Integer id);
*/ */

View File

@ -7,14 +7,14 @@ import com.google.gson.annotations.SerializedName;
public class HistoryEntity { public class HistoryEntity {
@Nullable @Nullable
@SerializedName("id") @SerializedName("id")
public Integer id; public Long id;
@Nullable @Nullable
public Integer getId() { public Long getId() {
return id; return id;
} }
public void setId(@Nullable Integer id) { public void setId(@Nullable Long id) {
this.id = id; this.id = id;
} }
@ -28,11 +28,11 @@ public class HistoryEntity {
} }
@Nullable @Nullable
public Long getTime() { public String getTime() {
return time; return time;
} }
public void setTime(@Nullable Long time) { public void setTime(@Nullable String time) {
this.time = time; this.time = time;
} }
@ -46,19 +46,19 @@ public class HistoryEntity {
} }
@Nullable @Nullable
public Integer getCode() { public Long getCode() {
return code; return code;
} }
public void setCode(@Nullable Integer code) { public void setCode(@Nullable Long code) {
this.code = code; this.code = code;
} }
public HistoryEntity(@Nullable Integer id, @Nullable String username, @Nullable Long time, @Nullable String type, @Nullable Integer code) { public HistoryEntity(@Nullable Long id, @Nullable String username, @Nullable String type, @Nullable String time, @Nullable Long code) {
this.id = id; this.id = id;
this.username = username; this.username = username;
this.time = time;
this.type = type; this.type = type;
this.time = time;
this.code = code; this.code = code;
} }
@ -68,7 +68,7 @@ public class HistoryEntity {
@Nullable @Nullable
@SerializedName("time") @SerializedName("time")
public Long time; public String time;
@Nullable @Nullable
@SerializedName("type") @SerializedName("type")
@ -76,6 +76,6 @@ public class HistoryEntity {
@Nullable @Nullable
@SerializedName("code") @SerializedName("code")
public Integer code; public Long code;
} }

View File

@ -15,32 +15,37 @@ public class UserEntity {
public String username; public String username;
@Nullable @Nullable
@SerializedName("photo") @SerializedName("name")
public String photo; public String name;
@Nullable @Nullable
@SerializedName("lastVisit") @SerializedName("photo")
public Long lastVisit; public String photo;
@Nullable @Nullable
@SerializedName("position") @SerializedName("position")
public String position; public String position;
public UserEntity(@Nullable String username, @Nullable String photo, @Nullable Long lastVisit, @Nullable Integer id, @Nullable String position) { @Nullable
this.username = username; @SerializedName("authority")
this.photo = photo; public String authority;
this.lastVisit = lastVisit;
public UserEntity(@Nullable Integer id, @Nullable String username, @Nullable String name, @Nullable String photo, @Nullable String position, @Nullable String authority) {
this.id = id; this.id = id;
this.username = username;
this.name = name;
this.photo = photo;
this.position = position; this.position = position;
this.authority = authority;
} }
@Nullable @Nullable
public String getPosition() { public Integer getId() {
return position; return id;
} }
public void setPosition(@Nullable String position) { public void setId(@Nullable Integer id) {
this.position = position; this.id = id;
} }
@Nullable @Nullable
@ -52,6 +57,15 @@ public class UserEntity {
this.username = username; this.username = username;
} }
@Nullable
public String getName() {
return name;
}
public void setName(@Nullable String name) {
this.name = name;
}
@Nullable @Nullable
public String getPhoto() { public String getPhoto() {
return photo; return photo;
@ -62,21 +76,20 @@ public class UserEntity {
} }
@Nullable @Nullable
public Long getLastVisit() { public String getPosition() {
return lastVisit; return position;
} }
public void setLastVisit(@Nullable Long lastVisit) { public void setPosition(@Nullable String position) {
this.lastVisit = lastVisit; this.position = position;
} }
@Nullable @Nullable
public Integer getId() { public String getAuthority() {
return id; return authority;
} }
public void setId(@Nullable Integer id) { public void setAuthority(@Nullable String authority) {
this.id = id; this.authority = authority;
} }
} }

View File

@ -10,7 +10,7 @@ import ru.myitschool.work.domain.entities.Status;
public interface SignUserRepository { public interface SignUserRepository {
void getUserByUsername(@NonNull String username, Consumer<Status<UserEntity>> callback); void getUserByUsername(@NonNull String username, Consumer<Status<UserEntity>> callback);
void isExistUser(@NonNull String login, Consumer<Status<Void>> callback); void isExistUser(@NonNull String username, Consumer<Status<Void>> callback);
void login( void login(
@NonNull String username, @NonNull String username,

View File

@ -56,9 +56,12 @@ public class HistoryAdapter extends RecyclerView.Adapter<HistoryAdapter.ViewHold
} }
public void bind(HistoryEntity item) { public void bind(HistoryEntity item) {
binding.time.setText(item.getTime().toString().substring(0, 10) + " " //binding.time.setText(item.getTime().toString().substring(0, 10) + " "
+ item.getTime().toString().substring(11, 16)); //+ item.getTime().toString().substring(11, 16));
binding.nameReader.setText(item.getType()); //binding.nameReader.setText(item.getType());
binding.time.setText(item.getTime());
binding.code.setText(item.getCode().toString());
binding.type.setText(item.getType());
/*if (item.getType() == 1){ /*if (item.getType() == 1){
binding.type.setText("QR-code"); binding.type.setText("QR-code");
} }

View File

@ -59,12 +59,13 @@ public class InformationFragment extends Fragment {
//sharedPreferences = getContext().getSharedPreferences(getString(R.string.app_name), Context.MODE_PRIVATE); //sharedPreferences = getContext().getSharedPreferences(getString(R.string.app_name), Context.MODE_PRIVATE);
preferenceManager = new PreferenceManager(this.getContext()); preferenceManager = new PreferenceManager(this.getContext());
username = preferenceManager.getString(Constants.KEY_USER_USERNAME); username = preferenceManager.getString(Constants.KEY_USER_USERNAME);
Toast.makeText(getContext(), username, Toast.LENGTH_SHORT).show();
viewModel = new ViewModelProvider(this).get(InformationViewModel.class); viewModel = new ViewModelProvider(this).get(InformationViewModel.class);
//getInformation(); //getInformation();
binding.scan.setOnClickListener(view1 -> { // binding.scan.setOnClickListener(view1 -> {
onClickScan(view); // onClickScan(view);
}); // });
binding.logout.setOnClickListener(view2 -> { binding.logout.setOnClickListener(view2 -> {
onClickLogout(view); onClickLogout(view);
@ -120,8 +121,9 @@ public class InformationFragment extends Fragment {
binding.loading.setVisibility(Utils.visibleOrGone(loadingHistory)); //binding.loading.setVisibility(Utils.visibleOrGone(loadingHistory));
if (state.isLoading() == false) { if (state.isLoading() == false) {
binding.refreshLayout.setRefreshing(false);
if (state.getItemsHistory() != null) { if (state.getItemsHistory() != null) {
history = state.getItemsHistory(); history = state.getItemsHistory();
@ -138,12 +140,12 @@ public class InformationFragment extends Fragment {
historyAdapter.updateData(history); historyAdapter.updateData(history);
historyAdapter.notifyDataSetChanged(); historyAdapter.notifyDataSetChanged();
binding.refreshLayout.setRefreshing(false); binding.refreshLayout.setRefreshing(false);
} else {
Toast.makeText(this.getContext(), "Error", Toast.LENGTH_SHORT).show();
takeError();
} }
} else {
Toast.makeText(this.getContext(), "Error", Toast.LENGTH_SHORT).show();
takeError();
} }
binding.refreshLayout.setRefreshing(false); //binding.refreshLayout.setRefreshing(false);
}); });
/* /*
viewModel.stateHistoryLiveData.observe(getViewLifecycleOwner(), state -> { viewModel.stateHistoryLiveData.observe(getViewLifecycleOwner(), state -> {
@ -250,7 +252,7 @@ public class InformationFragment extends Fragment {
binding.lastEntry.setVisibility(View.GONE); binding.lastEntry.setVisibility(View.GONE);
binding.position.setVisibility(View.GONE); binding.position.setVisibility(View.GONE);
//binding.logout.setVisibility(View.GONE); //binding.logout.setVisibility(View.GONE);
binding.scan.setVisibility(View.GONE); //binding.scan.setVisibility(View.GONE);
binding.error.setVisibility(View.VISIBLE); binding.error.setVisibility(View.VISIBLE);
binding.refreshLayout.setRefreshing(false); binding.refreshLayout.setRefreshing(false);

View File

@ -35,11 +35,11 @@ public class InformationViewModel extends ViewModel {
private String username; private String username;
public void changeSelectedUsername(@NonNull String username) { public void changeSelectedUsername(@NonNull String username) {
this.username = this.username; this.username = username;
} }
public void load() { public void load() {
mutableStateAllUserHistoryLiveData.setValue(new InformationViewModel.State(null, null, false)); mutableStateAllUserHistoryLiveData.setValue(new InformationViewModel.State(null, null, true));
getHistById(); getHistById();
/*getAllUserHistoryUseCase.execute(username, status -> { /*getAllUserHistoryUseCase.execute(username, status -> {
mutableStateHistoryLiveData.postValue(fromStatus(status)); mutableStateHistoryLiveData.postValue(fromStatus(status));

View File

@ -23,10 +23,10 @@ import retrofit2.Response;
import retrofit2.Retrofit; import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory; import retrofit2.converter.gson.GsonConverterFactory;
import ru.myitschool.work.R; import ru.myitschool.work.R;
import ru.myitschool.work.core.Constants;
import ru.myitschool.work.databinding.FragmentLoginBinding; import ru.myitschool.work.databinding.FragmentLoginBinding;
import ru.myitschool.work.ui.StoreAPI; import ru.myitschool.work.ui.StoreAPI;
import ru.myitschool.work.ui.login.LoginViewModel; import ru.myitschool.work.ui.login.LoginViewModel;
import ru.myitschool.work.utils.Constants;
import ru.myitschool.work.utils.OnChangeText; import ru.myitschool.work.utils.OnChangeText;
import ru.myitschool.work.utils.PreferenceManager; import ru.myitschool.work.utils.PreferenceManager;
@ -135,7 +135,7 @@ public class LoginFragment extends Fragment {
subscribe(viewModel); subscribe(viewModel);
} }
private void onClickLogin(View view) { /*private void onClickLogin(View view) {
Retrofit retrofit = new Retrofit.Builder() Retrofit retrofit = new Retrofit.Builder()
.baseUrl(Constants.SERVER_ADDRESS) .baseUrl(Constants.SERVER_ADDRESS)
.addConverterFactory(GsonConverterFactory.create()) .addConverterFactory(GsonConverterFactory.create())
@ -171,7 +171,7 @@ public class LoginFragment extends Fragment {
binding.error.setVisibility(View.VISIBLE); binding.error.setVisibility(View.VISIBLE);
} }
}); });
} }*/
private void subscribe(LoginViewModel viewModel) { private void subscribe(LoginViewModel viewModel) {
viewModel.errorLiveData.observe(getViewLifecycleOwner(), error -> { viewModel.errorLiveData.observe(getViewLifecycleOwner(), error -> {
@ -184,8 +184,10 @@ public class LoginFragment extends Fragment {
});*/ });*/
viewModel.openListLiveData.observe(getViewLifecycleOwner(), username -> { viewModel.openListLiveData.observe(getViewLifecycleOwner(), username -> {
final View view = getView(); final View view = getView();
Toast.makeText(getContext(), "FFFFFFFFF", Toast.LENGTH_SHORT).show();
if (view == null) return; if (view == null) return;
preferenceManager.putString(ru.myitschool.work.utils.Constants.KEY_USER_USERNAME, username); preferenceManager.putString(Constants.KEY_USER_USERNAME, username);
preferenceManager.putString(Constants.KEY_USER_ROLE, username);
view.getRootView().findViewById(R.id.nav_view).setVisibility(View.VISIBLE); view.getRootView().findViewById(R.id.nav_view).setVisibility(View.VISIBLE);
Navigation.findNavController(view).navigate(R.id.action_loginFragment_to_informationFragment); Navigation.findNavController(view).navigate(R.id.action_loginFragment_to_informationFragment);
}); });

View File

@ -59,11 +59,12 @@ public class LoginViewModel extends ViewModel {
} }
public void confirm() { public void confirm() {
if (userCheckCompleted) { loginUser(username, password);
/*if (userCheckCompleted) {
checkAuth(); checkAuth();
} else { } else {
checkUserExist(); checkUserExist();
} }*/
} }
@ -72,14 +73,17 @@ public class LoginViewModel extends ViewModel {
final String currentPassword = password; final String currentPassword = password;
if (currentPassword == null || currentPassword.isEmpty()) { if (currentPassword == null || currentPassword.isEmpty()) {
mutableErrorLiveData.postValue("Password cannot be null"); mutableErrorLiveData.postValue("Password cannot be null");
userCheckCompleted = false;
return; return;
} }
if (currentUsername == null || currentUsername.isEmpty()) { if (currentUsername == null || currentUsername.isEmpty()) {
mutableErrorLiveData.postValue("Login cannot be null"); mutableErrorLiveData.postValue("Login cannot be null");
userCheckCompleted = false;
return; return;
} }
if (!isAccountExist) { if (!isAccountExist) {
mutableErrorLiveData.postValue("This user not exist"); mutableErrorLiveData.postValue("This user not exist");
userCheckCompleted = false;
return; return;
/*createUserUseCase.execute(currentUsername, currentPassword, status -> { /*createUserUseCase.execute(currentUsername, currentPassword, status -> {
if (status.getStatusCode() == 201 && status.getErrors() == null) { if (status.getStatusCode() == 201 && status.getErrors() == null) {
@ -101,6 +105,7 @@ public class LoginViewModel extends ViewModel {
mutableOpenListLiveData.postValue(currentUsername); mutableOpenListLiveData.postValue(currentUsername);
} else { } else {
mutableErrorLiveData.postValue("Something wrong"); mutableErrorLiveData.postValue("Something wrong");
userCheckCompleted = false;
} }
}); });
} }
@ -109,12 +114,14 @@ public class LoginViewModel extends ViewModel {
final String currentUsername = username; final String currentUsername = username;
if (currentUsername == null || currentUsername.isEmpty()) { if (currentUsername == null || currentUsername.isEmpty()) {
mutableErrorLiveData.postValue("Login cannot be null"); mutableErrorLiveData.postValue("Login cannot be null");
userCheckCompleted = false;
return; return;
} }
isUserExistUseCase.execute(currentUsername, status -> { isUserExistUseCase.execute(currentUsername, status -> {
if (status.getErrors() != null) { if (status.getErrors() != null) {
//Log.d("tagg", status.getErrors().toString()); //Log.d("tagg", status.getErrors().toString());
mutableErrorLiveData.postValue("Something wrong. Try later =(" + status.getErrors()); mutableErrorLiveData.postValue("Something wrong. Try later =(" + status.getErrors());
userCheckCompleted = false;
return; return;
} }
userCheckCompleted = true; userCheckCompleted = true;

View File

@ -40,7 +40,7 @@ public class ProfileFragment extends Fragment {
binding.username.setText(userEntity.getUsername()); binding.username.setText(userEntity.getUsername());
binding.position.setText(userEntity.getPosition()); binding.position.setText(userEntity.getPosition());
binding.lastTime.setText(userEntity.getLastVisit().toString()); binding.lastTime.setText(userEntity.getName());
}); });

View File

@ -24,9 +24,9 @@ public class ProfileViewModel extends ViewModel {
UserRepositoryImpl.getInstance() UserRepositoryImpl.getInstance()
); );
public final GetAllUserHistoryUseCase getAllUserHistoryListUseCase = new GetAllUserHistoryUseCase( /*public final GetAllUserHistoryUseCase getAllUserHistoryListUseCase = new GetAllUserHistoryUseCase(
UserRepositoryImpl.getInstance() UserRepositoryImpl.getInstance()
); );*/
private final IsUserExistUseCase isUserExistUseCase = new IsUserExistUseCase( private final IsUserExistUseCase isUserExistUseCase = new IsUserExistUseCase(
UserRepositoryImpl.getInstance() UserRepositoryImpl.getInstance()
); );

View File

@ -3,6 +3,8 @@ package ru.myitschool.work.utils;
public class Constants { public class Constants {
public static final String KEY_PREFERENCE_NAME = "App"; public static final String KEY_PREFERENCE_NAME = "App";
public static final String KEY_USER_USERNAME = "userUsername"; public static final String KEY_USER_USERNAME = "userUsername";
public static final String KEY_USER_ROLE = "userRole";
public static final String KEY_USER_BLOCKED = "userBlocked";
public static String KEY_LOGIN = "login"; public static String KEY_LOGIN = "login";
public static String KEY_RESULT = "result"; public static String KEY_RESULT = "result";
} }

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/refresh_layout" android:id="@+id/refresh_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -51,50 +52,36 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/> app:layout_constraintEnd_toEndOf="parent"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/refresh"
android:text="@string/refresh"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/logout"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/scan"
android:text="@string/scan"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/refresh"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<TextView <TextView
android:id="@+id/error" android:id="@+id/error"
android:visibility="gone" android:visibility="gone"
android:text="@string/error" android:text="@string/error"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/scan" app:layout_constraintTop_toBottomOf="@id/logout"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/> app:layout_constraintEnd_toEndOf="parent"/>
<androidx.recyclerview.widget.RecyclerView <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="0dp"
android:id="@+id/historylist" app:layout_constraintTop_toBottomOf="@id/error"
android:layout_gravity="center" app:layout_constraintStart_toStartOf="parent"
/>
<ProgressBar
android:id="@+id/loading"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"/> app:layout_constraintBottom_toBottomOf="parent">
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="0dp"
android:id="@+id/historylist"
tools:listitem="@layout/item_history"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintTop_toBottomOf="@id/error"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,39 +1,79 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<TextView <LinearLayout
android:id="@+id/time" android:id="@+id/layout_time"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp" android:orientation="horizontal"
app:layout_constraintBottom_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toEndOf="parent" app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toTopOf="parent"
android:tag="iuroi"/>
<TextView <TextView
android:id="@+id/nameReader" android:layout_width="wrap_content"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textSize="16sp"
android:text="@string/time"/>
<TextView
android:id="@+id/time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:text="iuroxsssssi"/>
</LinearLayout>
<LinearLayout
android:id="@+id/layout_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp" android:orientation="horizontal"
android:text="kijt" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/time" app:layout_constraintTop_toBottomOf="@id/layout_time">
app:layout_constraintStart_toEndOf="@id/time"
app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/type" android:layout_width="wrap_content"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textSize="16sp"
android:text="@string/code"/>
<TextView
android:id="@+id/code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:text="iuroxsssssi"/>
</LinearLayout>
<LinearLayout
android:id="@+id/layout_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp" android:orientation="horizontal"
android:text="hgfdfbjdhf" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/time" app:layout_constraintTop_toBottomOf="@id/layout_code">
app:layout_constraintStart_toEndOf="@id/nameReader"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textSize="16sp"
android:text="@string/type"/>
<TextView
android:id="@+id/type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="24dp"
android:text="iuroxsssssi"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -12,4 +12,8 @@
<string name="cancelled">Operation was cancelled</string> <string name="cancelled">Operation was cancelled</string>
<string name="success">Success</string> <string name="success">Success</string>
<string name="wrong">Something wrong</string> <string name="wrong">Something wrong</string>
<string name="time">Time:</string>
<string name="type">Enter type:</string>
<string name="code">Identificator:</string>
</resources> </resources>

View File

@ -12,4 +12,7 @@
<string name="cancelled">Вход был отменён</string> <string name="cancelled">Вход был отменён</string>
<string name="success">Успешно</string> <string name="success">Успешно</string>
<string name="wrong">Что-то пошло не так</string> <string name="wrong">Что-то пошло не так</string>
<string name="time">Время:</string>
<string name="type">Тип прохода:</string>
<string name="code">Идентификатор:</string>
</resources> </resources>

View File

@ -12,4 +12,8 @@
<string name="cancelled">Вход был отменён</string> <string name="cancelled">Вход был отменён</string>
<string name="success">Успешно</string> <string name="success">Успешно</string>
<string name="wrong">Что-то пошло не так</string> <string name="wrong">Что-то пошло не так</string>
<string name="time">Время:</string>
<string name="type">Тип прохода:</string>
<string name="code">Идентификатор:</string>
</resources> </resources>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="close_button">Close</string> <string name="close_button" translatable="false">Close</string>
</resources> </resources>