Skip to content

Commit 3c87cd2

Browse files
committed
[Animation] Fix several issues
- Add more comments - Constant color names are capitalized - Remove unnecessary content descriptions
1 parent 5450462 commit 3c87cd2

File tree

28 files changed

+162
-190
lines changed

28 files changed

+162
-190
lines changed

AnimationCodelab/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Compose Animation Codelab
22

33
This folder contains the source code for the
4-
[Compose Animation](https://codelabs.developers.google.com/codelabs/android-compose-animation)
4+
[Compose Animation](https://developer.android.com/codelabs/android-compose-animation)
55
codelab.
66

77
In this codelab, you will learn how to use some Animation APIs in Jetpack Compose.

AnimationCodelab/build.gradle

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 Google LLC
2+
* Copyright 2021 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ buildscript {
2323
jcenter()
2424
}
2525
dependencies {
26-
classpath 'com.android.tools.build:gradle:7.0.0-alpha06'
26+
classpath 'com.android.tools.build:gradle:7.0.0-alpha07'
2727
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30'
2828
}
2929
}
@@ -32,17 +32,7 @@ allprojects {
3232
repositories {
3333
google()
3434
jcenter()
35-
maven { url 'https://androidx.dev/snapshots/builds/7141639/artifacts/repository' }
36-
}
37-
}
38-
39-
subprojects {
40-
configurations.configureEach {
41-
resolutionStrategy.eachDependency { details ->
42-
if (details.requested.group.startsWith('androidx.compose')) {
43-
details.useVersion compose_version
44-
}
45-
}
35+
maven { url 'https://androidx.dev/snapshots/builds/7154166/artifacts/repository' }
4636
}
4737
}
4838

AnimationCodelab/finished/build.gradle

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 Google LLC
2+
* Copyright 2021 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,16 +19,6 @@ plugins {
1919
id 'kotlin-android'
2020
}
2121

22-
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
23-
kotlinOptions {
24-
jvmTarget = "1.8"
25-
freeCompilerArgs += [
26-
'-Xopt-in=kotlin.RequiresOptIn',
27-
'-Xallow-jvm-ir-dependencies'
28-
]
29-
}
30-
}
31-
3222
android {
3323
compileSdkVersion 30
3424
defaultConfig {
@@ -37,7 +27,6 @@ android {
3727
targetSdkVersion 30
3828
versionCode 1
3929
versionName '1.0'
40-
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
4130
}
4231
compileOptions {
4332
sourceCompatibility JavaVersion.VERSION_1_8
@@ -46,6 +35,9 @@ android {
4635
buildFeatures {
4736
compose true
4837
}
38+
kotlinOptions {
39+
jvmTarget = '1.8'
40+
}
4941
composeOptions {
5042
kotlinCompilerExtensionVersion compose_version
5143
}
@@ -57,9 +49,5 @@ dependencies {
5749
implementation "androidx.compose.ui:ui:$compose_version"
5850
implementation "androidx.compose.material:material:$compose_version"
5951
implementation "androidx.compose.ui:ui-tooling:$compose_version"
60-
implementation 'androidx.activity:activity-compose:1.3.0-alpha02'
61-
62-
testImplementation 'junit:junit:4.13.1'
63-
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
64-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
52+
implementation 'androidx.activity:activity-compose:1.3.0-SNAPSHOT'
6553
}

AnimationCodelab/finished/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
~ Copyright 2021 Google LLC
3+
~ Copyright 2021 The Android Open Source Project
44
~
55
~ Licensed under the Apache License, Version 2.0 (the "License");
66
~ you may not use this file except in compliance with the License.

AnimationCodelab/finished/src/main/java/com/example/android/codelab/animation/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 Google LLC
2+
* Copyright 2021 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

AnimationCodelab/finished/src/main/java/com/example/android/codelab/animation/ui/Color.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 Google LLC
2+
* Copyright 2021 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,10 +18,10 @@ package com.example.android.codelab.animation.ui
1818

1919
import androidx.compose.ui.graphics.Color
2020

21-
val purple100 = Color(0xFFE1BEE7)
22-
val purple500 = Color(0xFF6200EE)
23-
val purple700 = Color(0xFF3700B3)
24-
val teal200 = Color(0xFF03DAC5)
25-
val green300 = Color(0xFF81C784)
26-
val green800 = Color(0xFF2E7D32)
27-
val amber600 = Color(0xFFFFB300)
21+
val Purple100 = Color(0xFFE1BEE7)
22+
val Purple500 = Color(0xFF6200EE)
23+
val Purple700 = Color(0xFF3700B3)
24+
val Teal200 = Color(0xFF03DAC5)
25+
val Green300 = Color(0xFF81C784)
26+
val Green800 = Color(0xFF2E7D32)
27+
val Amber600 = Color(0xFFFFB300)
Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 Google LLC
2+
* Copyright 2021 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,31 +17,18 @@
1717
package com.example.android.codelab.animation.ui
1818

1919
import androidx.compose.material.MaterialTheme
20-
import androidx.compose.material.Typography
2120
import androidx.compose.material.lightColors
2221
import androidx.compose.runtime.Composable
23-
import androidx.compose.ui.text.TextStyle
24-
import androidx.compose.ui.text.font.FontFamily
25-
import androidx.compose.ui.text.font.FontWeight
26-
import androidx.compose.ui.unit.sp
2722

2823
@Composable
2924
fun AnimationCodelabTheme(content: @Composable () -> Unit) {
3025
val colors = lightColors(
31-
primary = purple500,
32-
primaryVariant = purple700,
33-
secondary = teal200
34-
)
35-
val typography = Typography(
36-
body1 = TextStyle(
37-
fontFamily = FontFamily.Default,
38-
fontWeight = FontWeight.Normal,
39-
fontSize = 16.sp
40-
)
26+
primary = Purple500,
27+
primaryVariant = Purple700,
28+
secondary = Teal200
4129
)
4230
MaterialTheme(
4331
colors = colors,
44-
typography = typography,
4532
content = content
4633
)
4734
}

0 commit comments

Comments
 (0)