Skip to content

Commit

Permalink
Merge pull request #399 from android/riggaroo/anim-codelab-update
Browse files Browse the repository at this point in the history
Update animation codelab
  • Loading branch information
riggaroo authored Nov 23, 2023
2 parents 34f67ca + 9d58445 commit 95c5bed
Show file tree
Hide file tree
Showing 12 changed files with 322 additions and 268 deletions.
16 changes: 3 additions & 13 deletions AnimationCodelab/finished/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ plugins {

android {
namespace "com.example.android.codelab.animation"
compileSdkVersion 34
compileSdk 34
defaultConfig {
applicationId 'com.example.android.codelab.animation'
minSdkVersion 21
targetSdkVersion 33
targetSdk 34
versionCode 1
versionName '1.0'
}
Expand All @@ -51,17 +51,7 @@ dependencies {
implementation 'androidx.activity:activity-compose:1.8.1'
implementation 'androidx.core:core-ktx:1.12.0'
implementation "androidx.compose.ui:ui"
implementation "androidx.compose.material:material"
implementation "androidx.compose.material3:material3"
implementation "androidx.compose.ui:ui-tooling-preview"
debugImplementation "androidx.compose.ui:ui-tooling"
}

// Compiler flag to use experimental Compose APIs
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += [
"-opt-in=kotlin.RequiresOptIn"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ package com.example.android.codelab.animation
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import com.example.android.codelab.animation.ui.AnimationCodelabTheme
import com.example.android.codelab.animation.ui.home.Home

class MainActivity : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
AnimationCodelabTheme {
Home()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ package com.example.android.codelab.animation.ui

import androidx.compose.ui.graphics.Color

val Purple100 = Color(0xFFE1BEE7)
val Purple500 = Color(0xFF6200EE)
val Purple700 = Color(0xFF3700B3)
val Teal200 = Color(0xFF03DAC5)
val Green300 = Color(0xFF81C784)
val Green800 = Color(0xFF2E7D32)
val Amber600 = Color(0xFFFFB300)

val Melon = Color(0xFFfec5bb)
val PaleDogwood = Color(0xFFfcd5ce)
val Seashell = Color(0xFFf8edeb)
val Peach = Color(0xFFfec89a)
val Green = Color(0xFFd8e2dc)
val GreenLight = Color(0xFFEBF1EE)
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@

package com.example.android.codelab.animation.ui

import androidx.compose.material.MaterialTheme
import androidx.compose.material.lightColors
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color

@Composable
fun AnimationCodelabTheme(content: @Composable () -> Unit) {
val colors = lightColors(
primary = Purple500,
primaryVariant = Purple700,
secondary = Teal200
val colors = lightColorScheme(
primary = Melon,
primaryContainer = PaleDogwood,
onPrimary = Color.Black,
secondary = Peach,
onSecondary = Color.Black
)
MaterialTheme(
colors = colors,
colorScheme = colors,
content = content
)
}
}
Loading

0 comments on commit 95c5bed

Please sign in to comment.