From 198b6415a73f779a171b869d74a83822030230b4 Mon Sep 17 00:00:00 2001 From: alexxk2 Date: Mon, 10 Jul 2023 15:31:32 +0300 Subject: [PATCH] 10.07.2023 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -исправлен баг с back stack, теперь с главного экрана при нажати назад мы больше не возвращаемся в другие фрагменты Tasks: -баг, не переводятся названия стадий тренировки -сделать выбор при нажатии назад(отменить тренировку или нет) поменять кнопку старт на главной с старт на континью --- .../java/com/practice/getup/data/db/dto/WorkoutDto.kt | 10 +++++----- .../java/com/practice/getup/data/timer/dto/StageDto.kt | 1 - .../getup/domain/repositories/StorageRepository.kt | 5 ----- app/src/main/res/navigation/nav_graph.xml | 8 ++++++-- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/practice/getup/data/db/dto/WorkoutDto.kt b/app/src/main/java/com/practice/getup/data/db/dto/WorkoutDto.kt index 8ec9178..6e2ef10 100644 --- a/app/src/main/java/com/practice/getup/data/db/dto/WorkoutDto.kt +++ b/app/src/main/java/com/practice/getup/data/db/dto/WorkoutDto.kt @@ -11,11 +11,11 @@ import kotlinx.parcelize.Parcelize @Entity(tableName = "workout") data class WorkoutDto( @PrimaryKey(autoGenerate = true) val id: Int = 0, - @NonNull @ColumnInfo val name: String, - @NonNull @ColumnInfo("preparing_time") val preparingTime: Int, - @NonNull @ColumnInfo("work_time") val workTime: Int, - @NonNull @ColumnInfo("rest_time") val restTime: Int, - @NonNull @ColumnInfo("number_of_sets") val numberOfSets: Int + @ColumnInfo val name: String, + @ColumnInfo("preparing_time") val preparingTime: Int, + @ColumnInfo("work_time") val workTime: Int, + @ColumnInfo("rest_time") val restTime: Int, + @ColumnInfo("number_of_sets") val numberOfSets: Int ): Parcelable { companion object { diff --git a/app/src/main/java/com/practice/getup/data/timer/dto/StageDto.kt b/app/src/main/java/com/practice/getup/data/timer/dto/StageDto.kt index b3ca551..6c89a72 100644 --- a/app/src/main/java/com/practice/getup/data/timer/dto/StageDto.kt +++ b/app/src/main/java/com/practice/getup/data/timer/dto/StageDto.kt @@ -1,6 +1,5 @@ package com.practice.getup.data.timer.dto -import com.practice.getup.presentation.timer.utils.UiText data class StageDto( val id: String, diff --git a/app/src/main/java/com/practice/getup/domain/repositories/StorageRepository.kt b/app/src/main/java/com/practice/getup/domain/repositories/StorageRepository.kt index 69a9566..54b99ed 100644 --- a/app/src/main/java/com/practice/getup/domain/repositories/StorageRepository.kt +++ b/app/src/main/java/com/practice/getup/domain/repositories/StorageRepository.kt @@ -6,14 +6,9 @@ import kotlinx.coroutines.flow.Flow interface StorageRepository { suspend fun addNewWorkout(workout: Workout) - suspend fun deleteAllWorkouts() - suspend fun deleteWorkout(workout: Workout) - fun getAllWorkouts(): Flow> - suspend fun getWorkout(id: Int): Workout - suspend fun updateWorkout(workout: Workout) } \ No newline at end of file diff --git a/app/src/main/res/navigation/nav_graph.xml b/app/src/main/res/navigation/nav_graph.xml index e0627ca..fde534f 100644 --- a/app/src/main/res/navigation/nav_graph.xml +++ b/app/src/main/res/navigation/nav_graph.xml @@ -30,7 +30,9 @@ app:argType="com.practice.getup.domain.models.Workout" /> + app:destination="@id/mainFragment" + app:popUpTo="@id/mainFragment" + app:popUpToInclusive="true" /> + app:destination="@id/mainFragment" + app:popUpTo="@id/mainFragment" + app:popUpToInclusive="true" />