Skip to content

Commit

Permalink
Update androidxActivity and enable edgeToEdge
Browse files Browse the repository at this point in the history
Update androidxLifecycle
Update androidxNavigation
Update koin
Update room
Update protobuf
  • Loading branch information
joaooab committed Mar 7, 2024
1 parent e030ed0 commit 9b5ba51
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 54 deletions.
1 change: 0 additions & 1 deletion appcompose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.window.manager)
implementation(libs.koin.android)
implementation(libs.koin.compose)
debugImplementation(libs.androidx.compose.ui.tooling)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package com.br.weightcontrol
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.core.view.WindowCompat
import com.br.weightcontrol.designsystem.theme.WeiTheme
import com.br.weightcontrol.domain.usecase.session.SessionState
import com.br.weightcontrol.ui.WeiApp
Expand All @@ -19,8 +19,8 @@ class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val splashScreen = installSplashScreen()
WindowCompat.setDecorFitsSystemWindows(window, false)
setupAds()
enableEdgeToEdge()

setContent {
val sessionState by viewModel.sessionState.collectAsState()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.br.weightcontrol

import android.app.Application
import com.br.weightcontrol.di.weiAppModule
import org.koin.android.BuildConfig
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.startKoin
Expand Down
2 changes: 0 additions & 2 deletions appcompose/src/main/kotlin/com/br/weightcontrol/ui/WeiApp.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.br.weightcontrol.ui

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
Expand Down Expand Up @@ -33,7 +32,6 @@ import com.br.weightcontrol.navigation.WeiNavHost

@OptIn(
ExperimentalMaterial3Api::class,
ExperimentalLayoutApi::class,
ExperimentalComposeUiApi::class,
)
@Composable
Expand Down
5 changes: 1 addition & 4 deletions appcompose/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="NightAdjusted.Theme.Wei" parent="android:Theme.Material.NoActionBar">
<item name="android:windowLightStatusBar" tools:targetApi="23">false</item>
<item name="android:windowLightNavigationBar" tools:targetApi="27">false</item>
</style>
<style name="NightAdjusted.Theme.Wei" parent="android:Theme.Material.NoActionBar"/>

<style name="NightAdjusted.Theme.Splash" parent="Theme.SplashScreen">
<item name="android:windowLightStatusBar" tools:targetApi="23">false</item>
Expand Down
6 changes: 0 additions & 6 deletions appcompose/src/main/res/values-v23/themes.xml

This file was deleted.

7 changes: 0 additions & 7 deletions appcompose/src/main/res/values-v27/themes.xml

This file was deleted.

11 changes: 2 additions & 9 deletions appcompose/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">

<style name="NightAdjusted.Theme.Wei" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:windowLightStatusBar" tools:targetApi="23">true</item>
<item name="android:windowLightNavigationBar" tools:targetApi="27">true</item>
</style>

<style name="PlatformAdjusted.Theme.Wei" parent="NightAdjusted.Theme.Wei">
<item name="android:statusBarColor">@color/black30</item>
</style>
<style name="NightAdjusted.Theme.Wei" parent="android:Theme.Material.Light.NoActionBar" />

<style name="Theme.Wei" parent="PlatformAdjusted.Theme.Wei" />
<style name="Theme.Wei" parent="NightAdjusted.Theme.Wei" />

<style name="NightAdjusted.Theme.Splash" parent="Theme.SplashScreen">
<item name="android:windowLightStatusBar" tools:targetApi="23">true</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
Expand All @@ -30,6 +31,7 @@ import com.br.weightcontrol.designsystem.component.WeiButton
import com.br.weightcontrol.designsystem.component.WeiTopAppBar
import com.br.weightcontrol.onboarding.domain.OnBoardingStep
import com.br.weightcontrol.onboarding.domain.OnBoardingStep.Companion.steps
import com.br.weightcontrol.onboarding.domain.OnBoardingStep.FirstStep
import org.koin.androidx.compose.koinViewModel

@Composable
Expand All @@ -46,6 +48,7 @@ internal fun OnBoardingRoute(
navigateToProfile()
viewModel.onCreateProfile()
}

uiState.onFinish -> {
navigateToHome()
}
Expand All @@ -70,13 +73,14 @@ fun OnBoardingScreen(
Column(
modifier = modifier
.fillMaxSize()
.padding(horizontal = 24.dp),
.padding(horizontal = 24.dp)
.navigationBarsPadding(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.SpaceBetween
) {
WeiTopAppBar(
titleRes = R.string.welcome,
navigationIcon = { BackNavigationIcon { onPreviews(step) } }
navigationIcon = { if (step !is FirstStep) BackNavigationIcon { onPreviews(step) } }
)
Text(
text = stringResource(id = step.description),
Expand All @@ -89,7 +93,7 @@ fun OnBoardingScreen(
WeiButton(
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 32.dp),
.padding(bottom = 24.dp),
onClick = { onNext(step) }
) {
Text(text = stringResource(id = step.buttonText))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package br.com.weightcontrol.profile
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.DatePickerState
Expand Down Expand Up @@ -107,7 +108,8 @@ fun ProfileScreen(
Column(
modifier = modifier
.fillMaxWidth()
.padding(horizontal = 24.dp),
.padding(horizontal = 24.dp)
.navigationBarsPadding(),
) {
WeiTopAppBar(
titleRes = designSystemR.string.profile,
Expand Down
29 changes: 11 additions & 18 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
[versions]
adMob = "22.0.0"
adMob = "22.6.0"
androidGradlePlugin = "8.2.0"
androidDesugarJdkLibs = "1.2.2"
androidxActivity = "1.6.1"
androidDesugarJdkLibs = "2.0.4"
androidxActivity = "1.8.0"
androidxAppCompat = "1.5.1"
androidxComposeBom = "2024.02.00"
androidxComposeCompiler = "1.5.7"
androidxComposeRuntimeTracing = "1.0.0-alpha01"
androidxCore = "1.9.0"
androidxCore = "1.12.0"
androidxCoreSplashscreen = "1.0.1"
androidxDataStore = "1.0.0"
androidxLifecycle = "2.6.0-alpha05"
androidxNavigation = "2.5.3"
androidxLifecycle = "2.7.0"
androidxNavigation = "2.7.4"
androidxTestCore = "1.5.0"
androidxWindowManager = "1.0.0"
chart = "1.6.4"
junit4 = "4.13.2"
kotlin = "1.9.21"
koin = "3.3.3"
koinAndroid = "3.3.3"
koinAndroid = "3.5.3"
koinCompose = "3.4.2"
kotlinxCoroutines = "1.7.3"
kotlinxDatetime = "0.5.0"
ksp = "1.9.21-1.0.16"
material3 = "1.1.1"
protobuf = "3.23.0"
protobufPlugin = "0.9.3"
room = "2.5.0"
protobuf = "3.25.2"
protobufPlugin = "0.9.4"
room = "2.6.1"
org-jetbrains-kotlin-android = "1.8.0"
junit = "1.1.5"
espresso-core = "3.5.1"
material = "1.10.0"
secrets = "2.0.1"

[libraries]
Expand All @@ -43,7 +39,7 @@ androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", versi
androidx-compose-foundation = { group = "androidx.compose.foundation", name = "foundation" }
androidx-compose-foundation-layout = { group = "androidx.compose.foundation", name = "foundation-layout" }
androidx-compose-material-iconsExtended = { group = "androidx.compose.material", name = "material-icons-extended" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
androidx-compose-material3-windowSizeClass = { group = "androidx.compose.material3", name = "material3-window-size-class" }
androidx-compose-runtime = { group = "androidx.compose.runtime", name = "runtime" }
androidx-compose-runtime-livedata = { group = "androidx.compose.runtime", name = "runtime-livedata" }
Expand All @@ -60,12 +56,10 @@ androidx-lifecycle-runtimeCompose = { group = "androidx.lifecycle", name = "life
androidx-lifecycle-viewModelCompose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "androidxLifecycle" }
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "androidxNavigation" }
androidx-test-core = { group = "androidx.test", name = "core", version.ref = "androidxTestCore" }
androidx-window-manager = { module = "androidx.window:window", version.ref = "androidxWindowManager" }
chart-core = { group = "com.patrykandpatrick.vico", name = "core", version.ref = "chart" }
chart-compose = { group = "com.patrykandpatrick.vico", name = "compose", version.ref = "chart" }
chart-compose-m3 = { group = "com.patrykandpatrick.vico", name = "compose-m3", version.ref = "chart" }
junit4 = { group = "junit", name = "junit", version.ref = "junit4" }
koin-core = { group = "io.insert-koin", name = "koin-core", version.ref = "koin" }
koin-android = { group = "io.insert-koin", name = "koin-android", version.ref = "koinAndroid" }
koin-compose = { group = "io.insert-koin", name = "koin-androidx-compose", version.ref = "koinCompose" }
kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinxCoroutines" }
Expand All @@ -82,7 +76,6 @@ kotlin-gradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-pl
ksp-gradlePlugin = { group = "com.google.devtools.ksp", name = "com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" }
junit = { group = "androidx.test.ext", name = "junit", version.ref = "junit" }
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }

[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
Expand Down

0 comments on commit 9b5ba51

Please sign in to comment.