feat(main): 优化空项目提示的显示
This commit is contained in:
parent
31c58b3a03
commit
990f0fd841
2 changed files with 7 additions and 8 deletions
|
|
@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Arrangement
|
|||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.LazyListState
|
||||
|
|
@ -18,6 +19,7 @@ import androidx.compose.ui.Alignment
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import cn.super12138.todo.R
|
||||
import cn.super12138.todo.logic.database.TodoEntity
|
||||
|
|
@ -55,16 +57,13 @@ fun ManagerFragment(
|
|||
) {
|
||||
if (list.isEmpty()) {
|
||||
item {
|
||||
Column(
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = Modifier.fillMaxSize()
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(R.string.tip_no_task),
|
||||
style = MaterialTheme.typography.titleMedium
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
textAlign = TextAlign.Center,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
items(
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<string name="app_name">To Do</string>
|
||||
<string name="page_settings">Settings</string>
|
||||
<string name="action_add_task">Add Task</string>
|
||||
<string name="tip_no_task">There are no tasks to complete at the moment, take a good rest!</string>
|
||||
<string name="tip_no_task">There are no tasks to complete at the moment.\nTake a good rest!</string>
|
||||
<string name="placeholder_add_todo">Task content</string>
|
||||
<string name="action_cancel">Cancel</string>
|
||||
<string name="action_save">Save</string>
|
||||
|
|
|
|||
Loading…
Reference in a new issue