Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fun HomeContent(
title = stringResource(id = R.string.tudee),
subTitle = stringResource(id = R.string.your_cute_helper_for_every_task),
showSnackbar = uiState.showSnackbar,
snackbarMessage = uiState.snackbarMessage,
snackbarMessage = stringResource(uiState.snackbarMessageId),
snackbarIcon = if (uiState.showSnackbar) painterResource(id = R.drawable.ic_checkmark_badge) else null,
onSnackbarDismiss = { interactionListener.onSnackbarDismissed() }
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.moscow.tudee.presentation.screen.home

import com.moscow.tudee.R
import com.moscow.tudee.presentation.model.CategoryUi
import com.moscow.tudee.presentation.model.TaskUi

Expand All @@ -21,7 +22,7 @@ data class HomeState(
val showTaskDetailsBottomSheet: Boolean = false,
val formattedDate: String? = null,
val showSnackbar: Boolean = false,
val snackbarMessage: String = ""
val snackbarMessageId: Int = R.string.add_task_successfully
) {
enum class SliderState {
STAY_WORKING,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.moscow.tudee.presentation.screen.home

import com.moscow.tudee.R
import com.moscow.tudee.domain.entity.Task
import com.moscow.tudee.domain.entity.Task.Status
import com.moscow.tudee.domain.service.CategoryServices
Expand Down Expand Up @@ -141,7 +142,7 @@ class HomeViewModel(
showAddTaskBottomSheet = false,
addedTask = null,
showSnackbar = true,
snackbarMessage = "Task added successfully!"
snackbarMessageId = R.string.add_task_successfully
)
}
},
Expand Down Expand Up @@ -232,7 +233,7 @@ class HomeViewModel(
selectedTask = it.addedTask,
addedTask = null,
showSnackbar = true,
snackbarMessage = "Task updated successfully!"
snackbarMessageId = R.string.edited_task_successfully
)
}
},
Expand Down Expand Up @@ -289,19 +290,13 @@ class HomeViewModel(

override fun onShowSnackbar(message: String) {
updateState {
it.copy(
showSnackbar = true,
snackbarMessage = message
)
it.copy(showSnackbar = true)
}
}

override fun onSnackbarDismissed() {
updateState {
it.copy(
showSnackbar = false,
snackbarMessage = ""
)
it.copy(showSnackbar = false)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyHorizontalGrid
import androidx.compose.foundation.lazy.grid.items
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -43,8 +39,7 @@ fun TaskListHeader(
modifier
.fillMaxWidth()
.padding(horizontal = 16.dp)
.padding(top = 24.dp, bottom = 8.dp),
horizontalArrangement = Arrangement.Absolute.SpaceBetween
.padding(top = 24.dp, bottom = 8.dp)
) {
TudeeText(
text = when (taskState) {
Expand All @@ -54,6 +49,7 @@ fun TaskListHeader(
},
style = Theme.textStyle.title.large.copy(color = Theme.colors.title),
)
Spacer(modifier = Modifier.weight(1f))
TaskListCount(taskCount, onCountClick)

}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/drawable/ic_right_arrow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
android:width="12dp"
android:height="12dp"
android:viewportWidth="12"
android:viewportHeight="12">
android:viewportHeight="12"
android:autoMirrored="true">
<path
android:pathData="M10.438,6.001C10.438,5.739 10.303,5.542 10.157,5.388C10.021,5.246 9.806,5.077 9.587,4.905L9.081,4.505C8.709,4.213 8.399,3.968 8.14,3.818C7.88,3.667 7.56,3.544 7.228,3.691C6.888,3.842 6.777,4.168 6.732,4.461C6.69,4.73 6.688,5.084 6.688,5.5L2.063,5.5C1.786,5.5 1.563,5.724 1.563,6C1.563,6.276 1.786,6.5 2.063,6.5L6.688,6.5C6.688,6.917 6.69,7.272 6.732,7.54C6.777,7.834 6.888,8.16 7.228,8.311C7.56,8.457 7.88,8.335 8.14,8.184C8.399,8.034 8.709,7.789 9.081,7.497L9.587,7.097C9.806,6.925 10.021,6.756 10.157,6.613C10.303,6.46 10.438,6.264 10.438,6.001Z"
android:fillColor="#1F1F1F"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<string name="right_arrow">سهم يمين</string>
<string name="done">مكتمل</string>
<string name="in_progress_status">قيد التنفيذ</string>
<string name="to_do">مهام معلقة</string>
<string name="to_do">مهام معلقه</string>
<string name="today">اليوم، %1$s</string>
<string name="delete_item">حذف العنصر</string>
<string name="splash_background">خلفية البداية</string>
Expand Down
Loading