Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import dev.zacsweers.metro.BindingContainer
import dev.zacsweers.metro.Binds
import dev.zacsweers.metro.ContributesTo
import dev.zacsweers.metro.IntoMap
import dev.zacsweers.metro.Origin
import io.element.android.annotations.ContributesNode
import org.jetbrains.kotlin.name.FqName

Expand Down Expand Up @@ -71,12 +72,14 @@ class ContributesNodeProcessor(
val scope = annotation.arguments.find { it.name?.asString() == "scope" }!!.value as KSType
val modulePackage = ksClass.packageName.asString()
val moduleClassName = "${ksClass.simpleName.asString()}_Module"
val nodeClassName = ClassName.bestGuess(ksClass.qualifiedName!!.asString())
val content = FileSpec.builder(
packageName = modulePackage,
fileName = moduleClassName,
)
.addType(
TypeSpec.interfaceBuilder(moduleClassName)
.addAnnotation(AnnotationSpec.builder(Origin::class).addMember("%T::class", nodeClassName).build())
.addAnnotation(BindingContainer::class)
.addAnnotation(AnnotationSpec.builder(ContributesTo::class).addMember("%T::class", scope.toTypeName()).build())
.addFunction(
Expand Down Expand Up @@ -138,6 +141,7 @@ class ContributesNodeProcessor(
.addType(
TypeSpec.interfaceBuilder(assistedFactoryClassName)
.addSuperinterface(ClassName.bestGuess(assistedNodeFactoryFqName.asString()).parameterizedBy(nodeClassName))
.addAnnotation(AnnotationSpec.builder(Origin::class).addMember("%T::class", nodeClassName).build())
.addAnnotation(AssistedFactory::class)
.addFunction(
FunSpec.builder("create")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class WebViewWidgetMessageInterceptor(
return assetLoader.shouldInterceptRequest(request.url)
}

@Suppress("OVERRIDE_DEPRECATION")
override fun shouldInterceptRequest(view: WebView?, url: String): WebResourceResponse? {
return assetLoader.shouldInterceptRequest(url.toUri())
}
Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# We cannot use 8.12.+ since it breaks F-Droid build (see https://github.com/element-hq/element-x-android/issues/3420#issuecomment-3199571010)
android_gradle_plugin = "8.11.1"
# When updateing this, please also update the version in the file ./idea/kotlinc.xml
kotlin = "2.2.10"
kotlin = "2.2.20"
kotlinpoet = "2.2.0"
ksp = "2.2.10-2.0.2"
ksp = "2.2.20-2.0.2"
firebaseAppDistribution = "5.1.1"

# AndroidX
Expand All @@ -34,7 +34,7 @@ accompanist = "0.37.3"
test_core = "1.7.0"

# Jetbrain
datetime = "0.7.1"
datetime = "0.7.1-0.6.x-compat"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need the compat version

serialization_json = "1.9.0"

#other
Expand All @@ -51,7 +51,7 @@ haze = "1.6.10"
dependencyAnalysis = "2.19.0"

# DI
metro = "0.6.4"
metro = "0.6.6"

# Auto service
autoservice = "1.1.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
[email protected]()
}
}
Loading