Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,6 @@ private fun OptimizeStateReadsBefore() {
124
124
painterResource(id = android.R .drawable.star_on),
125
125
contentDescription = null ,
126
126
// [END_EXCLUDE]
127
- // ..
128
127
// Non-optimal implementation!
129
128
Modifier .offset(
130
129
with (LocalDensity .current) {
@@ -134,10 +133,10 @@ private fun OptimizeStateReadsBefore() {
134
133
)
135
134
)
136
135
137
- LazyColumn (state = listState)
138
- // [START_EXCLUDE]
139
- {}
140
- // [END_EXCLUDE]
136
+ LazyColumn (state = listState) {
137
+ // [START_EXCLUDE]
138
+ // [END_EXCLUDE]
139
+ }
141
140
}
142
141
// [END android_compose_phases_optimize_state_reads_before]
143
142
}
@@ -153,18 +152,17 @@ private fun OptimizeStateReadsAfter() {
153
152
painterResource(id = android.R .drawable.star_on),
154
153
contentDescription = null ,
155
154
// [END_EXCLUDE]
156
- // ..
157
155
// Non-optimal implementation!
158
156
Modifier .offset {
159
157
// State read of firstVisibleItemScrollOffset in Layout
160
158
IntOffset (x = 0 , y = listState.firstVisibleItemScrollOffset / 2 )
161
159
}
162
160
)
163
161
164
- LazyColumn (state = listState)
165
- // [START_EXCLUDE]
166
- {}
167
- // [END_EXCLUDE]
162
+ LazyColumn (state = listState) {
163
+ // [START_EXCLUDE]
164
+ // [END_EXCLUDE]
165
+ }
168
166
}
169
167
// [END android_compose_phases_optimize_state_reads_after]
170
168
}
0 commit comments