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
298 changes: 298 additions & 0 deletions foliary/src/commonMain/composeResources/drawable/today_celebration.xml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions foliary/src/commonMain/composeResources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
<string name="today_empty_title">No tasks</string>
<string name="today_empty_description">You don't have any tasks for today. Feel free to take a break or click on the button below to create a new task.</string>
<string name="today_empty_button">Create a new task</string>
<string name="today_celebration_title">You did it!</string>
<string name="today_celebration_description">You have completed every task planned for today and thats outstanding! It's time to celebrate!</string>
<string name="today_celebration_button">Create a new task</string>
<string name="today_completed_header">Completed today (%1$d)</string>
<string name="today_completed_header_a11y">Toggle completed tasks</string>
<!-- endregion -->

<!-- region Create Task -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.appoutlet.foliary.core.ui.component.modifier

import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand All @@ -12,7 +13,11 @@ import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.dp

val FoliaryShadowColorDefault: Color
@Composable get() = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.1f)
@Composable get() = if (isSystemInDarkTheme()) {
MaterialTheme.colorScheme.surface.copy(alpha = 0.5f)
} else {
MaterialTheme.colorScheme.onBackground.copy(alpha = 0.1f)
}

@Composable
fun Modifier.foliaryShadow(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.testTag
Expand Down Expand Up @@ -46,7 +45,7 @@ fun FoliaryTextField(
visualTransformation: VisualTransformation = VisualTransformation.None,
onTextLayout: (TextLayoutResult) -> Unit = {},
interactionSource: MutableInteractionSource? = null,
cursorBrush: Brush = SolidColor(Color.Black),
cursorBrush: Brush = SolidColor(MaterialTheme.colorScheme.onSurface),
) {
val placeholderAlpha by animateFloatAsState(targetValue = if (value.isBlank()) 1f else 0f)

Expand All @@ -56,7 +55,7 @@ fun FoliaryTextField(
modifier = modifier,
enabled = enabled,
readOnly = readOnly,
textStyle = textStyle,
textStyle = textStyle.copy(color = MaterialTheme.colorScheme.onSurface),
keyboardOptions = keyboardOptions,
keyboardActions = keyboardActions,
singleLine = singleLine,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ val primaryDark = Color(0xFF00E796)
val onPrimaryDark = Color(0xFF00382A)
val primaryContainerDark = Color(0xFF1D5643)
val onPrimaryContainerDark = Color(0xFFB9E6D3)
val secondaryDark = Color(0xFF1F6F6E)
val secondaryDark = Color(0xFF16504f)
val onSecondaryDark = Color(0xFFF4FFFB)
val secondaryContainerDark = Color(0xFF35473C)
val onSecondaryContainerDark = Color(0xFFD2E4D9)
Expand All @@ -53,10 +53,10 @@ val errorDark = Color(0xFFFFB4AB)
val onErrorDark = Color(0xFF690005)
val errorContainerDark = Color(0xFF93000A)
val onErrorContainerDark = Color(0xFFFFDAD6)
val backgroundDark = Color(0xFF2B3228)
val onBackgroundDark = Color(0xFFE4E2DD)
val surfaceDark = Color(0xFF1B1F19)
val onSurfaceDark = Color(0xFFE5E2E1)
val backgroundDark = Color(0xFF1B1F19)
val onBackgroundDark = Color(0xFFb6b3af)
val surfaceDark = Color(0xFF141712)
val onSurfaceDark = Color(0xFFf3f2f1)
val surfaceVariantDark = Color(0xFF404945)
val onSurfaceVariantDark = Color(0xFFC0C9C3)
val outlineDark = Color(0x1FFFFFFF)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ class TaskRepositoryImpl(
private val timeProvider: TimeProvider,
) : TaskRepository {
override fun findTodayTasks(): Flow<List<Task>> {
val startOfToday = timeProvider.startOfToday()
val endOfToday = timeProvider.endOfToday()
return taskDao.findTodayTasks(endOfToday)
return taskDao.findTodayTasks(startOfToday, endOfToday)
}

override fun observeById(id: Uuid) = taskDao.observeById(id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ interface TaskDao {
"""
SELECT *
FROM Task
WHERE (dueDate <= :endOfToday OR dueDate IS NULL)
AND completionDate IS NULL
WHERE (completionDate IS NULL AND (dueDate <= :endOfToday OR dueDate IS NULL))
OR (completionDate IS NOT NULL AND completionDate >= :startOfToday AND completionDate <= :endOfToday)
ORDER BY dueDate IS NULL, dueDate ASC
"""
)
fun findTodayTasks(endOfToday: Instant): Flow<List<Task>>
fun findTodayTasks(startOfToday: Instant, endOfToday: Instant): Flow<List<Task>>
}
Loading
Loading