Skip to content

Commit b76959c

Browse files
committedFeb 22, 2021
center circular indicator
1 parent 1d0109c commit b76959c

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed
 

‎.idea/misc.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ dependencies {
6161
implementation "androidx.compose.ui:ui:$compose_version"
6262
implementation "androidx.compose.material:material:$compose_version"
6363
implementation "androidx.compose.ui:ui-tooling:$compose_version"
64+
implementation "androidx.compose.runtime:runtime:$compose_version"
6465
implementation "androidx.ui:ui-tooling:1.0.0-alpha07"
6566

6667
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

‎app/src/main/java/com/hoc081098/datastoresample/data/TaskRepositoryImpl.kt

+11-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,17 @@ class TaskRepositoryImpl : TaskRepository {
5959
deadline = parseDate(),
6060
priority = TaskPriority.HIGH,
6161
completed = true,
62-
)
62+
),
63+
Task(
64+
name = "RxDart",
65+
deadline = parseDate("25-12-2020"),
66+
priority = TaskPriority.HIGH,
67+
),
68+
Task(
69+
name = "RxSwift",
70+
deadline = parseDate("01-01-2021"),
71+
priority = TaskPriority.MEDIUM,
72+
),
6373
)
6474
)
6575
}

‎app/src/main/java/com/hoc081098/datastoresample/ui/MainScreen.kt

+12-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import androidx.compose.foundation.layout.Column
66
import androidx.compose.foundation.layout.PaddingValues
77
import androidx.compose.foundation.layout.Row
88
import androidx.compose.foundation.layout.Spacer
9+
import androidx.compose.foundation.layout.fillMaxHeight
10+
import androidx.compose.foundation.layout.fillMaxWidth
911
import androidx.compose.foundation.layout.padding
1012
import androidx.compose.foundation.layout.preferredSize
1113
import androidx.compose.foundation.layout.width
@@ -19,6 +21,7 @@ import androidx.compose.material.Scaffold
1921
import androidx.compose.material.Text
2022
import androidx.compose.material.TopAppBar
2123
import androidx.compose.runtime.Composable
24+
import androidx.compose.ui.Alignment
2225
import androidx.compose.ui.Modifier
2326
import androidx.compose.ui.res.painterResource
2427
import androidx.compose.ui.tooling.preview.Preview
@@ -43,7 +46,15 @@ fun MainScreen(
4346
}
4447
) {
4548
if (state == null) {
46-
CircularProgressIndicator()
49+
Column(
50+
modifier = Modifier
51+
.fillMaxHeight()
52+
.fillMaxWidth(),
53+
verticalArrangement = Arrangement.Center,
54+
horizontalAlignment = Alignment.CenterHorizontally
55+
) {
56+
CircularProgressIndicator()
57+
}
4758
} else {
4859
Column {
4960
MainTasksList(state.tasks)

0 commit comments

Comments
 (0)