Update kotlin (#5317)
* Update kotlin * Upgrade Metro and add new `@Origin` annotation * Suppress warnings in overridden method as nothing else would work * "Fix" quality warnings about reusing the same string literal * Don't use `compat` version for `datetime` dependency --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jorge Martín <jorgem@element.io>
This commit is contained in:
parent
68fa054a68
commit
a0ed77775d
5 changed files with 21 additions and 11 deletions
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
package io.element.android.libraries.maplibre.compose
|
||||
|
||||
import android.content.ComponentCallbacks
|
||||
import android.content.ComponentCallbacks2
|
||||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import android.os.Bundle
|
||||
|
|
@ -235,11 +235,15 @@ private fun MapView.lifecycleObserver(previousState: MutableState<Lifecycle.Even
|
|||
previousState.value = event
|
||||
}
|
||||
|
||||
private fun MapView.componentCallbacks(): ComponentCallbacks =
|
||||
object : ComponentCallbacks {
|
||||
override fun onConfigurationChanged(config: Configuration) {}
|
||||
private fun MapView.componentCallbacks(): ComponentCallbacks2 =
|
||||
object : ComponentCallbacks2 {
|
||||
override fun onConfigurationChanged(config: Configuration) = Unit
|
||||
|
||||
override fun onLowMemory() {
|
||||
@Suppress("OVERRIDE_DEPRECATION")
|
||||
override fun onLowMemory() = Unit
|
||||
|
||||
override fun onTrimMemory(level: Int) {
|
||||
// We call the `MapView.onLowMemory` method for any memory trim level
|
||||
this@componentCallbacks.onLowMemory()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue