Skip to content

Commit

Permalink
Upgraded project and general bug fixing (#378)
Browse files Browse the repository at this point in the history
* [NO ISSUE] General bug fixing

* upgrade gradle wrapper and build tools

* upgrade to latest Kotlin version and compiler

* added needed library to avoid crash

* updated version

* upgraded java version to 17

* ktlint error

* corrected button actions

* updated year

* updated year
  • Loading branch information
ferranpons authored Aug 24, 2023
1 parent 9f337e4 commit 0b48005
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 54 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down Expand Up @@ -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.
Expand Down
22 changes: 10 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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'
Expand Down Expand Up @@ -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"
}
6 changes: 3 additions & 3 deletions app/src/main/java/com/adevinta/mappicker/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -276,7 +276,7 @@ fun MainView() {
contentColor = Color.White
),
onClick = {
onMapPoisClicked(context)
onMapWithStylesClicked(context)
}
) {
Text(
Expand All @@ -293,7 +293,7 @@ fun MainView() {
contentColor = Color.White
),
onClick = {
onMapWithStylesClicked(context)
onMapPoisClicked(context)
}
) {
Text(
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<string name="launch_legacy_map_picker" translatable="false">LAUNCH LEGACY MAP LOCATION ACTIVITY</string>
<string name="launch_map_picker_with_pois" translatable="false">LAUNCH MAP WITH POIS</string>
<string name="launch_map_picker_with_style" translatable="false">LAUNCH MAP WITH STYLE</string>
<string name="leku_lib_version" translatable="false">version 10.1.0</string>
<string name="leku_lib_version" translatable="false">version 11.0.0</string>
</resources>
10 changes: 2 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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/'
Expand All @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
2 changes: 1 addition & 1 deletion docs/license.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
6 changes: 5 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
21 changes: 10 additions & 11 deletions leku/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down Expand Up @@ -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") {
Expand All @@ -81,21 +82,19 @@ 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"

def supportTestVersion = '1.4.0'
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'
}
13 changes: 9 additions & 4 deletions leku/src/main/java/com/adevinta/leku/LocationPickerActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ class LocationPickerActivity :
}

override fun onBackPressed() {
super.onBackPressed()
if (!shouldReturnOkOnBackPressed || isLocationInformedFromBundle) {
setResult(Activity.RESULT_CANCELED)
track(TrackEvents.CANCEL)
Expand Down Expand Up @@ -1647,15 +1648,19 @@ class LocationPickerActivity :
private fun fillLocationList(addresses: List<Address>) {
locationList.clear()
locationList.addAll(addresses)
(searchAdapter as LekuSearchAdapter<SearchViewHolder, Address>)
.items = locationList.toList()
searchAdapter?.let {
(searchAdapter as LekuSearchAdapter<SearchViewHolder, Address>)
.items = locationList.toList()
}
}

private fun fillSuggestionList(suggestions: List<PlaceSuggestion>) {
suggestionList.clear()
suggestionList.addAll(suggestions)
(searchAdapter as LekuSearchAdapter<SuggestionViewHolder, PlaceSuggestion>)
?.items = suggestionList.toList()
searchAdapter?.let {
(searchAdapter as LekuSearchAdapter<SuggestionViewHolder, PlaceSuggestion>)
.items = suggestionList.toList()
}
}

private fun closeKeyboard() {
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 0b48005

Please sign in to comment.