Skip to content

Commit 925f118

Browse files
committed
updated to support android 10 and fixed some bugs
1 parent 2379416 commit 925f118

File tree

7 files changed

+25
-21
lines changed

7 files changed

+25
-21
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ allprojects {
125125

126126
## TODO
127127

128-
- [ ] Add library to jcenter
129128
- [x] migrate to androidX
130129
- [ ] Add kotlin docs
131130
- [ ] Creating geofences

app/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 28
4+
compileSdkVersion 30
55

66
defaultConfig {
77
applicationId "ax.synt.droidlocation.demo"
88
minSdkVersion 15
9-
targetSdkVersion 28
9+
targetSdkVersion 30
1010
versionCode 1
11-
versionName "2.0"
11+
versionName "2.1"
1212
}
1313
buildTypes {
1414
release {
@@ -19,8 +19,8 @@ android {
1919
}
2020

2121
dependencies {
22-
compile fileTree(include: ['*.jar'], dir: 'libs')
23-
compile 'androidx.appcompat:appcompat:1.0.2'
24-
compile project(':droidLocationLibrary')
25-
compile 'com.google.android.gms:play-services-location:16.0.0'
22+
implementation fileTree(include: ['*.jar'], dir: 'libs')
23+
implementation 'androidx.appcompat:appcompat:1.2.0'
24+
implementation project(':droidLocationLibrary')
25+
implementation 'com.google.android.gms:play-services-location:16.0.0'
2626
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
google()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.4.0'
9+
classpath 'com.android.tools.build:gradle:4.1.0'
1010
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
1111
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
1212

droidLocationLibrary/build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ext {
2323
siteUrl = 'https://github.com/syntaxltd/DroidLocation'
2424
gitUrl = 'https://github.com/syntaxltd/DroidLocation.git'
2525

26-
libraryVersion = '2.0.0'
26+
libraryVersion = '2.0.1'
2727

2828
developerId = 'JobGetabu'
2929
developerName = 'Job Getabu'
@@ -35,13 +35,13 @@ ext {
3535
}
3636

3737
android {
38-
compileSdkVersion 28
38+
compileSdkVersion 30
3939

4040
defaultConfig {
4141
minSdkVersion 15
42-
targetSdkVersion 28
42+
targetSdkVersion 30
4343
versionCode 2
44-
versionName "2.0"
44+
versionName "2.1"
4545
}
4646
buildTypes {
4747
release {
@@ -52,11 +52,11 @@ android {
5252
}
5353

5454
dependencies {
55-
compile fileTree(dir: 'libs', include: ['*.jar'])
56-
provided "com.google.android.gms:play-services-location:16.0.0"
55+
implementation fileTree(dir: 'libs', include: ['*.jar'])
56+
compileOnly "com.google.android.gms:play-services-location:16.0.0"
5757

58-
compile 'androidx.appcompat:appcompat:1.0.2'
58+
api 'androidx.appcompat:appcompat:1.2.0'
5959
}
6060

61-
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
62-
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
61+
//apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
62+
//apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'

droidLocationLibrary/src/main/java/ax/synt/droidlocation/DroidLocationActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ protected void onCreate(Bundle savedInstanceState) {
2424
@Override
2525
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
2626
super.onActivityResult(requestCode, resultCode, data);
27+
2728
droidLocationDelegate.showLocationSettingDialog(requestCode);
2829
}
2930

droidLocationLibrary/src/main/java/ax/synt/droidlocation/DroidLocationDelegate.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ public void onClick(DialogInterface dialogInterface, int i) {
136136
@Deprecated
137137
// warning: Use @
138138
private void showLocationServicesRequireDialog() {
139+
if(droidLocationRequest == null) return;
140+
139141
String title = TextUtils.isEmpty(droidLocationRequest.locationSettingsDialogTitle) ? activity.getString(R.string.location_services_off) : droidLocationRequest.locationSettingsDialogTitle;
140142
String message = TextUtils.isEmpty(droidLocationRequest.locationSettingsDialogMessage) ? activity.getString(R.string.open_location_settings) : droidLocationRequest.locationSettingsDialogMessage;
141143
String negativeButtonText = TextUtils.isEmpty(droidLocationRequest.locationSettingsDialogNegativeButtonText) ? activity.getString(android.R.string.cancel) : droidLocationRequest.locationSettingsDialogNegativeButtonText;
@@ -245,8 +247,10 @@ private void checkForPermissionAndRequestLocation(LocationRequest locationReques
245247
showPermissionRequireDialog();
246248
else
247249
requestPermission();
248-
} else
250+
} else{
251+
if(droidLocationRequest == null) return;
249252
startLocationBGService(locationRequest, droidLocationRequest.fallBackToLastLocationTime);
253+
}
250254
}
251255

252256
private void unregisterLocationBroadcastReceiver() {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Apr 26 20:58:16 EAT 2019
1+
#Sun Oct 18 03:52:33 EAT 2020
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

0 commit comments

Comments
 (0)