M3 migration (#11)
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -19,15 +19,17 @@ plugins {
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.superheroes'
|
||||
compileSdk 33
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.superheroes"
|
||||
minSdk 21
|
||||
minSdk 24
|
||||
targetSdk 33
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
useSupportLibrary true
|
||||
}
|
||||
@@ -45,29 +47,29 @@ android {
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
freeCompilerArgs += "-opt-in=androidx.compose.material3.ExperimentalMaterial3Api"
|
||||
}
|
||||
buildFeatures {
|
||||
compose true
|
||||
}
|
||||
composeOptions {
|
||||
kotlinCompilerExtensionVersion compose_version
|
||||
kotlinCompilerExtensionVersion '1.4.3'
|
||||
}
|
||||
packagingOptions {
|
||||
resources {
|
||||
excludes += '/META-INF/{AL2.0,LGPL2.1}'
|
||||
}
|
||||
}
|
||||
namespace 'com.example.superheroes'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Import the Compose BOM
|
||||
implementation platform('androidx.compose:compose-bom:2023.01.00')
|
||||
|
||||
implementation platform('androidx.compose:compose-bom:2022.10.00')
|
||||
implementation 'androidx.activity:activity-compose:1.6.1'
|
||||
implementation "androidx.compose.material:material"
|
||||
implementation "androidx.compose.ui:ui"
|
||||
implementation "androidx.compose.ui:ui-tooling-preview"
|
||||
implementation 'androidx.compose.material3:material3'
|
||||
implementation 'androidx.compose.ui:ui'
|
||||
implementation 'androidx.compose.ui:ui-tooling-preview'
|
||||
implementation 'androidx.core:core-ktx:1.9.0'
|
||||
debugImplementation "androidx.compose.ui:ui-tooling"
|
||||
|
||||
androidTestImplementation platform('androidx.compose:compose-bom:2022.10.00')
|
||||
debugImplementation 'androidx.compose.ui:ui-tooling'
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Copyright (C) 2023 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -24,14 +25,14 @@
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Superheroes"
|
||||
tools:targetApi="32">
|
||||
tools:targetApi="33">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.Superheroes">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 30 KiB |
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -13,10 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// This file uses Experimental APIs.
|
||||
// Caution: Experimental APIs can change in the future or may be removed entirely.
|
||||
@file:OptIn(ExperimentalAnimationApi::class)
|
||||
|
||||
package com.example.superheroes
|
||||
|
||||
import android.content.res.Configuration
|
||||
@@ -42,10 +39,11 @@ import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.itemsIndexed
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.Card
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Surface
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.CardDefaults
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
@@ -60,6 +58,7 @@ import com.example.superheroes.model.Hero
|
||||
import com.example.superheroes.model.HeroesRepository
|
||||
import com.example.superheroes.ui.theme.SuperheroesTheme
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
@Composable
|
||||
fun HeroesList(
|
||||
heroes: List<Hero>,
|
||||
@@ -78,7 +77,8 @@ fun HeroesList(
|
||||
enter = fadeIn(
|
||||
animationSpec = spring(dampingRatio = DampingRatioLowBouncy)
|
||||
),
|
||||
exit = fadeOut()
|
||||
exit = fadeOut(),
|
||||
modifier = modifier
|
||||
) {
|
||||
LazyColumn {
|
||||
itemsIndexed(heroes) { index, hero ->
|
||||
@@ -108,7 +108,7 @@ fun HeroListItem(
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
Card(
|
||||
elevation = 2.dp,
|
||||
elevation = CardDefaults.cardElevation(defaultElevation = 2.dp),
|
||||
modifier = modifier,
|
||||
) {
|
||||
Row(
|
||||
@@ -120,11 +120,11 @@ fun HeroListItem(
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
Text(
|
||||
text = stringResource(hero.nameRes),
|
||||
style = MaterialTheme.typography.h3
|
||||
style = MaterialTheme.typography.displaySmall
|
||||
)
|
||||
Text(
|
||||
text = stringResource(hero.descriptionRes),
|
||||
style = MaterialTheme.typography.body1
|
||||
style = MaterialTheme.typography.bodyLarge
|
||||
)
|
||||
}
|
||||
Spacer(Modifier.width(16.dp))
|
||||
@@ -164,7 +164,7 @@ fun HeroPreview() {
|
||||
fun HeroesPreview() {
|
||||
SuperheroesTheme(darkTheme = false) {
|
||||
Surface (
|
||||
color = MaterialTheme.colors.background
|
||||
color = MaterialTheme.colorScheme.background
|
||||
) {
|
||||
/* Important: It is not a good practice to access data source directly from the UI.
|
||||
In later units you will learn how to use ViewModel in such scenarios that takes the
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -18,20 +19,17 @@ package com.example.superheroes
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Scaffold
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material3.CenterAlignedTopAppBar
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.example.superheroes.model.HeroesRepository
|
||||
import com.example.superheroes.ui.theme.SuperheroesTheme
|
||||
|
||||
@@ -40,17 +38,22 @@ class MainActivity : ComponentActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContent {
|
||||
SuperheroesTheme {
|
||||
// A surface container using the 'background' color from the theme
|
||||
Surface(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
color = MaterialTheme.colorScheme.background
|
||||
) {
|
||||
SuperheroesApp()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Composable that displays an app bar and a list of heroes.
|
||||
*/
|
||||
@Composable
|
||||
fun SuperheroesApp() {
|
||||
@Composable
|
||||
fun SuperheroesApp() {
|
||||
Scaffold(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
topBar = {
|
||||
@@ -65,32 +68,32 @@ fun SuperheroesApp() {
|
||||
HeroesList(heroes = heroes, Modifier.padding(it))
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Composable that displays a Top Bar with an icon and text.
|
||||
*
|
||||
* @param modifier modifiers to set to this composable
|
||||
*/
|
||||
@Composable
|
||||
fun TopAppBar(modifier: Modifier = Modifier) {
|
||||
Box(
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.size(56.dp),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
@Composable
|
||||
fun TopAppBar(modifier: Modifier = Modifier) {
|
||||
CenterAlignedTopAppBar(
|
||||
title = {
|
||||
Text(
|
||||
text = stringResource(R.string.app_name),
|
||||
style = MaterialTheme.typography.h1,
|
||||
style = MaterialTheme.typography.displayLarge,
|
||||
)
|
||||
},
|
||||
modifier = modifier
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
fun SuperHeroesPreview() {
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
fun SuperHeroesPreview() {
|
||||
SuperheroesTheme {
|
||||
SuperheroesApp()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -17,7 +18,6 @@ package com.example.superheroes.model
|
||||
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.annotation.StringRes
|
||||
import com.example.superheroes.R
|
||||
|
||||
data class Hero(
|
||||
@StringRes val nameRes: Int,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -17,19 +18,62 @@ package com.example.superheroes.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
//Light Theme
|
||||
val md_theme_light_background = Color(0xFFFDFCF4)
|
||||
val md_theme_light_surface = Color(0xFFE0EACE)
|
||||
val md_theme_light_secondary = Color(0xFF596148)
|
||||
val md_theme_light_onSurface = Color(0xFF1B1C18)
|
||||
val md_theme_light_primary = Color(0xFF466800)
|
||||
val md_theme_light_onPrimary = Color(0xFF223600)
|
||||
val md_theme_light_onPrimary = Color(0xFFFFFFFF)
|
||||
val md_theme_light_primaryContainer = Color(0xFFC6F181)
|
||||
val md_theme_light_onPrimaryContainer = Color(0xFF121F00)
|
||||
val md_theme_light_secondary = Color(0xFF596248)
|
||||
val md_theme_light_onSecondary = Color(0xFFFFFFFF)
|
||||
val md_theme_light_secondaryContainer = Color(0xFFDDE6C6)
|
||||
val md_theme_light_onSecondaryContainer = Color(0xFF161E0A)
|
||||
val md_theme_light_tertiary = Color(0xFF396661)
|
||||
val md_theme_light_onTertiary = Color(0xFFFFFFFF)
|
||||
val md_theme_light_tertiaryContainer = Color(0xFFBCECE6)
|
||||
val md_theme_light_onTertiaryContainer = Color(0xFF00201D)
|
||||
val md_theme_light_error = Color(0xFFBA1A1A)
|
||||
val md_theme_light_errorContainer = Color(0xFFFFDAD6)
|
||||
val md_theme_light_onError = Color(0xFFFFFFFF)
|
||||
val md_theme_light_onErrorContainer = Color(0xFF410002)
|
||||
val md_theme_light_background = Color(0xFFFEFCF5)
|
||||
val md_theme_light_onBackground = Color(0xFF1B1C18)
|
||||
val md_theme_light_surface = Color(0xFFFEFCF5)
|
||||
val md_theme_light_onSurface = Color(0xFF1B1C18)
|
||||
val md_theme_light_surfaceVariant = Color(0xFFE1E4D4)
|
||||
val md_theme_light_onSurfaceVariant = Color(0xFF45483D)
|
||||
val md_theme_light_outline = Color(0xFF75786C)
|
||||
val md_theme_light_inverseOnSurface = Color(0xFFF2F1E9)
|
||||
val md_theme_light_inverseSurface = Color(0xFF30312C)
|
||||
val md_theme_light_inversePrimary = Color(0xFFABD468)
|
||||
val md_theme_light_surfaceTint = Color(0xFF466800)
|
||||
val md_theme_light_outlineVariant = Color(0xFFC5C8B9)
|
||||
val md_theme_light_scrim = Color(0xFF000000)
|
||||
|
||||
|
||||
// Dark Theme
|
||||
val md_theme_dark_primary = Color(0xFFABD468)
|
||||
val md_theme_dark_onPrimary = Color(0xFF223600)
|
||||
val md_theme_dark_primaryContainer = Color(0xFF344E00)
|
||||
val md_theme_dark_onPrimaryContainer = Color(0xFFC6F181)
|
||||
val md_theme_dark_secondary = Color(0xFFC1CAAB)
|
||||
val md_theme_dark_onSecondary = Color(0xFF2B331D)
|
||||
val md_theme_dark_secondaryContainer = Color(0xFF414A32)
|
||||
val md_theme_dark_onSecondaryContainer = Color(0xFFDDE6C6)
|
||||
val md_theme_dark_tertiary = Color(0xFFA0D0CA)
|
||||
val md_theme_dark_onTertiary = Color(0xFF013733)
|
||||
val md_theme_dark_tertiaryContainer = Color(0xFF1F4E4A)
|
||||
val md_theme_dark_onTertiaryContainer = Color(0xFFBCECE6)
|
||||
val md_theme_dark_error = Color(0xFFFFB4AB)
|
||||
val md_theme_dark_errorContainer = Color(0xFF93000A)
|
||||
val md_theme_dark_onError = Color(0xFF690005)
|
||||
val md_theme_dark_onErrorContainer = Color(0xFFFFDAD6)
|
||||
val md_theme_dark_background = Color(0xFF1B1C18)
|
||||
val md_theme_dark_surface = Color(0xFF373F29)
|
||||
val md_theme_dark_secondary = Color(0xFFDDE6C6)
|
||||
val md_theme_dark_onBackground = Color(0xFFE4E3DB)
|
||||
val md_theme_dark_surface = Color(0xFF1B1C18)
|
||||
val md_theme_dark_onSurface = Color(0xFFE4E3DB)
|
||||
val md_theme_dark_primary = Color(0xFFC1CAAB)
|
||||
val md_theme_dark_onPrimary = Color(0xFFDDE6C6)
|
||||
val md_theme_dark_surfaceVariant = Color(0xFF45483D)
|
||||
val md_theme_dark_onSurfaceVariant = Color(0xFFC5C8B9)
|
||||
val md_theme_dark_outline = Color(0xFF8F9285)
|
||||
val md_theme_dark_inverseOnSurface = Color(0xFF1B1C18)
|
||||
val md_theme_dark_inverseSurface = Color(0xFFE4E3DB)
|
||||
val md_theme_dark_inversePrimary = Color(0xFF466800)
|
||||
val md_theme_dark_surfaceTint = Color(0xFFABD468)
|
||||
val md_theme_dark_outlineVariant = Color(0xFF45483D)
|
||||
val md_theme_dark_scrim = Color(0xFF000000)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -16,7 +17,7 @@
|
||||
package com.example.superheroes.ui.theme
|
||||
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.Shapes
|
||||
import androidx.compose.material3.Shapes
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
val Shapes = Shapes(
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -15,40 +16,113 @@
|
||||
|
||||
package com.example.superheroes.ui.theme
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.darkColors
|
||||
import androidx.compose.material.lightColors
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.SideEffect
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.core.view.WindowCompat
|
||||
|
||||
private val DarkColorPalette = darkColors(
|
||||
background = md_theme_dark_background,
|
||||
surface = md_theme_dark_surface,
|
||||
onSurface = md_theme_dark_onSurface,
|
||||
primary = md_theme_dark_primary,
|
||||
onPrimary = md_theme_dark_onPrimary,
|
||||
secondary = md_theme_dark_secondary
|
||||
)
|
||||
|
||||
private val LightColorPalette = lightColors(
|
||||
background = md_theme_light_background,
|
||||
surface = md_theme_light_surface,
|
||||
onSurface = md_theme_light_onSurface,
|
||||
private val LightColors = lightColorScheme(
|
||||
primary = md_theme_light_primary,
|
||||
onPrimary = md_theme_light_onPrimary,
|
||||
secondary = md_theme_light_secondary
|
||||
primaryContainer = md_theme_light_primaryContainer,
|
||||
onPrimaryContainer = md_theme_light_onPrimaryContainer,
|
||||
secondary = md_theme_light_secondary,
|
||||
onSecondary = md_theme_light_onSecondary,
|
||||
secondaryContainer = md_theme_light_secondaryContainer,
|
||||
onSecondaryContainer = md_theme_light_onSecondaryContainer,
|
||||
tertiary = md_theme_light_tertiary,
|
||||
onTertiary = md_theme_light_onTertiary,
|
||||
tertiaryContainer = md_theme_light_tertiaryContainer,
|
||||
onTertiaryContainer = md_theme_light_onTertiaryContainer,
|
||||
error = md_theme_light_error,
|
||||
errorContainer = md_theme_light_errorContainer,
|
||||
onError = md_theme_light_onError,
|
||||
onErrorContainer = md_theme_light_onErrorContainer,
|
||||
background = md_theme_light_background,
|
||||
onBackground = md_theme_light_onBackground,
|
||||
surface = md_theme_light_surface,
|
||||
onSurface = md_theme_light_onSurface,
|
||||
surfaceVariant = md_theme_light_surfaceVariant,
|
||||
onSurfaceVariant = md_theme_light_onSurfaceVariant,
|
||||
outline = md_theme_light_outline,
|
||||
inverseOnSurface = md_theme_light_inverseOnSurface,
|
||||
inverseSurface = md_theme_light_inverseSurface,
|
||||
inversePrimary = md_theme_light_inversePrimary,
|
||||
surfaceTint = md_theme_light_surfaceTint,
|
||||
outlineVariant = md_theme_light_outlineVariant,
|
||||
scrim = md_theme_light_scrim,
|
||||
)
|
||||
|
||||
private val DarkColors = darkColorScheme(
|
||||
primary = md_theme_dark_primary,
|
||||
onPrimary = md_theme_dark_onPrimary,
|
||||
primaryContainer = md_theme_dark_primaryContainer,
|
||||
onPrimaryContainer = md_theme_dark_onPrimaryContainer,
|
||||
secondary = md_theme_dark_secondary,
|
||||
onSecondary = md_theme_dark_onSecondary,
|
||||
secondaryContainer = md_theme_dark_secondaryContainer,
|
||||
onSecondaryContainer = md_theme_dark_onSecondaryContainer,
|
||||
tertiary = md_theme_dark_tertiary,
|
||||
onTertiary = md_theme_dark_onTertiary,
|
||||
tertiaryContainer = md_theme_dark_tertiaryContainer,
|
||||
onTertiaryContainer = md_theme_dark_onTertiaryContainer,
|
||||
error = md_theme_dark_error,
|
||||
errorContainer = md_theme_dark_errorContainer,
|
||||
onError = md_theme_dark_onError,
|
||||
onErrorContainer = md_theme_dark_onErrorContainer,
|
||||
background = md_theme_dark_background,
|
||||
onBackground = md_theme_dark_onBackground,
|
||||
surface = md_theme_dark_surface,
|
||||
onSurface = md_theme_dark_onSurface,
|
||||
surfaceVariant = md_theme_dark_surfaceVariant,
|
||||
onSurfaceVariant = md_theme_dark_onSurfaceVariant,
|
||||
outline = md_theme_dark_outline,
|
||||
inverseOnSurface = md_theme_dark_inverseOnSurface,
|
||||
inverseSurface = md_theme_dark_inverseSurface,
|
||||
inversePrimary = md_theme_dark_inversePrimary,
|
||||
surfaceTint = md_theme_dark_surfaceTint,
|
||||
outlineVariant = md_theme_dark_outlineVariant,
|
||||
scrim = md_theme_dark_scrim,
|
||||
)
|
||||
|
||||
@Composable
|
||||
fun SuperheroesTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
|
||||
val colors = if (darkTheme) {
|
||||
DarkColorPalette
|
||||
} else {
|
||||
LightColorPalette
|
||||
fun SuperheroesTheme(
|
||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||
// Dynamic color is available on Android 12+
|
||||
// Dynamic color in this app is turned off for learning purposes
|
||||
dynamicColor: Boolean = false,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
val colorScheme = when {
|
||||
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
|
||||
val context = LocalContext.current
|
||||
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
|
||||
}
|
||||
|
||||
darkTheme -> DarkColors
|
||||
else -> LightColors
|
||||
}
|
||||
val view = LocalView.current
|
||||
if (!view.isInEditMode) {
|
||||
SideEffect {
|
||||
val window = (view.context as Activity).window
|
||||
window.statusBarColor = colorScheme.background.toArgb()
|
||||
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme
|
||||
}
|
||||
}
|
||||
|
||||
MaterialTheme(
|
||||
colors = colors,
|
||||
colorScheme = colorScheme,
|
||||
typography = Typography,
|
||||
shapes = Shapes,
|
||||
content = content
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -15,7 +16,7 @@
|
||||
|
||||
package com.example.superheroes.ui.theme
|
||||
|
||||
import androidx.compose.material.Typography
|
||||
import androidx.compose.material3.Typography
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.Font
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
@@ -27,25 +28,30 @@ val Cabin = FontFamily(
|
||||
Font(R.font.cabin_regular, FontWeight.Normal),
|
||||
Font(R.font.cabin_bold, FontWeight.Bold)
|
||||
)
|
||||
|
||||
// Set of Material typography styles to start with
|
||||
val Typography = Typography(
|
||||
defaultFontFamily = Cabin,
|
||||
h1 = TextStyle(
|
||||
|
||||
bodyLarge = TextStyle(
|
||||
fontFamily = Cabin,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 24.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
),
|
||||
|
||||
displayLarge = TextStyle(
|
||||
fontFamily = Cabin,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 30.sp
|
||||
),
|
||||
h2 = TextStyle(
|
||||
displayMedium = TextStyle(
|
||||
fontFamily = Cabin,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 20.sp
|
||||
),
|
||||
h3 = TextStyle(
|
||||
displaySmall = TextStyle(
|
||||
fontFamily = Cabin,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 20.sp
|
||||
),
|
||||
|
||||
body1 = TextStyle(
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp
|
||||
)
|
||||
)
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Copyright (C) 2023 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -19,78 +19,137 @@
|
||||
android:height="1080dp"
|
||||
android:viewportWidth="1080"
|
||||
android:viewportHeight="1080">
|
||||
|
||||
<path
|
||||
android:fillColor="#3DDB85"
|
||||
android:pathData="M 0 0 H 1080 V 1080 H 0 V 0 Z" />
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:fillColor="#F86734"
|
||||
android:pathData="M435.89,669H319.11c-29.09,0-52.2-24.48-50.52-53.52l14.15-244.8c1.55-26.77,23.71-47.68,50.52-47.68h88.48 c26.81,0,48.97,20.91,50.52,47.68l14.15,244.8C488.09,644.52,464.98,669,435.89,669z" />
|
||||
<path
|
||||
android:fillColor="#F86734"
|
||||
android:pathData="M760.89,669H644.11c-29.09,0-52.2-24.48-50.52-53.52l14.15-244.8c1.55-26.77,23.71-47.68,50.52-47.68h88.48 c26.81,0,48.97,20.91,50.52,47.68l14.15,244.8C813.09,644.52,789.98,669,760.89,669z" />
|
||||
android:pathData="M0,0h1080v1080h-1080z"
|
||||
android:fillColor="#3DDB85"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:fillColor="#2C80F9"
|
||||
android:pathData="M678.9,868.59c-34.82-8.81-31.01-121.36-31.01-121.36L441.92,734c0,0,1.68,123.1-27.13,134.59 c-12.82,5.11-92.15,19.23-92.15,19.67c0,95.11,146.4,145.99,227.54,145.96c80.68-0.03,227.17-50.85,227.17-143.74 c0-0.7-24-5.7-49.19-11.02C709.13,875.45,689.42,871.25,678.9,868.59z" />
|
||||
android:pathData="M435.9,669H319.1c-29.1,0 -52.2,-24.5 -50.5,-53.5l14.1,-244.8c1.5,-26.8 23.7,-47.7 50.5,-47.7h88.5c26.8,0 49,20.9 50.5,47.7l14.1,244.8C488.1,644.5 465,669 435.9,669z"
|
||||
android:fillColor="#F86734"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:fillColor="#163A57"
|
||||
android:pathData="M222.92,1187.51h647.6l7.37-106.08c5.06-116.59-88.72-213.56-205.41-212.42l-261.6,2.56 c-116.69,1.14-208.55,99.93-201.22,216.39L222.92,1187.51z" />
|
||||
android:pathData="M760.9,669H644.1c-29.1,0 -52.2,-24.5 -50.5,-53.5l14.1,-244.8c1.5,-26.8 23.7,-47.7 50.5,-47.7h88.5c26.8,0 49,20.9 50.5,47.7l14.1,244.8C813.1,644.5 790,669 760.9,669z"
|
||||
android:fillColor="#F86734"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:fillColor="#163A57"
|
||||
android:pathData="M704.85,1187.51h314.05c-135.89-288.34-249.35-321.95-367.2-317.85c-61.31,2.13-17.83,244.76-17.83,244.76 L704.85,1187.51z" />
|
||||
android:pathData="M678.9,868.6c-34.8,-8.8 -31,-121.4 -31,-121.4L441.9,734c0,0 1.7,123.1 -27.1,134.6c-12.8,5.1 -92.2,19.2 -92.2,19.7c0,95.1 146.4,146 227.5,146c80.7,-0 227.2,-50.8 227.2,-143.7c0,-0.7 -24,-5.7 -49.2,-11C709.1,875.5 689.4,871.3 678.9,868.6z"
|
||||
android:fillColor="#2C80F9"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:fillColor="#D6F0FF"
|
||||
android:pathData="M 861.34 1187.51 L 865.14 1055.73 L 856.61 1055.49 L 852.81 1187.51 Z" />
|
||||
android:pathData="M222.9,1187.5h647.6l7.4,-106.1c5.1,-116.6 -88.7,-213.6 -205.4,-212.4l-261.6,2.6c-116.7,1.1 -208.6,99.9 -201.2,216.4L222.9,1187.5z"
|
||||
android:fillColor="#163A57"/>
|
||||
</group>
|
||||
<path
|
||||
android:fillColor="#163A57"
|
||||
android:pathData="M375.15,1187.51 l70.98-73.09c0,0,43.48-242.62-17.83-244.76c-117.85-4.1-231.31,29.5-367.2,317.85H375.15z" />
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:fillColor="#D6F0FF"
|
||||
android:pathData="M 243.39 1187.51 L 239.59 1055.49 L 231.06 1055.73 L 234.86 1187.51 Z" />
|
||||
android:pathData="M704.8,1187.5h314c-135.9,-288.3 -249.4,-322 -367.2,-317.9c-61.3,2.1 -17.8,244.8 -17.8,244.8L704.8,1187.5z"
|
||||
android:fillColor="#163A57"/>
|
||||
</group>
|
||||
<path
|
||||
android:fillColor="#F86734"
|
||||
android:pathData="M371.42,870.01 l16.9,56.41c2.77,9.25,11.28,15.58,20.93,15.58h261.49c9.65,0,18.16-6.33,20.93-15.58l16.9-56.41c4.2-14.02-6.3-28.13-20.93-28.13 h-295.3C377.72,841.89,367.22,855.99,371.42,870.01z" />
|
||||
<path
|
||||
android:fillColor="#F86734"
|
||||
android:pathData="M521.36,1006.47 l-37.72-70.27c-6.59-12.28,2.58-27.08,16.51-26.65l79.72,2.46c13.93,0.43,22.16,15.78,14.83,27.62l-41.99,67.8 C545.36,1019.29,527.95,1018.75,521.36,1006.47z" />
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:fillColor="#163A57"
|
||||
android:pathData="M466.82,857h-57.65c-13.35,0-24.18-10.82-24.18-24.18v-19.65c0-13.35,10.82-24.18,24.18-24.18h57.65 c13.35,0,24.18,10.82,24.18,24.18v19.65C491,846.18,480.18,857,466.82,857z" />
|
||||
<path
|
||||
android:fillColor="#163A57"
|
||||
android:pathData="M670.82,857h-57.65c-13.35,0-24.18-10.82-24.18-24.18v-19.65c0-13.35,10.82-24.18,24.18-24.18h57.65 c13.35,0,24.18,10.82,24.18,24.18v19.65C695,846.18,684.18,857,670.82,857z" />
|
||||
android:pathData="M861.3,1187.5l3.8,-131.8l-8.5,-0.2l-3.8,132z"
|
||||
android:fillColor="#D6F0FF"/>
|
||||
</group>
|
||||
<path
|
||||
android:fillColor="#163A57"
|
||||
android:pathData="M590.97,185H541h-2 h-49.97C392.36,185,314,263.36,314,360.03v220.94C314,677.64,392.36,756,489.03,756H539h2h49.97C687.64,756,766,677.64,766,580.97 V360.03C766,263.36,687.64,185,590.97,185z" />
|
||||
<path
|
||||
android:fillColor="#537DE9"
|
||||
android:pathData="M541,185h-2h-49.97 c-27.73,0-53.96,6.46-77.26,17.94l-13.2,147.81c-2.46,27.53,19.23,51.25,46.87,51.25h181.1c27.64,0,49.33-23.71,46.87-51.25 L659.88,199.1c-21.15-9.07-44.44-14.1-68.91-14.1H541z" />
|
||||
<path
|
||||
android:fillColor="#F86734"
|
||||
android:pathData="M607.42,372H464.58 c-21.8,0-38.91-18.7-36.97-40.42l13.37-149.76c1.71-19.14,17.75-33.82,36.97-33.82h116.1c19.22,0,35.26,14.67,36.97,33.82 l13.37,149.76C646.33,353.3,629.22,372,607.42,372z" />
|
||||
<path
|
||||
android:fillColor="#D6F0FF"
|
||||
android:pathData="M 460.2 478.26 C 469.301652677 478.26 476.68 490.907955817 476.68 506.51 C 476.68 522.112044183 469.301652677 534.76 460.2 534.76 C 451.098347323 534.76 443.72 522.112044183 443.72 506.51 C 443.72 490.907955817 451.098347323 478.26 460.2 478.26 Z" />
|
||||
<path
|
||||
android:fillColor="#D6F0FF"
|
||||
android:pathData="M 619.8 478.26 C 628.901652677 478.26 636.28 490.907955817 636.28 506.51 C 636.28 522.112044183 628.901652677 534.76 619.8 534.76 C 610.698347323 534.76 603.32 522.112044183 603.32 506.51 C 603.32 490.907955817 610.698347323 478.26 619.8 478.26 Z" />
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:fillColor="#D6F0FF"
|
||||
android:pathData="M563,592.5c-0.32,16.08-13.17,29.5-29.5,29.5c-16.33,0-29.18-13.42-29.5-29.5c-0.13-6.43-10.13-6.45-10,0 c0.42,21.46,17.68,39.54,39.5,39.5c21.82-0.04,39.08-17.98,39.5-39.5C573.13,586.06,563.13,586.06,563,592.5L563,592.5z" />
|
||||
android:pathData="M375.1,1187.5l71,-73.1c0,0 43.5,-242.6 -17.8,-244.8c-117.8,-4.1 -231.3,29.5 -367.2,317.9H375.1z"
|
||||
android:fillColor="#163A57"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:pathData="M243.4,1187.5l-3.8,-132l-8.5,0.2l3.8,131.8z"
|
||||
android:fillColor="#D6F0FF"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:pathData="M371.4,870l16.9,56.4c2.8,9.3 11.3,15.6 20.9,15.6h261.5c9.6,0 18.2,-6.3 20.9,-15.6l16.9,-56.4c4.2,-14 -6.3,-28.1 -20.9,-28.1h-295.3C377.7,841.9 367.2,856 371.4,870z"
|
||||
android:fillColor="#F86734"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:pathData="M521.4,1006.5l-37.7,-70.3c-6.6,-12.3 2.6,-27.1 16.5,-26.6l79.7,2.5c13.9,0.4 22.2,15.8 14.8,27.6l-42,67.8C545.4,1019.3 528,1018.8 521.4,1006.5z"
|
||||
android:fillColor="#F86734"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:pathData="M466.8,857h-57.7c-13.4,0 -24.2,-10.8 -24.2,-24.2v-19.6c0,-13.4 10.8,-24.2 24.2,-24.2h57.7c13.4,0 24.2,10.8 24.2,24.2v19.6C491,846.2 480.2,857 466.8,857z"
|
||||
android:fillColor="#163A57"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:pathData="M670.8,857h-57.7c-13.4,0 -24.2,-10.8 -24.2,-24.2v-19.6c0,-13.4 10.8,-24.2 24.2,-24.2h57.7c13.4,0 24.2,10.8 24.2,24.2v19.6C695,846.2 684.2,857 670.8,857z"
|
||||
android:fillColor="#163A57"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:pathData="M591,185H541h-2h-50C392.4,185 314,263.4 314,360v220.9C314,677.6 392.4,756 489,756H539h2h50C687.6,756 766,677.6 766,581V360C766,263.4 687.6,185 591,185z"
|
||||
android:fillColor="#163A57"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:pathData="M541,185h-2h-50c-27.7,0 -54,6.5 -77.3,17.9l-13.2,147.8c-2.5,27.5 19.2,51.3 46.9,51.3h181.1c27.6,0 49.3,-23.7 46.9,-51.3L659.9,199.1c-21.1,-9.1 -44.4,-14.1 -68.9,-14.1H541z"
|
||||
android:fillColor="#537DE9"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:pathData="M607.4,372H464.6c-21.8,0 -38.9,-18.7 -37,-40.4l13.4,-149.8c1.7,-19.1 17.8,-33.8 37,-33.8h116.1c19.2,0 35.3,14.7 37,33.8l13.4,149.8C646.3,353.3 629.2,372 607.4,372z"
|
||||
android:fillColor="#F86734"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M-25.4,28.3l1074.3,-59.9l59.9,1074.3l-1074.3,59.9z"/>
|
||||
<path
|
||||
android:pathData="M443.7,507.4a28.2,16.5 86.8,1 0,32.9 -1.8a28.2,16.5 86.8,1 0,-32.9 1.8z"
|
||||
android:fillColor="#D6F0FF"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M-25.1,37.2l1074.3,-59.9l59.9,1074.3l-1074.3,59.9z"/>
|
||||
<path
|
||||
android:pathData="M603.3,507.4a28.2,16.5 86.8,1 0,32.9 -1.8a28.2,16.5 86.8,1 0,-32.9 1.8z"
|
||||
android:fillColor="#D6F0FF"/>
|
||||
</group>
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M2,2h1076v1076h-1076z"/>
|
||||
<path
|
||||
android:pathData="M563,592.5c-0.3,16.1 -13.2,29.5 -29.5,29.5c-16.3,0 -29.2,-13.4 -29.5,-29.5c-0.1,-6.4 -10.1,-6.4 -10,0c0.4,21.5 17.7,39.5 39.5,39.5c21.8,-0 39.1,-18 39.5,-39.5C573.1,586.1 563.1,586.1 563,592.5L563,592.5z"
|
||||
android:fillColor="#D6F0FF"/>
|
||||
</group>
|
||||
</vector>
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Copyright (C) 2023 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Copyright (C) 2023 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Copyright (C) 2023 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Copyright (C) 2023 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Copyright (C) 2023 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Copyright (C) 2023 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -17,13 +18,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<group android:scaleX="0.99722993"
|
||||
android:scaleY="0.99722993">
|
||||
android:viewportWidth="108.3"
|
||||
android:viewportHeight="108.3">
|
||||
|
||||
<path
|
||||
android:fillColor="#F86734"
|
||||
android:pathData="M 0 0 H 108.3 V 108.3 H 0 V 0 Z" />
|
||||
</group>
|
||||
</vector>
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Copyright (C) 2023 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -17,12 +18,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<group android:scaleX="0.9430986"
|
||||
android:scaleY="0.9430986"
|
||||
android:translateX="20.52"
|
||||
android:translateY="20.567156">
|
||||
android:viewportWidth="71"
|
||||
android:viewportHeight="70.9">
|
||||
<group android:scaleX="0.59"
|
||||
android:scaleY="0.589169"
|
||||
android:translateX="14.555"
|
||||
android:translateY="14.563958">
|
||||
|
||||
<path
|
||||
android:fillColor="#fbc02d"
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Copyright (C) 2023 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -17,4 +18,5 @@
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Copyright (C) 2023 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -17,4 +18,5 @@
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<style name="Theme.Superheroes" parent="android:Theme.Material.Light.NoActionBar">
|
||||
<item name="android:statusBarColor">@color/background_dark</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<style name="Theme.Superheroes" parent="android:Theme.Material.Light.NoActionBar">
|
||||
<item name="android:statusBarColor">@color/background_light</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<style name="Theme.Superheroes" parent="android:Theme.Material.Light.NoActionBar">
|
||||
<item name="android:statusBarColor">@color/background_light</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Copyright (C) 2023 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -14,7 +15,4 @@
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<color name="background_light">#FFFDFCF4</color>
|
||||
<color name="background_dark">#FF1B1C18</color>
|
||||
</resources>
|
||||
<resources></resources>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Copyright (C) 2023 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2022 The Android Open Source Project
|
||||
~ Copyright (C) 2023 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ https://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -16,8 +17,5 @@
|
||||
|
||||
<resources>
|
||||
|
||||
<style name="Theme.Superheroes" parent="android:Theme.Material.Light.NoActionBar">
|
||||
<item name="android:statusBarColor">@color/background_light</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
</style>
|
||||
<style name="Theme.Superheroes" parent="android:Theme.Material.Light.NoActionBar" />
|
||||
</resources>
|
||||
21
build.gradle
@@ -1,14 +1,11 @@
|
||||
buildscript {
|
||||
ext {
|
||||
compose_version = '1.4.0'
|
||||
}
|
||||
}/*
|
||||
* Copyright (c) 2022 The Android Open Source Project
|
||||
/*
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -19,11 +16,7 @@ buildscript {
|
||||
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id 'com.android.application' version '7.4.0' apply false
|
||||
id 'com.android.library' version '7.4.0' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
id 'com.android.application' version '7.4.2' apply false
|
||||
id 'com.android.library' version '7.4.2' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
|
||||
#
|
||||
# Copyright (C) 2023 The Android Open Source Project
|
||||
#
|
||||
# Copyright (c) 2022 The Android Open Source Project
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -27,7 +29,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app"s APK
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
# Kotlin code style for this project: "official" or "obsolete":
|
||||
|
||||
20
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,21 +1,7 @@
|
||||
#
|
||||
# Copyright (c) 2022 The Android Open Source Project
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
#Tue Jan 31 15:54:44 PST 2023
|
||||
#Thu Mar 09 16:31:19 PST 2023
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The Android Open Source Project
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -12,12 +13,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
|
||||