Unit Iv: User Interface Widgets
Unit Iv: User Interface Widgets
Unit Iv: User Interface Widgets
android:textStyle It is used to change the style (bold, italic, bold | italic) of text.
android:textStyle It is used to change the style (bold, italic, bold | italic) of text.
android:ems It is used to make the textview be exactly this many ems wide.
TextControl
• TextView
• PlainText
• Password
• Password(Number)
• E-Mail
• Phone
• Postal Address
• Multiline Text
• Time
• Date
• Number
• Number (Signed)
• Number (Decimal)
4.2 Button Control
• In android, Button is a user interface control that is used to perform an
action whenever the user clicks or tap on it.
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView mywebview = (WebView) findViewById(R.id.webView);
mywebview.loadUrl("https://www.google.com/");
}
}
4.6 AnalogClock and DigitalClock Views
• Analog and digital clocks are used for display the time in android
application.
1.Analog clock: Analog clock is a subclass of View class. It represents
a circular clock. Around the circle, numbers 1 to 12 appear to represent
the hour and two hands are used to show instant of the time- shorter
one for the hour and longer is for minutes.
2.Digital clock: Digital clock is subclass of TextView Class and uses
numbers to display the time in “HH:MM” format.
4.5 TimePicker View, DatePicker View
• Date Picker and Timer Picker Dialog in our android application. These
components are used to select date and time in a customized user
interface. We will use DatePickerDialog and TimePickerDialog classes
with Calendar class in our android application code to achieve this.
https://www.journaldev.com/9976/android-date-time-picker-dialog
4.8 Toast Notification
• In android, Toast is a small popup notification that is used to display an
information about the operation which we performed in our app. The Toast
will show the message for a small period of time and it will disappear
automatically after a timeout.
• Generally, the size of Toast will be adjusted based on the space required for
the message and it will be displayed on the top of the main content
of activity for a short period of time.
• For example, some of the apps will show a message like “Press again to
exit” in toast, when we pressed a back button on the home page or showing
a message like “saved successfully” toast when we click on the button to
save the details.
Text controls (For more study-Refer )
4.3 Toggle buttons (For More Study-Refer)
Take a Look
4.8 Toast Notification
• In android, Toast is a small popup notification that is used to display
an information about the operation which we performed in our app.
The Toast will show the message for a small period of time and it will
disappear automatically after a timeout.
• For example, some of the apps will show a message like “Press again
to exit” in toast, when we pressed a back button on the home page or
showing a message like “saved successfully” toast when we click on
the button to save the details.