diff --git a/.idea/vcs.xml b/.idea/vcs.xml index e8f81507d..bc2dfb5ae 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -3,6 +3,7 @@ + diff --git a/app/build.gradle b/app/build.gradle index 112bb7572..fb75ed47a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,8 +31,8 @@ android { applicationId "com.geeksville.mesh" minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works) targetSdkVersion 29 - versionCode 20139 // format is Mmmss (where M is 1+the numeric major number - versionName "1.1.39" + versionCode 20141 // format is Mmmss (where M is 1+the numeric major number + versionName "1.1.41" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" // per https://developer.android.com/studio/write/vector-asset-studio diff --git a/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotifications.kt b/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotifications.kt index ddf55a306..207ea93a1 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotifications.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotifications.kt @@ -73,7 +73,7 @@ class MeshServiceNotifications( val builder = NotificationCompat.Builder(context, channelId).setOngoing(true) .setPriority(NotificationCompat.PRIORITY_MIN) .setCategory(category) - .setSmallIcon(R.drawable.app_icon) + .setSmallIcon(if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) R.drawable.app_icon_novect else R.drawable.app_icon) // vector form icons don't work reliably on older androids .setContentTitle(summaryString) // leave this off for now so our notification looks smaller .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setContentIntent(openAppIntent) diff --git a/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt index 21d5a650c..7a694e408 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt @@ -136,7 +136,7 @@ class MapFragment : ScreenFragment("Map"), Logging { * Mapbox native code can crash painfully if you ever call a mapbox view function while the view is not actively being show */ private val isViewVisible: Boolean - get() = view != null && isResumed + get() = view != null && isResumed && (mapView?.isDestroyed != false) override fun onViewCreated(viewIn: View, savedInstanceState: Bundle?) { super.onViewCreated(viewIn, savedInstanceState) @@ -145,9 +145,9 @@ class MapFragment : ScreenFragment("Map"), Logging { if ((requireContext().applicationContext as GeeksvilleApplication).isAnalyticsAllowed) { val vIn = viewIn.findViewById(R.id.mapView) mapView = vIn - vIn.onCreate(savedInstanceState) - mapView?.let { v -> + v.onCreate(savedInstanceState) + // Each time the pane is shown start fetching new map info (we do this here instead of // onCreate because getMapAsync can die in native code if the view goes away) v.getMapAsync { map -> @@ -205,14 +205,25 @@ class MapFragment : ScreenFragment("Map"), Logging { } override fun onDestroyView() { - mapView?.onDestroy() super.onDestroyView() + mapView?.onDestroy() } override fun onSaveInstanceState(outState: Bundle) { - mapView?.onSaveInstanceState(outState) + mapView?.let { + if (!it.isDestroyed) + it.onSaveInstanceState(outState) + } super.onSaveInstanceState(outState) } + + override fun onLowMemory() { + mapView?.let { + if (!it.isDestroyed) + it.onLowMemory() + } + super.onLowMemory() + } } diff --git a/app/src/main/res/drawable-hdpi/app_icon_novect.png b/app/src/main/res/drawable-hdpi/app_icon_novect.png new file mode 120000 index 000000000..ef5958e92 --- /dev/null +++ b/app/src/main/res/drawable-hdpi/app_icon_novect.png @@ -0,0 +1 @@ +app_icon.png \ No newline at end of file diff --git a/app/src/main/res/drawable-mdpi/app_icon_novect.png b/app/src/main/res/drawable-mdpi/app_icon_novect.png new file mode 120000 index 000000000..ef5958e92 --- /dev/null +++ b/app/src/main/res/drawable-mdpi/app_icon_novect.png @@ -0,0 +1 @@ +app_icon.png \ No newline at end of file diff --git a/app/src/main/res/drawable-xhdpi/app_icon_novect.png b/app/src/main/res/drawable-xhdpi/app_icon_novect.png new file mode 120000 index 000000000..ef5958e92 --- /dev/null +++ b/app/src/main/res/drawable-xhdpi/app_icon_novect.png @@ -0,0 +1 @@ +app_icon.png \ No newline at end of file diff --git a/app/src/main/res/drawable-xxhdpi/app_icon_novect.png b/app/src/main/res/drawable-xxhdpi/app_icon_novect.png new file mode 120000 index 000000000..ef5958e92 --- /dev/null +++ b/app/src/main/res/drawable-xxhdpi/app_icon_novect.png @@ -0,0 +1 @@ +app_icon.png \ No newline at end of file diff --git a/build.gradle b/build.gradle index 5c61f9d69..cfef6d972 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.4.21' + ext.kotlin_version = '1.4.30' ext.coroutines_version = "1.3.9" repositories {