SlideShare a Scribd company logo
1 of 19
Introduction with Kotlin
Quick Quiz
Composables
This work is licensed under the Apache 2.0 License
Hands-on DiceRoller App
Modifier
What is Jetpack Compose?
Jetpack Compose is a modern toolkit for building
Android UIs. Compose simplifies and accelerates
UI development on Android with less code,
powerful tools, and intuitive Kotlin capabilities.
With Compose, you can build your UI by defining
a set of functions, called composable functions,
that take in data and emit UI elements.
This work is licensed under the Apache 2.0 License
Composable Functions
Composable functions are the basic building block of a UI
in Compose. A composable function:
• Describes some part of your UI.
• Doesn't return anything.
• Takes some input and generates what's shown on
the screen.
• Might emit several UI elements.
Composable Function Naming
The compose function that returns nothing and bears
the @Composable annotation MUST be named using pascal case. Pascal case
refers to a naming convention in which the first letter of each word in a compound
word is capitalized. The difference between pascal case and camel case is that all
words in pascal case are capitalized. In camel case, the first word is not
capitalized.
The Compose function:
• MUST be a noun: DoneButton()
• NOT a verb or verb phrase: DrawTextField()
• NOT a nouned preposition: TextFieldWithLink()
• NOT an adjective: Bright()
• NOT an adverb: Outside()
• Nouns MAY be prefixed by descriptive adjectives: RoundIcon()
@Annotations
Annotations are means of attaching extra information to code. This information helps
tools like the Jetpack Compose compiler, and other developers understand the app's code.
An annotation is applied by prefixing its name(the annotation) with the @ character at the
beginning of the declaration, you are annotating.
Annotations with parameters
This work is licensed under the Apache 2.0 License
UI Hierarchy
There are three basic, standard layout elements in Compose
are Column, Row and Box composables. Column, Row and Box are
composable functions that take composable content as arguments, so you can
place items inside these layout elements.
For example, each child element inside a Row composable is placed
horizontally next to each other in a row.
This work is licensed under the Apache 2.0 License
Box layout is used to stack elements on top of one
another. Box layout also lets us configure the
specific alignment of the elements that it contains.
Box Layout
Modifiers are used to decorate or add behavior to
Jetpack Compose UI elements. For example, you can
add backgrounds, padding or behavior to rows, text,
or buttons. To set them, a composable needs to
accept a modifier as a parameter.
Modifier
This work is licensed under the Apache 2.0 License
This work is licensed under the Apache 2.0 License
Stargazing at State
QUIZ
This work is licensed under the Apache 2.0 License
What is Jetpack Compose?
a.A Modern toolkit to develop
Android UI
b.Toolkit to design libraries
c.Database Interface
d.Plugin to build APK
This work is licensed under the Apache 2.0 License
Composable functions are the basic building block of Compose.?
a. True
b. False
This work is licensed under the Apache 2.0 License
What annotation is used to annotate a Composable function?
a.@Annotation
b.@ComposableFunction
c.@Composable
d.@Preview
This work is licensed under the Apache 2.0 License
The three basic standard layout elements in Compose are
Choose as many answers as you see fit.
a.Column
b.Row
c.Text
d.Box
This work is licensed under the Apache 2.0 License
In Kotlin, the entrypoint of a program is the ___.
a.Println() statement
b.val Variable
c.main() function
d.return() statement
This work is licensed under the Apache 2.0 License
Which function is used is to load a drawable image resource.
a.The stringResource() function
b.The painterResource() function
c.The ImageResource() function
d.The loadResource() function
This work is licensed under the Apache 2.0 License
It is considered best practice to declare a variable that will not change using var instead of val.
a.True
b.False
This work is licensed under the Apache 2.0 License
The Box layout stacks the UI elements on top of one another.
a. True
b. False
This work is licensed under the Apache 2.0 License
What parameter is used to align the child element to the beginning of the parent?
a.Alignment.End
b.Alignment.Begin
c.Alignment.Start
d.Alignment.Top
This work is licensed under the Apache 2.0 License
Lets Build Something…

More Related Content

Similar to compose 3.pptx

COMPOSE CAMP SESSION 4.pdf
COMPOSE CAMP SESSION 4.pdfCOMPOSE CAMP SESSION 4.pdf
COMPOSE CAMP SESSION 4.pdfAbhishekS325285
 
Building a p2 update site using Buckminster
Building a p2 update site using BuckminsterBuilding a p2 update site using Buckminster
Building a p2 update site using Buckminsterguest5e2b6b
 
Introduction to compose camps.pdf
Introduction to compose camps.pdfIntroduction to compose camps.pdf
Introduction to compose camps.pdfAnkurAgarwal151093
 
Introduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itIntroduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itPushkarNiroula1
 
Compose Camp Slide Deck Template.pptx
Compose Camp Slide Deck Template.pptxCompose Camp Slide Deck Template.pptx
Compose Camp Slide Deck Template.pptxGoogleDeveloperStude1
 
Top 10 Techniques For React Performance Optimization in 2022.pptx
Top 10 Techniques For React Performance Optimization in 2022.pptxTop 10 Techniques For React Performance Optimization in 2022.pptx
Top 10 Techniques For React Performance Optimization in 2022.pptxBOSC Tech Labs
 
Compose Camp Day 3 PPT.pptx.pdf
Compose Camp Day 3 PPT.pptx.pdfCompose Camp Day 3 PPT.pptx.pdf
Compose Camp Day 3 PPT.pptx.pdfMETDSC
 
Compose Camp: Introduction to Kotlin.pptx
Compose Camp: Introduction to Kotlin.pptxCompose Camp: Introduction to Kotlin.pptx
Compose Camp: Introduction to Kotlin.pptxAmruthasriAmaravati
 
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...NicheTech Com. Solutions Pvt. Ltd.
 
Compose Camp S1.pptx
Compose Camp S1.pptxCompose Camp S1.pptx
Compose Camp S1.pptxGDSCSIT
 
Compiling and linking of a c code
Compiling and linking of a c codeCompiling and linking of a c code
Compiling and linking of a c codesruthi yandapalli
 
Jetpack Compose.pdf
Jetpack Compose.pdfJetpack Compose.pdf
Jetpack Compose.pdfSumirVats
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360RapidValue
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1ReKruiTIn.com
 

Similar to compose 3.pptx (20)

COMPOSE CAMP SESSION 4.pdf
COMPOSE CAMP SESSION 4.pdfCOMPOSE CAMP SESSION 4.pdf
COMPOSE CAMP SESSION 4.pdf
 
Bcsl 031 solve assignment
Bcsl 031 solve assignmentBcsl 031 solve assignment
Bcsl 031 solve assignment
 
Compose Camp - Session1.pdf
Compose Camp - Session1.pdfCompose Camp - Session1.pdf
Compose Camp - Session1.pdf
 
Building a p2 update site using Buckminster
Building a p2 update site using BuckminsterBuilding a p2 update site using Buckminster
Building a p2 update site using Buckminster
 
Compose Camp.pptx
Compose Camp.pptxCompose Camp.pptx
Compose Camp.pptx
 
Introduction to compose camps.pdf
Introduction to compose camps.pdfIntroduction to compose camps.pdf
Introduction to compose camps.pdf
 
Introduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itIntroduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to it
 
Compose Camp Slide Deck Template.pptx
Compose Camp Slide Deck Template.pptxCompose Camp Slide Deck Template.pptx
Compose Camp Slide Deck Template.pptx
 
Top 10 Techniques For React Performance Optimization in 2022.pptx
Top 10 Techniques For React Performance Optimization in 2022.pptxTop 10 Techniques For React Performance Optimization in 2022.pptx
Top 10 Techniques For React Performance Optimization in 2022.pptx
 
Compose Camp Day 3 PPT.pptx.pdf
Compose Camp Day 3 PPT.pptx.pdfCompose Camp Day 3 PPT.pptx.pdf
Compose Camp Day 3 PPT.pptx.pdf
 
ReactJS.pptx
ReactJS.pptxReactJS.pptx
ReactJS.pptx
 
Compose Camp: Introduction to Kotlin.pptx
Compose Camp: Introduction to Kotlin.pptxCompose Camp: Introduction to Kotlin.pptx
Compose Camp: Introduction to Kotlin.pptx
 
Intro To C++ - Class 14 - Midterm Review
Intro To C++ - Class 14 - Midterm ReviewIntro To C++ - Class 14 - Midterm Review
Intro To C++ - Class 14 - Midterm Review
 
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
Objective of c in IOS , iOS Live Project Training Ahmedabad, MCA Live Project...
 
Compose Camp S1.pptx
Compose Camp S1.pptxCompose Camp S1.pptx
Compose Camp S1.pptx
 
Compiling and linking of a c code
Compiling and linking of a c codeCompiling and linking of a c code
Compiling and linking of a c code
 
T2
T2T2
T2
 
Jetpack Compose.pdf
Jetpack Compose.pdfJetpack Compose.pdf
Jetpack Compose.pdf
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360
 
C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1C, C++ Interview Questions Part - 1
C, C++ Interview Questions Part - 1
 

Recently uploaded

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 

Recently uploaded (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

compose 3.pptx

  • 1. Introduction with Kotlin Quick Quiz Composables This work is licensed under the Apache 2.0 License Hands-on DiceRoller App Modifier
  • 2. What is Jetpack Compose? Jetpack Compose is a modern toolkit for building Android UIs. Compose simplifies and accelerates UI development on Android with less code, powerful tools, and intuitive Kotlin capabilities. With Compose, you can build your UI by defining a set of functions, called composable functions, that take in data and emit UI elements.
  • 3. This work is licensed under the Apache 2.0 License Composable Functions Composable functions are the basic building block of a UI in Compose. A composable function: • Describes some part of your UI. • Doesn't return anything. • Takes some input and generates what's shown on the screen. • Might emit several UI elements.
  • 4. Composable Function Naming The compose function that returns nothing and bears the @Composable annotation MUST be named using pascal case. Pascal case refers to a naming convention in which the first letter of each word in a compound word is capitalized. The difference between pascal case and camel case is that all words in pascal case are capitalized. In camel case, the first word is not capitalized. The Compose function: • MUST be a noun: DoneButton() • NOT a verb or verb phrase: DrawTextField() • NOT a nouned preposition: TextFieldWithLink() • NOT an adjective: Bright() • NOT an adverb: Outside() • Nouns MAY be prefixed by descriptive adjectives: RoundIcon()
  • 5. @Annotations Annotations are means of attaching extra information to code. This information helps tools like the Jetpack Compose compiler, and other developers understand the app's code. An annotation is applied by prefixing its name(the annotation) with the @ character at the beginning of the declaration, you are annotating. Annotations with parameters
  • 6. This work is licensed under the Apache 2.0 License UI Hierarchy There are three basic, standard layout elements in Compose are Column, Row and Box composables. Column, Row and Box are composable functions that take composable content as arguments, so you can place items inside these layout elements. For example, each child element inside a Row composable is placed horizontally next to each other in a row.
  • 7. This work is licensed under the Apache 2.0 License Box layout is used to stack elements on top of one another. Box layout also lets us configure the specific alignment of the elements that it contains. Box Layout Modifiers are used to decorate or add behavior to Jetpack Compose UI elements. For example, you can add backgrounds, padding or behavior to rows, text, or buttons. To set them, a composable needs to accept a modifier as a parameter. Modifier
  • 8. This work is licensed under the Apache 2.0 License
  • 9. This work is licensed under the Apache 2.0 License Stargazing at State QUIZ
  • 10. This work is licensed under the Apache 2.0 License What is Jetpack Compose? a.A Modern toolkit to develop Android UI b.Toolkit to design libraries c.Database Interface d.Plugin to build APK
  • 11. This work is licensed under the Apache 2.0 License Composable functions are the basic building block of Compose.? a. True b. False
  • 12. This work is licensed under the Apache 2.0 License What annotation is used to annotate a Composable function? a.@Annotation b.@ComposableFunction c.@Composable d.@Preview
  • 13. This work is licensed under the Apache 2.0 License The three basic standard layout elements in Compose are Choose as many answers as you see fit. a.Column b.Row c.Text d.Box
  • 14. This work is licensed under the Apache 2.0 License In Kotlin, the entrypoint of a program is the ___. a.Println() statement b.val Variable c.main() function d.return() statement
  • 15. This work is licensed under the Apache 2.0 License Which function is used is to load a drawable image resource. a.The stringResource() function b.The painterResource() function c.The ImageResource() function d.The loadResource() function
  • 16. This work is licensed under the Apache 2.0 License It is considered best practice to declare a variable that will not change using var instead of val. a.True b.False
  • 17. This work is licensed under the Apache 2.0 License The Box layout stacks the UI elements on top of one another. a. True b. False
  • 18. This work is licensed under the Apache 2.0 License What parameter is used to align the child element to the beginning of the parent? a.Alignment.End b.Alignment.Begin c.Alignment.Start d.Alignment.Top
  • 19. This work is licensed under the Apache 2.0 License Lets Build Something…