Pertemuan 5 ARFIAN HIDAYAT, S.KOM HT TP://ARFIANHIDAYAT.COM
Materi 1. Jelaskan Input UI Layout berikut : a) Linear Layout b) Relative Layout c) List View d) Grid View 2. Jelaskan Input Control berikut : a) Button
a) TextField
c) Radio Button d) Spinner
b) CheckBox
e) Picker
3. Sebutkan Control apa saja yang terdapat pada gambar ! 4. Jelaskan dan beri contoh apa itu Action Bar ! 5. Jelaskan dan beri contoh apa itu Notification !
Layout A layout defines the visual structure for a user interface, such as the UI for an activity or app widget. You can declare a layout in two ways:
Declare UI elements in XML. Android provides a straightforward XML vocabulary that corresponds to the View classes and subclasses, such as those for widgets and layouts. Instantiate layout elements at runtime. Your application can create View and ViewGroup objects (and manipulate their properties) programmatically.
Linier Layout Linear layout akan menampilkan elemen-elemen View secara garis lurus, baik vertical ataupun horizontal.
Menggunakan terlalu banyak Nested layout akan membuat performance aplikasi semakin lambat. Semakin banyak layout yang dibuat, semakin lama pula aplikasi untuk me-render tampilan.
Cara yang lebih baik untuk membuat tata letak tidak “monoton” adalah dengan menggunakan RelativeLayout.
Relative Layout RelativeLayout memungkinkan pengguna menyusun tata letak secara lebih leluasa.
Posisi setiap widget bisa diatur relatif pada widget yang lainnya (dibawah, atau disamping widget sebelumnya).
Table Layout Yang perlu dipahami dalam pembuatan layout dengan TableLayout adalah bagaimana widget atau View bekerja dengan baris dan kolom. Tabel layout di Android bekerja dengan cara yang sama layout tabel HTML bekerja. Anda dapat membagi tata letak Anda ke dalam baris dan kolom.
Scroll View ScrollView memungkin para developer membuat tampilan layout lebih panjang dari space layar. Dengan menggunakan ScrollView, sebagian informasi akan muncul dalam satu waktu, sisanya akan muncul jika pengguna melakukan scroll ke atas atau ke bawah.
List View ListView is a view group that displays a list of scrollable items.
The list items are automatically inserted to the list using an Adapter that pulls content from a source such as an array or database query and converts each item result into a view that's placed into the list.
Grid View GridView is a ViewGroup that displays items in a twodimensional, scrollable grid.
The grid items are automatically inserted to the layout using a ListAdapter.
Input Control
Control Type Description Button A push-button that can be pressed, or clicked, by the user to perform an action. Text field An editable text field. You can use the AutoCompleteTextView widget to create a text entry widget that provides auto-complete suggestions Checkbox An on/off switch that can be toggled by the user. You should use checkboxes when presenting users with a group of selectable options that are not mutually exclusive. Radio Similar to checkboxes, except that only one option can be selected in button the group. Toggle An on/off button with a light indicator. button Spinner A drop-down list that allows users to select one value from a set. Pickers A dialog for users to select a single value for a set by using up/down buttons or via a swipe gesture. Use aDatePickercode> widget to enter the values for the date (month, day, year) or a TimePicker widget to enter the values for a time (hour, minute, AM/PM), which will be formatted automatically for the user's locale.
Related Classes Button EditText,AutoCompl eteTextView CheckBox
RadioGroup RadioButton ToggleButton
Spinner DatePicker, TimePicker
Button
TextField "text" Normal text keyboard. "textEmailAddress" Normal text keyboard with the @ character. "textUri" Normal text keyboard with the / character. "number" Basic number keypad. "phone"
Phone-style keypad.
Check Box Widget ini merupakan widget dengan dua pernyataan, checked atau unchecked.
Radio Button Sama seperti CheckBox, widget ini menyediakan dua pernyataan berupa cecked atau unchecked. Tetapi berbeda dengan CheckBox, RadioButton hanya bisa dipilih salah satu saja dari item yang disediakan.
Spinner Spinners provide a quick way to select one value from a set
Picker Android provides controls for the user to pick a time or pick a date as ready-to-use dialogs. Each picker provides controls for selecting each part of the time (hour, minute, AM/PM) or date (month, day, year). Using these pickers helps ensure that your users can pick a time or date that is valid, formatted correctly, and adjusted to the user's locale.
Action Bar The action bar provides several key functions: 1.
Provides a dedicated space for giving your app an identity and indicating the user's location in the app.
2.
Makes important actions prominent and accessible in a predictable way (such as Search).
3.
Supports consistent navigation and view switching within apps (with tabs or drop-down lists).
Notification 1.
Content title
2.
Large icon
3.
Content text
4.
Content info
5.
Small icon
6.
Time that the notification was issued.
Sumber 1.
http://developer.android.com/guide/topics/ui/index.html
2.
Dyah Fajar Nur Rohmah | Modul Android
3.
Modul Kuliah Program Aplikasi Mobile – Emha Taufiq Luthfi
4.
http://shinigamirulez.blogspot.com/2013/11/Layout-Android.html