Created
May 4, 2023 22:52
-
-
Save arriolac/26af72d7038c9153edefd4c3129410cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2023 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
class MyCustomView @JvmOverloads constructor( | |
context: Context, | |
attrs: AttributeSet? = null, | |
defStyle: Int = 0 | |
) : AbstractComposeView(context, attrs, defStyle) { | |
init { | |
// Related lifecycle may not be known at this point yet | |
setViewCompositionStrategy( | |
ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed | |
) | |
} | |
@Composable | |
override fun Content() { | |
// Compose | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment