diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 217b26a8..36c6da29 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -13,10 +13,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: set up JDK 11 + - name: set up JDK 17 uses: actions/setup-java@v2 with: - java-version: '11' + java-version: '17' distribution: 'adopt' cache: gradle diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a3551923..7326ab3d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,10 +12,10 @@ jobs: steps: - name: Check out code uses: actions/checkout@v2 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 # Base64 decodes and pipes the GPG key content into the secret file - name: Prepare environment diff --git a/README.md b/README.md index 5461f218..1d86ebdd 100644 --- a/README.md +++ b/README.md @@ -81,14 +81,14 @@ Include the dependency in your app `build.gradle`: ```groovy dependencies { - implementation 'com.adevinta.android:leku:10.1.0' + implementation 'com.adevinta.android:leku:11.0.0' } ``` Alternatively, if you are using a different version of Google Play Services and AndroidX use this instead: ```groovy -implementation ('com.adevinta.android:leku:10.1.0') { +implementation ('com.adevinta.android:leku:11.0.0') { exclude group: 'com.google.android.gms' exclude group: 'androidx.appcompat' } @@ -667,7 +667,7 @@ For bugs, questions and discussions please use the [Github Issues](https://githu License ------- -Copyright 2016-2022 Adevinta Spain S.L. +Copyright 2016-2023 Adevinta Spain S.L. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/app/build.gradle b/app/build.gradle index 6e64456a..dcf96bf4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,11 +4,10 @@ apply plugin: "org.jlleitschuh.gradle.ktlint" apply plugin: "io.gitlab.arturbosch.detekt" android { - compileSdkVersion 33 - defaultConfig { applicationId "com.schibsted.mappicker" minSdkVersion 21 + compileSdk 34 targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -22,15 +21,15 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } buildFeatures { compose true } composeOptions { - kotlinCompilerExtensionVersion '1.1.1' + kotlinCompilerExtensionVersion '1.4.2' } lint { disable 'ObsoleteLintCustomCheck' @@ -67,15 +66,14 @@ ktlint { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.multidex:multidex:2.0.1' - implementation "com.google.android.material:material:1.7.0-beta01" + implementation "com.google.android.material:material:1.11.0-alpha02" implementation "com.google.android.gms:play-services-maps:18.1.0" - implementation 'androidx.activity:activity-compose:1.6.0' - implementation 'androidx.compose.material:material:1.2.1' - implementation 'androidx.compose.animation:animation:1.2.1' - implementation 'androidx.compose.ui:ui-tooling:1.2.1' - implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1' + implementation 'androidx.activity:activity-compose:1.7.2' + implementation 'androidx.compose.material:material:1.5.0' + implementation 'androidx.compose.animation:animation:1.5.0' + implementation 'androidx.compose.ui:ui-tooling:1.5.0' + implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1' implementation project(':leku') - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } diff --git a/app/src/main/java/com/adevinta/mappicker/MainActivity.kt b/app/src/main/java/com/adevinta/mappicker/MainActivity.kt index e7d644a1..f66f3dc1 100644 --- a/app/src/main/java/com/adevinta/mappicker/MainActivity.kt +++ b/app/src/main/java/com/adevinta/mappicker/MainActivity.kt @@ -149,7 +149,7 @@ private fun onLaunchMapPickerClicked(context: Context) { .withSearchZone("es_ES") // .withSearchZone(SearchZoneRect(LatLng(26.525467, -18.910366), LatLng(43.906271, 5.394197))) .withDefaultLocaleSearchZone() - .setCurrentLocation(BitmapDescriptorFactory.fromResource(R.drawable.common_full_open_on_phone)) + // .setCurrentLocation(BitmapDescriptorFactory.fromResource(R.drawable.common_full_open_on_phone)) .setOtherLocation(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE)) // .shouldReturnOkOnBackPressed() // .withStreetHidden() @@ -276,7 +276,7 @@ fun MainView() { contentColor = Color.White ), onClick = { - onMapPoisClicked(context) + onMapWithStylesClicked(context) } ) { Text( @@ -293,7 +293,7 @@ fun MainView() { contentColor = Color.White ), onClick = { - onMapWithStylesClicked(context) + onMapPoisClicked(context) } ) { Text( diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c230989e..4c40aea5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -5,5 +5,5 @@ LAUNCH LEGACY MAP LOCATION ACTIVITY LAUNCH MAP WITH POIS LAUNCH MAP WITH STYLE - version 10.1.0 + version 11.0.0 diff --git a/build.gradle b/build.gradle index 93066317..534524a8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,5 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.8.10' repositories { maven { url 'https://maven.google.com/' @@ -11,11 +9,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' - - // Remove comment when the library is on mavenCentral - //classpath 'com.ferranpons:twitter-gradle-plugin:1.1.0' - + classpath 'com.android.tools.build:gradle:8.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "io.github.gradle-nexus:publish-plugin:1.1.0" classpath("io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.22.0") diff --git a/docs/getting_started.md b/docs/getting_started.md index d21b1eb6..64870d3c 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -18,14 +18,14 @@ Include the dependency in your app `build.gradle`: ```groovy dependencies { - implementation 'com.adevinta.android:leku:10.1.0' + implementation 'com.adevinta.android:leku:11.0.0' } ``` Alternatively, if you are using a different version of Google Play Services and AndroidX use this instead: ```groovy -implementation ('com.adevinta.android:leku:10.1.0') { +implementation ('com.adevinta.android:leku:11.0.0') { exclude group: 'com.google.android.gms' exclude group: 'androidx.appcompat' } diff --git a/docs/license.md b/docs/license.md index b7ee7646..3eb8133b 100644 --- a/docs/license.md +++ b/docs/license.md @@ -1,4 +1,4 @@ -Copyright 2016-2022 Adevinta Spain S.L. +Copyright 2016-2023 Adevinta Spain S.L. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gradle.properties b/gradle.properties index eeb03f1f..4469f847 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,4 +2,8 @@ org.gradle.jvmargs=-Xmx2048m org.gradle.configureondemand=false android.useAndroidX=true libGroup=com.adevinta.android -libVersion=10.1.1 +libVersion=11.0.0 + +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 12c169c6..f9e40d22 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Mar 15 13:33:01 CET 2022 +#Mon Aug 21 11:21:37 CEST 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-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 diff --git a/leku/build.gradle b/leku/build.gradle index 96ba178a..cf8a0f4e 100644 --- a/leku/build.gradle +++ b/leku/build.gradle @@ -9,11 +9,11 @@ ext["PUBLISH_ARTIFACT_ID"] = "leku" apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" android { - compileSdkVersion 33 resourcePrefix 'leku_' defaultConfig { minSdkVersion 21 + compileSdk 34 targetSdkVersion 33 multiDexEnabled true testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -30,11 +30,11 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() + jvmTarget = JavaVersion.VERSION_17.toString() } packagingOptions { resources { @@ -70,8 +70,9 @@ ktlint { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation "com.google.android.material:material:1.7.0-beta01" - implementation 'androidx.fragment:fragment-ktx:1.5.3' + implementation "com.google.android.material:material:1.11.0-alpha02" + implementation 'androidx.fragment:fragment-ktx:1.6.1' + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.6.4" def playServicesVersion = '18.1.0' implementation ("com.google.android.gms:play-services-maps:$playServicesVersion") { @@ -81,13 +82,13 @@ dependencies { exclude group: "com.android.support" } - implementation ("com.google.android.libraries.places:places:2.6.0") { + implementation ("com.google.android.libraries.places:places:3.2.0") { exclude group: "com.android.support" } implementation "com.google.maps:google-maps-services:0.2.9" - def espressoVersion = '3.4.0' + def espressoVersion = '3.5.1' androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion" androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion" @@ -95,7 +96,5 @@ dependencies { androidTestImplementation "androidx.test:runner:$supportTestVersion" androidTestImplementation "androidx.test:rules:$supportTestVersion" androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' - androidTestImplementation 'org.mockito:mockito-core:4.2.0' - - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + androidTestImplementation 'org.mockito:mockito-core:5.4.0' } diff --git a/leku/src/main/java/com/adevinta/leku/LocationPickerActivity.kt b/leku/src/main/java/com/adevinta/leku/LocationPickerActivity.kt index 3e46abd8..2225a2f1 100644 --- a/leku/src/main/java/com/adevinta/leku/LocationPickerActivity.kt +++ b/leku/src/main/java/com/adevinta/leku/LocationPickerActivity.kt @@ -693,6 +693,7 @@ class LocationPickerActivity : } override fun onBackPressed() { + super.onBackPressed() if (!shouldReturnOkOnBackPressed || isLocationInformedFromBundle) { setResult(Activity.RESULT_CANCELED) track(TrackEvents.CANCEL) @@ -1647,15 +1648,19 @@ class LocationPickerActivity : private fun fillLocationList(addresses: List
) { locationList.clear() locationList.addAll(addresses) - (searchAdapter as LekuSearchAdapter) - .items = locationList.toList() + searchAdapter?.let { + (searchAdapter as LekuSearchAdapter) + .items = locationList.toList() + } } private fun fillSuggestionList(suggestions: List) { suggestionList.clear() suggestionList.addAll(suggestions) - (searchAdapter as LekuSearchAdapter) - ?.items = suggestionList.toList() + searchAdapter?.let { + (searchAdapter as LekuSearchAdapter) + .items = suggestionList.toList() + } } private fun closeKeyboard() { diff --git a/mkdocs.yml b/mkdocs.yml index 569a8a6d..039d77e4 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,7 +1,7 @@ # Project information site_name: 'Leku' site_description: ':Map location picker component for Android. Based on Google Maps. An alternative to Google Place Picker.' -site_author: '2016-2022 Adevinta Spain' +site_author: '2016-2023 Adevinta Spain' site_url: 'https://adevintaspain.github.io/Leku/' remote_branch: gh-pages