Lecture 3: Views and Viewgroups Flashcards

1
Q

What are the categories Android UI elements can be broken down into?

A
  • Views
  • Viewgroups
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the difference between a view and a viewgroup?

A

View: Any UI element with actual visual presence, (ie: button, text, label)
Viewgroup: An organization tool for views, typically layouts used to organize views

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the purpose of the R file?

A
  • Used during the activity creation to load existing XML layout to use as the UI for the activity
  • Use the R file to reference objects - both views as well as viewgroups within the UI
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Classes that extend the ViewGroup class are typically known as ___

A

layouts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the most important attributes for a viewgroup and how are they defined?

A
  • layout_height
  • layout_width

defined as one of the following:
- integer values
- dp (resolution-independent pixels)
- wrap_content
- match_parent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Whats the difference between wrap_content and match_parent?

A

wrap_content: layout sizes itself to its content
match_parent: layout sizes itself to its parent object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the types of viewgroups discussed in class?

A
  • LinearLayout
  • ConstraintLayout
  • Webviews
  • TableLayout
  • Adapters
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe the linearlayout class

A

Organizes view into a linear list interface

Organizes items vertically or horizontally with the orientation attribute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe the constraintlayout class

A

Lets you define the layout of views relative to other view elements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe the webview class

A

Allows you to render web content within your app (HTML, images, CSS)

Useful for hooking up external web apps to your android app or for pulling resources from an external website for your app

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What type of viewgroup is used to handle UI elements that are going to be dynamically generated at runtime?

A

Adapters

Allow the layout to be dynamically filled using code, rather than predefined XML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly