Created
July 1, 2022 15:54
-
-
Save lucas-marciano/5f641833dd278efd3532db44a1d8a6a9 to your computer and use it in GitHub Desktop.
Simple Compose exemple
This file contains 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
import androidx.compose.runtime.Composable | |
class TodoActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val datainfo = DataInfo("Lucas", "lucas.m@email.com") | |
setContent { | |
MyTheme { | |
Surface { | |
MyComponent(datainfo) | |
} | |
} | |
} | |
} | |
} | |
@Composable | |
private fun MyComponent(data: DataInfo) { | |
Column { | |
Text(text = data.name) | |
Text(text = data.email) | |
} | |
} | |
data class DataInfo( | |
var name: String, | |
var email: String | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment