Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

04 layout design and basic widget

64 views

Published on

layout design and basic widget

Published in: Technology
  • Be the first to comment

  • Be the first to like this

04 layout design and basic widget

  1. 1. Layout Design Anuchit Chalothorn anoochit@gmail.com
  2. 2. Layout design Android has 3 basic layout design LinearLayout (horizontal, vertical), Relativelayout and ConstraintLayout.
  3. 3. Codelab: Layout design Create new activities with 2 widget TextView and Button in LinearLayout (horizontal, vertical), Relativelayout and ConstraintLayout.
  4. 4. LinearLayout Horizontal
  5. 5. LinearLayout Vertical
  6. 6. RelativeLayout Vertical
  7. 7. ConstraintLayout Vertical
  8. 8. TextView Attribute ● android:textColor="#33333" ● android:text="Hello World" ● android:textSize="30sp" Methods ● getText ● setText ● setTypeFace
  9. 9. EditText XML Attribute ● android:inputType="text" Methods ● getText ● setText
  10. 10. EditText : inputType ● text ● textPersonName ● textPassword ● numberPassword ● textEmailAddress ● phone ● textPostalAddress ● textMultiLine ● time ● date ● number ● numberSigned ● numberDecimal
  11. 11. Button XML Attribute ● android:style="?android:attr/butt onStyleSmall ● android:text="Button" Methods ● setOnClickListener
  12. 12. Checkbox Methods ● isChecked ● setChecked(true) ● setOnClickListener
  13. 13. Radiobutton Use with RadioGroup widget, methods ● isChecked ● Toggle ● setOnClickListener
  14. 14. Toggle Button XML Attribute ● android:textOn="Vibrate on" ● android:textOff="Vibrate off" Methods ● setOnCheckedChangeListener
  15. 15. Codelab: Calculator app layout Use button and textview to create calculator app and change button id prepare for next codelab
  16. 16. Codelab: Layout design with widget Create basic form with widget, choose your own layout design.

×