01.2 Layouts and Resources For The UI
01.2 Layouts and Resources For The UI
Build your
first app
Lesson 1
Views
Button CheckBox
EditText RadioButton
Slider Switch
android:<property_name>="@<resource_type>/resource_id"
Example: android:text="@string/button_label_next"
android:<property_name>="@+id/view_id"
Example: android:id="@+id/show_count"
linearL.addView(myText);
setContentView(linearL);
1. Resizing handle
2. Constraint line and
handle
3. Constraint handle
4. Baseline handle
● View:
R.id.recyclerview
rv = (RecyclerView) findViewById(R.id.recyclerview);
● String:
In Java: R.string.title
In XML: android:text="@string/title"
Layouts and This work is licensed under a
Android Developer resources for Creative Commons Attribution 4.0 53
Fundamentals V2 the UI International License
Measurements
● Density-independent Pixels (dp): for Views
● Scale-independent Pixels (sp): for text
● Concept Chapter:
1.2 Layouts and resources for the UI
● Practicals:
○ 1.2A : Your first interactive UI
○ 1.2B : The layout editor