Merge pull request #229 from geeksville/dev

updates
This commit is contained in:
Kevin Hester 2021-02-04 09:37:19 +08:00 committed by GitHub
commit 4d2ee50487
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 25 additions and 9 deletions

1
.idea/vcs.xml generated
View file

@ -3,6 +3,7 @@
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/proto" vcs="Git" />
<mapping directory="$PROJECT_DIR$/design" vcs="Git" />
<mapping directory="$PROJECT_DIR$/geeksville-androidlib" vcs="Git" />
<mapping directory="$PROJECT_DIR$/mesh_shared/src/main/proto" vcs="Git" />
</component>

View file

@ -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

View file

@ -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)

View file

@ -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<MapView>(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()
}
}

View file

@ -0,0 +1 @@
app_icon.png

View file

@ -0,0 +1 @@
app_icon.png

View file

@ -0,0 +1 @@
app_icon.png

View file

@ -0,0 +1 @@
app_icon.png

View file

@ -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 {