Thursday, January 15, 2015

Get Familiar with Android UI Widgets

Toast
Is use to display information for short period of time
Object<-Toast
makeText, setMargin and show() functions mainly used here

CustomToast
We can create custom toast in Android to display image

ToggleButton
Android Toggle Button can be used to display checked/unchecked (On/Off) state on the button.
Object<-View<-TextView<-Button<-CompoundButton<-ToggleButton
getTextOff(), getTextOn() and setChecked(boolean checked) is used here

CheckBox
Android CheckBox is a type of two state button either checked or unchecked.
Object<-View<-TextView<-Button<-CompoundButton<-CheckBox
boolean isChecked(), setChecked(boolean status) is mainly used here

AlertDialog
Android AlertDialog can be used to display the dialog message with OK and Cancel buttons. It has 3 regions title, content area and action buttons
Object<-Dialog<-AlertDialog
setMessage, setCancelable, setPositiveButton mainly used here

Button
There are different types of buttons in android such as RadioButton, ToggleButton, CompoundButton etc.
Object<-View<-TextView<-Button<-CompoundButton

Spinner
Combo Box, e.g. Box to Select List of Countries
Object<-View<-ViewGroup<-AdapterView<-AbsSpinner<-Spinner

AutoCompleteTextView
Android AutoCompleteTextView completes the word based on the reserved words
Object<-View<-TextView<-EditText<-AutoCompleteTextView<-MultiAutoCompleteTextView

RatingBar
Android RatingBar displays the rating in stars
Object<-View<-ProgressBar<-AbsSeekBar<-RatingBar
getRating is the main fn of RatingBar

WebView
Android WebView is used to display web page in android
Object<-View<-ViewGroup<-AbsoluteLayout<-WebView
loadUrl() and loadData() are the main fn of WebView

SeekBar
Android SeekBar is a kind of ProgressBar with draggable thumb
Object<-View<-ProgressBar<-AbsSeekBar<-SeekBar
SeekBar.OnSeekBarChangeListener interface provides methods to perform event handling for seek bar.

DatePicker 
Android DatePicker is a widget to select date
Object<-View<-ViewGroup<-FrameLayout<-DatePicker

TimePicker
It allows you to select time by hour and minute.
Object<-View<-ViewGroup<-FrameLayout<-TimePicker

Analog clock and Digital clock
Android analog and digital clocks are used to show time in android application.

ProgressBar
Object<-Dialog<-AlertDialog<-ProgressDialog
setProgress(), setMessage(), setProgressStyle(), setMax(), show() etc. methods are use

No comments:

Post a Comment