Resolving dependencies

baptiste2
Arthur VALIN 2 years ago
parent 596fd974ee
commit 3a6adc4108

@ -1,7 +1,8 @@
plugins { plugins {
id 'com.android.application' id 'com.android.application'
id 'org.jetbrains.kotlin.android' id 'org.jetbrains.kotlin.android'
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' // id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
id 'kotlin-kapt'
} }
android { android {
@ -32,18 +33,12 @@ android {
} }
} }
apply plugin: 'kotlin-kapt'
dependencies { dependencies {
kapt "androidx.room:room-compiler:2.5.1" kapt "androidx.room:room-compiler:2.5.1"
annotationProcessor "androidx.room:room-compiler:2.5.1"
implementation "androidx.room:room-runtime:2.5.1" implementation "androidx.room:room-runtime:2.5.1"
implementation "androidx.room:room-ktx:2.5.1" implementation "androidx.room:room-ktx:2.5.1"
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
// implementation 'androidx.lifecycle:lifecycle-livedata:2.6.1'
// implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
// implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0' implementation 'com.google.android.material:material:1.8.0'
@ -53,9 +48,8 @@ dependencies {
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation "androidx.fragment:fragment-ktx:1.5.5" implementation "androidx.fragment:fragment-ktx:1.5.6"
implementation 'org.osmdroid:osmdroid-android:6.1.14' implementation 'org.osmdroid:osmdroid-android:6.1.14'
implementation 'com.github.MKergall:osmbonuspack:6.9.0' implementation 'com.github.MKergall:osmbonuspack:6.9.0'
implementation 'com.android.support:multidex:1.0.3'
} }

@ -1,6 +1,7 @@
package uca.baptistearthur.geocaching.viewModels package uca.baptistearthur.geocaching.viewModels
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import androidx.lifecycle.asLiveData
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import uca.baptistearthur.geocaching.data.RoadTripDAO import uca.baptistearthur.geocaching.data.RoadTripDAO
@ -8,9 +9,9 @@ import uca.baptistearthur.geocaching.model.RoadTripEntity
class RoadTripViewModel(val dao: RoadTripDAO): ViewModel() { class RoadTripViewModel(val dao: RoadTripDAO): ViewModel() {
fun getRoadTripById(id: Int) = dao.getRoadTripById(id) // .asLiveData() // ne marche pas -> impossible d'importer fun getRoadTripById(id: Int) = dao.getRoadTripById(id).asLiveData()
fun getAllRoadTrips() = dao.getAllRoadTrips() // .asLiveData() fun getAllRoadTrips() = dao.getAllRoadTrips().asLiveData()
fun insertRoadTrip(r: RoadTripEntity){ fun insertRoadTrip(r: RoadTripEntity){
viewModelScope.launch { viewModelScope.launch {

@ -11,7 +11,11 @@
tools:layout="@layout/fragment_roadtrip" > tools:layout="@layout/fragment_roadtrip" >
<action <action
android:id="@+id/action_roadTripFragment_to_roadtripDetail" android:id="@+id/action_roadTripFragment_to_roadtripDetail"
app:destination="@id/roadtripDetail" /> app:destination="@id/roadtripDetail"
app:enterAnim="@android:anim/slide_in_left"
app:exitAnim="@android:anim/slide_out_right"
app:popEnterAnim="@android:anim/slide_in_left"
app:popExitAnim="@android:anim/slide_out_right" />
</fragment> </fragment>
<fragment <fragment
android:id="@+id/roadtripDetail" android:id="@+id/roadtripDetail"

@ -2,6 +2,6 @@
plugins { plugins {
id 'com.android.application' version '7.3.0' apply false id 'com.android.application' version '7.3.0' apply false
id 'com.android.library' version '7.3.0' apply false id 'com.android.library' version '7.3.0' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false id 'org.jetbrains.kotlin.android' version '1.8.20' apply false
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false
} }
Loading…
Cancel
Save