Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 10 compilation fixes #2898

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions platform/android/MapboxGLAndroidSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ android {
disable 'MissingTranslation', 'TypographyQuotes', 'ObsoleteLintCustomCheck', 'MissingPermission', 'WrongThreadInterprocedural'
warningsAsErrors false
}

compileOptions {
sourceCompatibility = 11
targetCompatibility = 11
}

kotlinOptions {
jvmTarget = "11"
}
}

licenseReport {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class GeoJsonSource : Source {
/**
* @return The url or null
*/
@get:Deprecated("use {@link #getUri()} instead")
@Deprecated("use {@link #getUri()} instead")
get() {
return getUrlInternal()
}
Expand Down
8 changes: 4 additions & 4 deletions platform/android/MapboxGLAndroidSDKLint/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ dependencies {
testImplementation dependenciesList.lintTests
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"
sourceCompatibility = "11"
targetCompatibility = "11"

compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}
}

compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}
}

Expand Down
15 changes: 10 additions & 5 deletions platform/android/MapboxGLAndroidSDKTestApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id 'com.android.application'
}

apply plugin: 'kotlin-android'
apply from: "${rootDir}/gradle/native-build.gradle"

android {
Expand All @@ -18,11 +19,6 @@ android {
multiDexEnabled = true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

nativeBuild(["example-custom-layer"])
packagingOptions {
resources {
Expand Down Expand Up @@ -59,6 +55,15 @@ android {
disable 'MissingTranslation', 'GoogleAppIndexingWarning', 'UnpackedNativeCode', 'IconDipSize', 'TypographyQuotes'
warningsAsErrors true
}

compileOptions {
sourceCompatibility = 11
targetCompatibility = 11
}

kotlinOptions {
jvmTarget = "11"
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mapbox.mapboxsdk.testapp.view
package org.maplibre.android.testapp.view

import android.content.Context
import android.util.AttributeSet
Expand All @@ -16,7 +16,7 @@ class LockableBottomSheetBehavior<V : View?>(context: Context, attrs: AttributeS

override fun onInterceptTouchEvent(
parent: CoordinatorLayout,
child: V,
child: V & Any,
event: MotionEvent
): Boolean {
var handled = false
Expand All @@ -26,7 +26,11 @@ class LockableBottomSheetBehavior<V : View?>(context: Context, attrs: AttributeS
return handled
}

override fun onTouchEvent(parent: CoordinatorLayout, child: V, event: MotionEvent): Boolean {
override fun onTouchEvent(
parent: CoordinatorLayout,
child: V & Any,
event: MotionEvent
): Boolean {
var handled = false
if (!locked) {
handled = super.onTouchEvent(parent, child, event)
Expand All @@ -36,7 +40,7 @@ class LockableBottomSheetBehavior<V : View?>(context: Context, attrs: AttributeS

override fun onStartNestedScroll(
coordinatorLayout: CoordinatorLayout,
child: V,
child: V & Any,
directTargetChild: View,
target: View,
nestedScrollAxes: Int
Expand All @@ -56,7 +60,7 @@ class LockableBottomSheetBehavior<V : View?>(context: Context, attrs: AttributeS

override fun onNestedPreScroll(
coordinatorLayout: CoordinatorLayout,
child: V,
child: V & Any,
target: View,
dx: Int,
dy: Int,
Expand All @@ -67,15 +71,19 @@ class LockableBottomSheetBehavior<V : View?>(context: Context, attrs: AttributeS
}
}

override fun onStopNestedScroll(coordinatorLayout: CoordinatorLayout, child: V, target: View) {
override fun onStopNestedScroll(
coordinatorLayout: CoordinatorLayout,
child: V & Any,
target: View
) {
if (!locked) {
super.onStopNestedScroll(coordinatorLayout, child, target)
}
}

override fun onNestedPreFling(
coordinatorLayout: CoordinatorLayout,
child: V,
child: V & Any,
target: View,
velocityX: Float,
velocityY: Float
Expand Down
2 changes: 1 addition & 1 deletion platform/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.0'
classpath 'com.android.tools.build:gradle:8.7.0'
classpath dependenciesList.licensesPlugin
classpath dependenciesList.kotlinPlugin
// classpath dependenciesList.jacocoPlugin
Expand Down
5 changes: 4 additions & 1 deletion platform/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
android.useAndroidX=true
systemProp.org.gradle.internal.http.connectionTimeout=360000
systemProp.org.gradle.internal.http.socketTimeout=360000
org.gradle.jvmargs=-Xmx4096M
org.gradle.jvmargs=-Xmx4096M
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
4 changes: 2 additions & 2 deletions platform/android/gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ ext {
robolectric : '4.9.1',
timber : '5.0.1',
okhttp : '4.10.0',
kotlin : '1.7.20',
licenses : '0.8.80',
kotlin : '2.0.20',
licenses : '0.9.8',
lint : '30.3.1',
// jacoco : '0.8.5',
appcenter : '1.5',
Expand Down
6 changes: 3 additions & 3 deletions platform/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Dec 15 15:24:50 PST 2022
#Thu Oct 03 18:19:48 EEST 2024
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading