fcamuso

App Android video 02

Sep 2nd, 2025
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 1.49 KB | None | 0 0
  1. package com.example.testandroid
  2.  
  3. import android.os.Bundle
  4. import android.text.Html
  5. import androidx.activity.ComponentActivity
  6. import androidx.activity.compose.setContent
  7. import androidx.compose.foundation.Image
  8. import androidx.compose.foundation.layout.Column
  9. import androidx.compose.foundation.layout.Row
  10. import androidx.compose.material3.Button
  11.  
  12. import androidx.compose.material3.Text
  13. import androidx.compose.runtime.Composable
  14. import androidx.compose.ui.graphics.Color
  15. import androidx.compose.ui.res.painterResource
  16. import androidx.compose.ui.unit.sp
  17.  
  18. class MainActivity : ComponentActivity() {
  19.     override fun onCreate(savedInstanceState: Bundle?) {
  20.         super.onCreate(savedInstanceState)
  21.  
  22.         setContent {
  23.             MinimalGreeting(
  24.                 name = "Mondo"
  25.             )
  26.         }
  27.     }
  28. }
  29.  
  30. @Composable
  31. fun MinimalGreeting(name: String) {
  32.     Column {
  33.         Row {
  34.  
  35.             Button(
  36.                 onClick = {
  37.                 }
  38.             ) {
  39.                 Text(text = "Clicca qui", fontSize = 25.sp)
  40.             }
  41.  
  42.             Text(
  43.                 text = "  Ciao $name!",
  44.                 color = Color.Red,
  45.                 fontSize = 40.sp
  46.             )
  47.         }
  48.  
  49.         Image(
  50.             painter = painterResource(id = R.drawable.foca),
  51.             contentDescription = "Cutie"
  52.         )
  53.  
  54.         Image(
  55.             painter = painterResource(id = R.drawable.ciuco),
  56.             contentDescription = "Cutie"
  57.         )
  58.     }
  59. }
  60.  
  61.  
Advertisement
Add Comment
Please, Sign In to add comment