Skip to content

Commit

Permalink
roll back osmdroid and update target sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
wuan committed Oct 8, 2023
1 parent 3579f97 commit 312b60e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
9 changes: 5 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
defaultConfig {
applicationId "org.blitzortung.android.app"
minSdkVersion 15
targetSdkVersion 32
targetSdkVersion 33
versionCode 287
versionName '2.1.13'
multiDexEnabled false
Expand Down Expand Up @@ -67,7 +67,7 @@ dependencies {
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.recyclerview:recyclerview:1.3.1'
implementation 'androidx.work:work-runtime-ktx:2.8.1'
implementation 'org.osmdroid:osmdroid-android:6.1.17'
implementation 'org.osmdroid:osmdroid-android:6.1.11'
// waiting for https://github.com/osmdroid/osmdroid/issues/1822

// Dagger2
Expand All @@ -91,7 +91,7 @@ kapt.includeCompileClasspath = false
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

tasks.withType(Test) {
tasks.withType(Test).configureEach {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
testLogging {
Expand All @@ -105,7 +105,8 @@ tasks.withType(Test) {
maxHeapSize = "4g"
}

task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
tasks.register('jacocoTestReport', JacocoReport) {
dependsOn['testDebugUnitTest']

reports {
xml.required.set(true)
Expand Down
13 changes: 6 additions & 7 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<application
android:usesCleartextTraffic="true"
android:name=".BOApplication"
android:hardwareAccelerated="true"
android:icon="@drawable/icon"
android:installLocation="auto"
android:label="@string/app_name"
android:name=".BOApplication"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">

<activity
android:name=".Main"
android:label="@string/app_name"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/org/blitzortung/android/app/AppService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ class AppService : Service(), OnSharedPreferenceChangeListener {
} else {
0
}
pendingIntent = PendingIntent.getService(this, 0, intent, flags)
val pendingIntent = PendingIntent.getService(this, 0, intent, flags)
this.pendingIntent = pendingIntent

val period = (backgroundPeriod * 1000).toLong()
alarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, period, period, pendingIntent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ interface OnSharedPreferenceChangeListener : SharedPreferences.OnSharedPreferenc
keys.forEach { onSharedPreferenceChanged(sharedPreferences, it) }
}

override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, keyString: String) {
val key = PreferenceKey.fromString(keyString)
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, keyString: String?) {
val key = PreferenceKey.fromString(keyString.orEmpty())
key?.also { onSharedPreferenceChanged(sharedPreferences, it) }
}

Expand Down
9 changes: 7 additions & 2 deletions app/src/main/java/org/blitzortung/android/map/OwnMapView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
import androidx.appcompat.app.AlertDialog
import androidx.core.view.GestureDetectorCompat
import org.blitzortung.android.app.Main
import org.blitzortung.android.app.R
import org.blitzortung.android.app.view.PreferenceKey
Expand All @@ -37,7 +38,7 @@ import org.osmdroid.views.MapView

class OwnMapView(context: Context) : MapView(context) {

private val gestureDetector: GestureDetector = GestureDetector(context, GestureListener())
private val gestureDetector: GestureDetectorCompat = GestureDetectorCompat(context, GestureListener())

init {
minZoomLevel = 1.5
Expand Down Expand Up @@ -93,7 +94,11 @@ class OwnMapView(context: Context) : MapView(context) {
}

override fun onTouchEvent(event: MotionEvent): Boolean {
return gestureDetector.onTouchEvent(event)
return if (gestureDetector.onTouchEvent(event)) {
true
} else {
super.onTouchEvent(event)
}
}

val popup: View by lazy { LayoutInflater.from(context).inflate(R.layout.popup, this, false) }
Expand Down

0 comments on commit 312b60e

Please sign in to comment.