Start Android notes
AndroidStudio Project consists of Modules, every project can have 1 or more modules. When you "Run" you run needed module not project.
An app consists of a window - an Activity. Each activity consists of one or several elements (buttons, check-boxes, radio buttons etc.), the Android name for this element is View (Button, TextView, ImageView etc.). To collect views into a group of views we use ViewGroup (LenearLayout, RelativeLayout etc.).
To create activity file for the other screen orientation:
left click on res => right click on res => New => Adnroid resource file => Available qualifiers => Orientation
Size of views in the ViewGroup:
- actual size in dp/dpi (dot in one inch)
- constant values - match_parent / wrap_content
- weight:
- weight=0 equals to wrap_content
- weight is the proportion of the view in the 100% of the overall parent ViewGroup. e.g.: button1 has weight=2, button2 has weight=3, button3 has weight=5. so 2+3+5=10 10=100% and 1=10% of the parent ViewGroup actual size.
- LinearLayout can be horizontally or vertically oriented
- RelativeLayout child views are organized relatively to parent or to each other
- FrameLayout - reservers space needed to show a single view (useful with Fragments)
No comments:
Post a Comment