Skip to content

Instantly share code, notes, and snippets.

View GkEmonGON's full-sized avatar

Mohammad Gk Emon GkEmonGON

  • GetOnNet
  • Norway
View GitHub Profile
@markiyan-antonyuk
markiyan-antonyuk / NativeAdView.kt
Last active March 6, 2025 22:04
Composable NativeAdView
@Composable
fun NativeAdView(
ad: NativeAd,
adContent: @Composable (ad: NativeAd, contentView: View) -> Unit,
) {
val contentViewId by remember { mutableIntStateOf(View.generateViewId()) }
val adViewId by remember { mutableIntStateOf(View.generateViewId()) }
AndroidView(
factory = { context ->
val contentView = ComposeView(context).apply {