diff --git a/Readme.md b/Readme.md index 102890d..03f032e 100644 --- a/Readme.md +++ b/Readme.md @@ -22,7 +22,7 @@ startLocationUpdates(interval: Int, maxWaitTime: Int) stopLocationUpdates() # Get last location -getLastKnowLocation() +getLastKnownLocation() # Location updates signal onLocationUpdates(location_data: Dictionary) @@ -67,4 +67,4 @@ onLocationError(errorCode: Int, message: String) distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file + limitations under the License. diff --git a/app/build.gradle b/app/build.gradle index 56550e5..b5a1a9a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,13 +3,13 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 29 - buildToolsVersion "30.0.0" + compileSdkVersion 32 + buildToolsVersion "32.0.0" defaultConfig { applicationId "com.cacaosd.locationplugin" - minSdkVersion 18 - targetSdkVersion 29 + minSdkVersion 19 + targetSdkVersion 32 versionCode 1 versionName "1.0" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3128606..aa50dd0 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,7 +9,8 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> - + diff --git a/build.gradle b/build.gradle index 47ac4cd..1124871 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,12 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.3.72" + ext.kotlin_version = "1.6.0" repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.1' + classpath 'com.android.tools.build:gradle:7.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3422565..aaa2dbf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 26 23:17:30 EET 2020 +#Wed Nov 02 15:00:10 EDT 2022 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +zipStoreBase=GRADLE_USER_HOME diff --git a/locationplugin/build.gradle b/locationplugin/build.gradle index c469fb3..7fb59a5 100644 --- a/locationplugin/build.gradle +++ b/locationplugin/build.gradle @@ -3,14 +3,12 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 29 - buildToolsVersion "30.0.0" + compileSdkVersion 32 + buildToolsVersion "32.0.0" defaultConfig { - minSdkVersion 18 - targetSdkVersion 29 - versionCode 1 - versionName "1.0" + minSdkVersion 19 + targetSdkVersion 32 consumerProguardFiles "consumer-rules.pro" } @@ -32,7 +30,8 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation 'androidx.core:core-ktx:1.3.0' - compileOnly fileTree(dir: "aars", include: ["godot-lib*.aar"]) + implementation 'io.github.m4gr3d:godot:3.5.1.stable' + //impleme ntation fileTree(dir: "aars", include: ["godot-lib*.aar"]) implementation("com.google.android.gms:play-services-location:17.0.0") } \ No newline at end of file diff --git a/locationplugin/src/main/java/com/cacaosd/locationplugin/LocationKotlinPlugin.kt b/locationplugin/src/main/java/com/cacaosd/locationplugin/LocationKotlinPlugin.kt index cb78570..f687047 100644 --- a/locationplugin/src/main/java/com/cacaosd/locationplugin/LocationKotlinPlugin.kt +++ b/locationplugin/src/main/java/com/cacaosd/locationplugin/LocationKotlinPlugin.kt @@ -29,6 +29,7 @@ import org.godotengine.godot.Dictionary import org.godotengine.godot.Godot import org.godotengine.godot.plugin.GodotPlugin import org.godotengine.godot.plugin.SignalInfo +import org.godotengine.godot.plugin.UsedByGodot class LocationKotlinPlugin(godot: Godot) : GodotPlugin(godot) { @@ -71,7 +72,7 @@ class LocationKotlinPlugin(godot: Godot) : GodotPlugin(godot) { return listOf( "startLocationUpdates", "stopLocationUpdates", - "getLastKnowLocation" + "getLastKnownLocation" ) } @@ -94,7 +95,7 @@ class LocationKotlinPlugin(godot: Godot) : GodotPlugin(godot) { } } } - + @UsedByGodot fun startLocationUpdates(interval: Int, maxWaitTime: Int) { if (locationUpdatesStart) return if (ContextCompat.checkSelfPermission(activity!!, Manifest.permission.ACCESS_FINE_LOCATION) @@ -115,7 +116,7 @@ class LocationKotlinPlugin(godot: Godot) : GodotPlugin(godot) { mFusedLocationClient!!.requestLocationUpdates(request, mLocationCallback, Looper.getMainLooper()) Log.d("GODOT", "Location update started.") } - + @UsedByGodot fun stopLocationUpdates() { if (locationUpdatesStart && mLocationCallback != null) { locationUpdatesStart = false @@ -123,8 +124,8 @@ class LocationKotlinPlugin(godot: Godot) : GodotPlugin(godot) { Log.d("GODOT", "Location update stopped.") } } - - fun getLastKnowLocation() { + @UsedByGodot + fun getLastKnownLocation() { if (ContextCompat.checkSelfPermission(activity!!, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED ) {