Skip to content

Commit 9d77aff

Browse files
authored
Minor clean up (#111)
* replace deprecated method * clean up indentation * fix typo * introduce anon parameter to remove warning * remove explicit type argument * update gradle to alpha03
1 parent 30d399b commit 9d77aff

File tree

6 files changed

+13
-21
lines changed

6 files changed

+13
-21
lines changed

app/src/main/java/com/guru/composecookbook/ui/animation/VisibilityAnimations.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ fun AnimateContentSize() {
167167
Row(modifier = Modifier
168168
.animateContentSize()
169169
.clickable { if (count < 10) count += 3 else count = 1 }) {
170-
(0..count).forEach {
170+
(0..count).forEach { _ ->
171171
Icon(imageVector = Icons.Default.PlayCircleFilled, contentDescription = null)
172172
}
173173
}

app/src/main/java/com/guru/composecookbook/ui/learnwidgets/Layouts.kt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -234,26 +234,17 @@ fun TypeOfBoxs() {
234234
) {
235235
Card(
236236
backgroundColor = green700, elevation = 4.dp, modifier = Modifier
237-
.size(
238-
200
239-
.dp
240-
)
237+
.size(200.dp)
241238
.align(Alignment.TopStart)
242239
) {}
243240
Card(
244241
backgroundColor = green500, elevation = 4.dp, modifier = Modifier
245-
.size(
246-
150
247-
.dp
248-
)
242+
.size(150.dp)
249243
.align(Alignment.Center)
250244
) {}
251245
Card(
252246
backgroundColor = green200, elevation = 4.dp, modifier = Modifier
253-
.size(
254-
100
255-
.dp
256-
)
247+
.size(100.dp)
257248
.align(Alignment.BottomEnd)
258249
) {}
259250
}

app/src/main/java/com/guru/composecookbook/ui/utils/TestTags.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ TestTags {
5757
const val HOME_LAYOUTS_BOX_TOP_CENTER_AND_NO_ALIGN = "home_layouts_box_top_center"
5858

5959
//Constraint layout
60-
const val HOME_LAYOUTS_CONSTRAINT_LAYOUT = "home_layouts_constraint_layou"
60+
const val HOME_LAYOUTS_CONSTRAINT_LAYOUT = "home_layouts_constraint_layout"
6161

6262
/*
6363
* animation screen

buildSrc/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ dependencies {
3636
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10")
3737

3838
// in order to recognize the "plugins" block in the common script
39-
implementation("com.android.tools.build:gradle:7.1.0-alpha02")
39+
implementation("com.android.tools.build:gradle:7.1.0-alpha03")
4040

4141
// in order to recognize the "android" block in the common script
42-
implementation("com.android.tools.build:gradle-api:7.1.0-alpha02")
42+
implementation("com.android.tools.build:gradle-api:7.1.0-alpha03")
4343
}

components/colorpicker/src/main/java/com/guru/composecookbook/colorpicker/ColorPicker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fun ColorPicker(
4545
)
4646
val screenWidth = LocalConfiguration.current.screenWidthDp.dp
4747
val screenWidthInPx = with(LocalDensity.current) { screenWidth.toPx() }
48-
var activeColor by remember { mutableStateOf<Color>(Red) }
48+
var activeColor by remember { mutableStateOf(Red) }
4949

5050
val max = screenWidth - 16.dp
5151
val min = 0.dp

demos/moviesapp/app/src/main/java/com/guru/composecookbook/moviesapp/ui/details/components/SimilarMoviesSection.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import androidx.compose.ui.Modifier
1515
import androidx.compose.ui.draw.clip
1616
import androidx.compose.ui.layout.ContentScale
1717
import androidx.compose.ui.unit.dp
18-
import com.google.accompanist.coil.rememberCoilPainter
18+
import coil.compose.rememberImagePainter
1919
import com.guru.composecookbook.moviesapp.data.db.models.Movie
2020
import com.guru.composecookbook.moviesapp.ui.details.MovieDetailViewModel
2121
import com.guru.composecookbook.theme.typography
@@ -31,8 +31,8 @@ fun SimilarMoviesSection(currentMovie: Movie?, viewModel: MovieDetailViewModel)
3131
items = movies,
3232
itemContent = { movie: Movie ->
3333
Image(
34-
painter = rememberCoilPainter(
35-
request = "https://image.tmdb.org/t/p/w500/${movie.poster_path}"
34+
painter = rememberImagePainter(
35+
data = "https://image.tmdb.org/t/p/w500/${movie.poster_path}"
3636
),
3737
contentDescription = null,
3838
modifier = Modifier
@@ -42,7 +42,8 @@ fun SimilarMoviesSection(currentMovie: Movie?, viewModel: MovieDetailViewModel)
4242
.clip(RoundedCornerShape(12.dp)),
4343
contentScale = ContentScale.Crop
4444
)
45-
})
45+
}
46+
)
4647
}
4748
}
4849
}

0 commit comments

Comments
 (0)