File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
libraries/maplibre-compose/src/main/kotlin/io/element/android/libraries/maplibre/compose Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 9
9
package io.element.android.libraries.maplibre.compose
10
10
11
11
import android.content.ComponentCallbacks
12
+ import android.content.ComponentCallbacks2
12
13
import android.content.Context
13
14
import android.content.res.Configuration
14
15
import android.os.Bundle
@@ -235,11 +236,16 @@ private fun MapView.lifecycleObserver(previousState: MutableState<Lifecycle.Even
235
236
previousState.value = event
236
237
}
237
238
238
- private fun MapView.componentCallbacks (): ComponentCallbacks =
239
- object : ComponentCallbacks {
240
- override fun onConfigurationChanged (config : Configuration ) {}
239
+ private fun MapView.componentCallbacks (): ComponentCallbacks2 =
240
+ object : ComponentCallbacks2 {
241
+ override fun onConfigurationChanged (config : Configuration ) = Unit
241
242
242
- override fun onLowMemory () {
243
+ // We need to override this method, even if it's deprecated
244
+ @Suppress(" DEPRECATION" )
245
+ override fun onLowMemory () = Unit
246
+
247
+ override fun onTrimMemory (level : Int ) {
248
+ // We call the `MapView.onLowMemory` method for any memory trim level
243
249
this @componentCallbacks.onLowMemory()
244
250
}
245
251
}
You can’t perform that action at this time.
0 commit comments