Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update animation codelab #399

Merged
merged 5 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,21 @@

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
)
MaterialTheme(
colors = colors,
colorScheme = colors,
content = content
)
}
}
Loading
Loading