File tree Expand file tree Collapse file tree 7 files changed +27
-114
lines changed
src/main/java/com/example/android/architecture/blueprints/todoapp Expand file tree Collapse file tree 7 files changed +27
-114
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ android {
81
81
}
82
82
83
83
composeOptions {
84
- kotlinCompilerExtensionVersion " $c omposeVersion "
84
+ kotlinCompilerExtensionVersion " $c omposeCompilerVersion "
85
85
}
86
86
87
87
testOptions {
@@ -142,10 +142,12 @@ dependencies {
142
142
143
143
// Jetpack Compose
144
144
implementation " androidx.activity:activity-compose:$activityComposeVersion "
145
+ implementation " androidx.compose.compiler:compiler:$composeCompilerVersion "
145
146
implementation " androidx.compose.material:material:$composeVersion "
146
147
implementation " androidx.compose.animation:animation:$composeVersion "
147
148
implementation " androidx.compose.ui:ui-tooling-preview:$composeVersion "
148
149
implementation " androidx.navigation:navigation-compose:$navigationVersion "
150
+ implementation " androidx.lifecycle:lifecycle-runtime-compose:$archLifecycleVersion "
149
151
implementation " androidx.lifecycle:lifecycle-viewmodel-compose:$archLifecycleVersion "
150
152
implementation " com.google.accompanist:accompanist-appcompat-theme:$accompanistVersion "
151
153
implementation " com.google.accompanist:accompanist-swiperefresh:$accompanistVersion "
Original file line number Diff line number Diff line change @@ -45,12 +45,14 @@ import androidx.compose.ui.res.stringResource
45
45
import androidx.compose.ui.text.font.FontWeight
46
46
import androidx.compose.ui.unit.dp
47
47
import androidx.hilt.navigation.compose.hiltViewModel
48
+ import androidx.lifecycle.compose.ExperimentalLifecycleComposeApi
49
+ import androidx.lifecycle.compose.collectAsStateWithLifecycle
48
50
import com.example.android.architecture.blueprints.todoapp.R
49
51
import com.example.android.architecture.blueprints.todoapp.util.AddEditTaskTopAppBar
50
- import com.example.android.architecture.blueprints.todoapp.util.collectAsStateWithLifecycle
51
52
import com.google.accompanist.swiperefresh.SwipeRefresh
52
53
import com.google.accompanist.swiperefresh.rememberSwipeRefreshState
53
54
55
+ @OptIn(ExperimentalLifecycleComposeApi ::class )
54
56
@Composable
55
57
fun AddEditTaskScreen (
56
58
@StringRes topBarTitle : Int ,
Original file line number Diff line number Diff line change @@ -33,12 +33,14 @@ import androidx.compose.ui.res.dimensionResource
33
33
import androidx.compose.ui.res.stringResource
34
34
import androidx.compose.ui.tooling.preview.Preview
35
35
import androidx.hilt.navigation.compose.hiltViewModel
36
+ import androidx.lifecycle.compose.ExperimentalLifecycleComposeApi
37
+ import androidx.lifecycle.compose.collectAsStateWithLifecycle
36
38
import com.example.android.architecture.blueprints.todoapp.R
37
39
import com.example.android.architecture.blueprints.todoapp.util.LoadingContent
38
40
import com.example.android.architecture.blueprints.todoapp.util.StatisticsTopAppBar
39
- import com.example.android.architecture.blueprints.todoapp.util.collectAsStateWithLifecycle
40
41
import com.google.accompanist.appcompattheme.AppCompatTheme
41
42
43
+ @OptIn(ExperimentalLifecycleComposeApi ::class )
42
44
@Composable
43
45
fun StatisticsScreen (
44
46
openDrawer : () -> Unit ,
@@ -95,7 +97,12 @@ private fun StatisticsContent(
95
97
) {
96
98
if (! loading) {
97
99
Text (stringResource(id = R .string.statistics_active_tasks, activeTasksPercent))
98
- Text (stringResource(id = R .string.statistics_completed_tasks, completedTasksPercent))
100
+ Text (
101
+ stringResource(
102
+ id = R .string.statistics_completed_tasks,
103
+ completedTasksPercent
104
+ )
105
+ )
99
106
}
100
107
}
101
108
}
Original file line number Diff line number Diff line change @@ -41,13 +41,15 @@ import androidx.compose.ui.res.dimensionResource
41
41
import androidx.compose.ui.res.stringResource
42
42
import androidx.compose.ui.tooling.preview.Preview
43
43
import androidx.hilt.navigation.compose.hiltViewModel
44
+ import androidx.lifecycle.compose.ExperimentalLifecycleComposeApi
45
+ import androidx.lifecycle.compose.collectAsStateWithLifecycle
44
46
import com.example.android.architecture.blueprints.todoapp.R
45
47
import com.example.android.architecture.blueprints.todoapp.data.Task
46
48
import com.example.android.architecture.blueprints.todoapp.util.LoadingContent
47
49
import com.example.android.architecture.blueprints.todoapp.util.TaskDetailTopAppBar
48
- import com.example.android.architecture.blueprints.todoapp.util.collectAsStateWithLifecycle
49
50
import com.google.accompanist.appcompattheme.AppCompatTheme
50
51
52
+ @OptIn(ExperimentalLifecycleComposeApi ::class )
51
53
@Composable
52
54
fun TaskDetailScreen (
53
55
onEditTask : (String ) -> Unit ,
Original file line number Diff line number Diff line change @@ -53,16 +53,18 @@ import androidx.compose.ui.text.style.TextDecoration
53
53
import androidx.compose.ui.tooling.preview.Preview
54
54
import androidx.compose.ui.unit.dp
55
55
import androidx.hilt.navigation.compose.hiltViewModel
56
+ import androidx.lifecycle.compose.ExperimentalLifecycleComposeApi
57
+ import androidx.lifecycle.compose.collectAsStateWithLifecycle
56
58
import com.example.android.architecture.blueprints.todoapp.R
57
59
import com.example.android.architecture.blueprints.todoapp.data.Task
58
60
import com.example.android.architecture.blueprints.todoapp.tasks.TasksFilterType.ACTIVE_TASKS
59
61
import com.example.android.architecture.blueprints.todoapp.tasks.TasksFilterType.ALL_TASKS
60
62
import com.example.android.architecture.blueprints.todoapp.tasks.TasksFilterType.COMPLETED_TASKS
61
63
import com.example.android.architecture.blueprints.todoapp.util.LoadingContent
62
64
import com.example.android.architecture.blueprints.todoapp.util.TasksTopAppBar
63
- import com.example.android.architecture.blueprints.todoapp.util.collectAsStateWithLifecycle
64
65
import com.google.accompanist.appcompattheme.AppCompatTheme
65
66
67
+ @OptIn(ExperimentalLifecycleComposeApi ::class )
66
68
@Composable
67
69
fun TasksScreen (
68
70
@StringRes userMessage : Int ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
buildscript {
2
- ext. kotlinVersion = ' 1.6.10 '
3
- ext. navigationVersion = ' 2.4.2 '
2
+ ext. kotlinVersion = ' 1.7.0 '
3
+ ext. navigationVersion = ' 2.5.0 '
4
4
ext. ktlintVersion = ' 0.44.0'
5
5
ext. hiltVersion = ' 2.42'
6
6
@@ -9,7 +9,7 @@ buildscript {
9
9
mavenCentral()
10
10
}
11
11
dependencies {
12
- classpath ' com.android.tools.build:gradle:7.3.0-beta01 '
12
+ classpath ' com.android.tools.build:gradle:7.3.0-beta05 '
13
13
classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion "
14
14
classpath " androidx.navigation:navigation-safe-args-gradle-plugin:$navigationVersion "
15
15
classpath " com.google.dagger:hilt-android-gradle-plugin:$hiltVersion "
62
62
androidXTestExtKotlinRunnerVersion = ' 1.1.4-alpha06'
63
63
androidXTestRulesVersion = ' 1.4.1-alpha06'
64
64
androidXAnnotations = ' 1.3.0'
65
- archLifecycleVersion = ' 2.5 .0-rc01 '
65
+ archLifecycleVersion = ' 2.6 .0-alpha01 '
66
66
archTestingVersion = ' 2.1.0'
67
- composeVersion = ' 1.1.1'
67
+ composeVersion = ' 1.2.0'
68
+ composeCompilerVersion = ' 1.2.0'
68
69
coroutinesVersion = ' 1.6.1'
69
70
dexMakerVersion = ' 2.12.1'
70
71
espressoVersion = ' 3.5.0-alpha06'
You can’t perform that action at this time.
0 commit comments