Olá, professor Alex,
Eu fiz os cursos que você promoveu de android, navigation, fragment, Kotlin e Firebase Firestore e desenvolvi meu primeiro app, contudo o layout fica totalmente desconfigurado em api abaixo de 29 e quando o usuário muda de tela o layout fica sobreposto, o minSdkVersion é 24. Tentei uma solução buscando informações no Google, mas não consegui encontrar.
Abaixo o build.gradle(app):
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'kotlin-android-extensions'
id 'androidx.navigation.safeargs.kotlin'
id 'com.google.gms.google-services'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.1"
defaultConfig {
applicationId "br.com.antonio.distribuidoradoguila"
minSdkVersion 24
targetSdkVersion 30
versionCode 3
versionName "1.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
// Serialization
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.1"
// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
// Glide https://github.com/bumptech/glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
kapt 'com.github.bumptech.glide:compiler:4.11.0'
// Room
def room_version = '2.3.0'
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
// Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1"
// Koin - Scope, View Model e Fragment
implementation "org.koin:koin-androidx-scope:2.2.0-alpha-1"
implementation "org.koin:koin-androidx-viewmodel:2.2.0-alpha-1"
implementation "org.koin:koin-androidx-fragment:2.2.0-alpha-1"
// ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
// LiveData
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1"
// Navigation
implementation "androidx.navigation:navigation-fragment-ktx:2.3.5"
implementation "androidx.navigation:navigation-ui-ktx:2.3.5"
// Preference
implementation "androidx.preference:preference-ktx:1.1.1"
// Firebase Authentication
implementation platform('com.google.firebase:firebase-bom:26.3.0')
implementation "com.google.firebase:firebase-analytics:19.0.1"
implementation "com.google.firebase:firebase-auth-ktx:21.0.1"
// Firebase Firestore
implementation 'com.google.firebase:firebase-firestore-ktx:23.0.3'
// Validador Caelum
implementation 'br.com.caelum.stella:caelum-stella-core:2.1.2'
// Firebase Cloud Messaging
implementation 'com.google.firebase:firebase-analytics:19.0.1'
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.4.1'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.4.32'
}