Implement the dialog to add a new shopping list (#280)

* Add endpoint to create new shopping lists

* Initialize editing of lists names

* Implement adding new lists

* Fix invalid password for demo

* Use StateFlow to avoid lost state updates

* Refactor the list update to support empty lists

* Hide add new list button if there's a new list

* Scroll to the newly added list or item

* Replace deprecated Divider

* Move new field name input to dialog

* Display a modal dialog instead of bottom sheet

* Reduce unnecessary recompositions

* Do not hide button since it is overlapped by dialog

* Extract Composable for editable items

* Remove unused imports

* Add UI for removing and editing shopping lists

* Implement editing list name and removing lists

* Fix initial cursor state when editing name

* Add capitalization of list names

* Fix color of divider in dark mode
This commit is contained in:
Kirill Kamakin
2024-07-27 20:12:00 +02:00
committed by GitHub
parent f0098af3f6
commit 86e70e03d0
22 changed files with 1066 additions and 171 deletions

View File

@@ -7,7 +7,8 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Card
import androidx.compose.material3.Checkbox
import androidx.compose.material3.Divider
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@@ -73,7 +74,9 @@ private fun IngredientListItem(
style = MaterialTheme.typography.titleMedium,
)
Divider()
HorizontalDivider(
color = LocalContentColor.current
)
}
Row(

View File

@@ -5,7 +5,8 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Card
import androidx.compose.material3.Divider
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@@ -86,7 +87,9 @@ private fun InstructionListItem(
)
if (ingredients.isNotEmpty()) {
Divider()
HorizontalDivider(
color = LocalContentColor.current
)
ingredients.forEach { ingredient ->
Text(
text = ingredient.display,

View File

@@ -45,7 +45,7 @@
<string name="fragment_add_recipe_clear_button">Clear</string>
<string name="fragment_base_url_url_input_helper_text">Example: demo.mealie.io</string>
<string name="fragment_authentication_email_input_helper_text">Example: changeme@example.com</string>
<string name="fragment_authentication_password_input_helper_text">Example: demo</string>
<string name="fragment_authentication_password_input_helper_text">Example: MyPassword</string>
<string name="fragment_recipes_last_page_loaded_toast">Last page loaded</string>
<string name="fragment_recipes_load_failure_toast" comment="EXAMPLE: Load error: unauthorized.">Load error: %1$s.</string>
<string name="fragment_recipes_load_failure_toast_no_reason">Load failed.</string>