Skip to content

Commit 86fd2d6

Browse files
committed
Fix compat permission check
1 parent f3925ce commit 86fd2d6

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ dependencies {
4545
annotationProcessor 'androidx.room:room-compiler:2.3.0'
4646
implementation 'net.danlew:android.joda:2.10.1'
4747
implementation 'com.github.k3b:k3b-geoHelper:1.1.5'
48-
api 'io.ticofab.androidgpxparser:parser:1.4.0'
48+
implementation 'com.github.ticofab:android-gpx-parser:2.0.1'
4949
implementation('com.squareup.picasso:picasso:2.71828') {
5050
exclude group: 'com.android.support', module: 'support-v4'
5151
exclude group: 'com.android.support', module: 'appcompat-v7'

app/src/main/java/org/nitri/opentopo/LocationDetailFragment.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public class LocationDetailFragment extends DialogFragment {
2424
@Override
2525
public Dialog onCreateDialog(Bundle savedInstanceState) {
2626

27-
2827
AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity());
2928
LayoutInflater inflater = requireActivity().getLayoutInflater();
3029

app/src/main/java/org/nitri/opentopo/MapFragment.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import androidx.annotation.Nullable;
3434
import androidx.appcompat.app.AlertDialog;
3535
import androidx.appcompat.app.AppCompatActivity;
36+
import androidx.core.app.ActivityCompat;
3637
import androidx.fragment.app.Fragment;
3738
import androidx.fragment.app.FragmentActivity;
3839
import androidx.fragment.app.FragmentManager;
@@ -185,7 +186,7 @@ public void onCreate(Bundle savedInstanceState) {
185186
mLocationViewModel.getCurrentNmea().setValue(s);
186187
}
187188
};
188-
if (requireActivity().checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
189+
if (ActivityCompat.checkSelfPermission(requireActivity(), Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
189190
mLocationManager.addNmeaListener(nmeaListener);
190191
}
191192
}
@@ -501,7 +502,7 @@ void setGpx(Gpx gpx, boolean zoom) {
501502

502503
private void showGpxdialog() {
503504
final AlertDialog.Builder builder;
504-
builder = new AlertDialog.Builder(Objects.requireNonNull(getActivity()), R.style.AlertDialogTheme);
505+
builder = new AlertDialog.Builder(requireActivity(), R.style.AlertDialogTheme);
505506
builder.setTitle(getString(R.string.gpx))
506507
.setMessage(getString(R.string.discard_current_gpx))
507508
.setPositiveButton(android.R.string.ok, (dialog, which) -> {

app/src/main/java/org/nitri/opentopo/nearby/repo/NearbyRepository.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public class NearbyRepository {
2828
private final double mLatitude;
2929
private final double mLongitude;
3030

31-
3231
public NearbyRepository(NearbyDao dao, MediaWikiApi api, double latitude, double longitude) {
3332
mDao = dao;
3433
mApi = api;

build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@ buildscript {
44

55
repositories {
66
google()
7-
jcenter()
7+
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:4.1.1'
10+
classpath 'com.android.tools.build:gradle:4.1.3'
1111
}
1212
}
1313

1414
allprojects {
1515
repositories {
1616
google()
17-
jcenter()
1817
mavenCentral()
1918
maven {
2019
url 'https://www.jitpack.io'

0 commit comments

Comments
 (0)