Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Why Jetpack Comose? ● Modern UI toolkit


Slide 4

Slide 4 text

● Modern UI toolkit
 ● Entirely built in Kotlin


Slide 5

Slide 5 text

● Modern UI toolkit
 ● Entirely built in Kotlin
 ● Accelerate Development


Slide 6

Slide 6 text

● Modern UI toolkit
 ● Entirely built in Kotlin
 ● Accelerate Development
 ● Intuitive Kotlin APIs


Slide 7

Slide 7 text

● Modern UI toolkit
 ● Entirely built in Kotlin
 ● Accelerate Development
 ● Intuitive Kotlin APIs
 ● Less Code


Slide 8

Slide 8 text

● Modern UI toolkit
 ● Entirely built in Kotlin
 ● Accelerate Development
 ● Intuitive Kotlin APIs
 ● Less Code
 ● Powerful tools


Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

● Declarative UI


Slide 11

Slide 11 text

● Declarative UI
 ● Improved code Quality


Slide 12

Slide 12 text

● Declarative UI
 ● Improved code Quality
 ● Better Performance


Slide 13

Slide 13 text

● Declarative UI
 ● Improved code Quality
 ● Better Performance
 ● Real-time Preview and faster Iteration


Slide 14

Slide 14 text

● Declarative UI
 ● Improved code Quality
 ● Better Performance
 ● Real-time Preview and faster Iteration
 ● Reusable UI components


Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

app/build.gradle
 compose_version = 1.5.3


Slide 17

Slide 17 text

MainActivity.kt


Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

● A modifier in Jetpack Compose is a function that can be used to change the appearance or behavior of a composable function. Modifiers can be chained together to create complex effects.
 ● Changing the size, color, padding, and other properties.
 ● Adding behavior to composable functions, such as click listeners and hover effects.
 ● Combining composable functions in different ways to create new layouts.


Slide 20

Slide 20 text

● Spacer is a blank element that is used to create a Space between two UI elements. 
 ● Ex: 
 Spacer(modifier = Modifier.height(16.dp)
 )
 
 
 


Slide 21

Slide 21 text

● A function that is used to create a UI element in Jetpack Compose.
 ● Declarative (describe “what” the UI should look like)
 MainActivity.kt


Slide 22

Slide 22 text

● Text in Jetpack Compose is represented by the Text composable function. 
 
 Surat

Slide 23

Slide 23 text

● A Button in Jetpack Compose is a composable function that represents a clickable button.

Slide 24

Slide 24 text

@Composable fun Demo() { Image( painter = painterResource(R.drawable.img_jay_dp), contentDescription = "Jay" ) }

Slide 25

Slide 25 text

@Composable fun Demo() { Text("1",color = Orange) Text("2",color = Orange) Text("3",color = Orange) } 1 2 3

Slide 26

Slide 26 text

@Composable fun Demo() { Column { Text("1",color = Orange) Text("2",color = Orange) Text("3",color = Orange) } } 3 2 1

Slide 27

Slide 27 text

@Composable fun Demo() { Row{ Text("1",color = Orange) Text("2",color = Orange) Text("3",color = Orange) } } 1 2 3

Slide 28

Slide 28 text

@Composable fun Demo() { Box(Modifier.size(28.dp)) { Text("1", modifier = Modifier.align(Alignment.TopStart)) Text("2", modifier = Modifier.align(Alignment.Center)) Text("3", modifier = Modifier.align(Alignment.BottomEnd)) } } 1 2 3

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

● Column and Row
 ● LazyColumn
 ● LazyRow
 ● ConstraintLayout
 ● Spacer
 ● Padding
 


Slide 31

Slide 31 text

@Composable fun Demo() { Box(Modifier.background(Color.Orange)) { Text( text = "Surat", color = Color.White modifier = Modifier .padding(8.dp) .background(Color.NavyBlue) ) } } Surat

Slide 32

Slide 32 text

./ConstraintLayout> val textView = findViewById(R.id.tv) textView.text = ... Imperative Row{ Image() Column{ Text() Text() } } Declarative

Slide 33

Slide 33 text

View Jetpack Compose MainActivity.kt activity_main.xml MainActivity.kt Composable Screen 1 Composable Screen N

Slide 34

Slide 34 text

// MainActivity.kt class MainActivity: Activity() { override fun onCreate(...) { setContentView(R.layout.activity_main) } } // activity_main.xml ./LinearLayout> View // MainActivity.kt class MainActivity: Activity() { override fun onCreate(...) { setContent{ Greeting() } } } @Composable fun Greeting(){ Text(“Hello World”) } Jetpack Compose

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content