Widgets other views part 1
Download
1 / 38

Widgets & Other Views - Part 1 - PowerPoint PPT Presentation


  • 67 Views
  • Uploaded on

Widgets & Other Views - Part 1. Frank Xu Gannon University. Date Picker. Main.xml. onClickListener -button. A dialog is always created and displayed as a part of an  Activity . You should normally create dialogs from within your Activity's  onCreateDialog ( int )  callback method.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Widgets & Other Views - Part 1' - gerard


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Widgets other views part 1

Widgets & Other Views-Part 1

Frank Xu

Gannon University





A dialog is always created and displayed as a part of an Activity. You should normally create dialogs from within your Activity's onCreateDialog(int) callback method.


This is an Activity callback method that is passed the integer ID given to showDialog(int) (which is called by the button's View.OnClickListener). When the ID matches the switch case defined here, a DatePickerDialog is instantiated with the DatePickerDialog.OnDateSetListener created in the previous step, along with the date variables to initialize the widget date


Hello timepicker

Hello TimePicker


Main xml1
main.xml

  • Start a new project named HelloTimePicker.

  • Open the res/layout/main.xml file and insert the following:


When the user is done setting the time (clicks the "Set" button), the onTimeSet() method is called and it updates the member fields with the new time and updates the layout's TextView


Hello formstuff

Hello button), the FormStuff


Custom button android button xml
Custom Button- android_button.xml button), the 

  • Copy the images on the right into the res/drawable/ directory of your project. These will be used for the different button states.

  • Create a new file in the res/drawable/ directory named android_button.xml. Insert the following XML:

XML file that defines three different images to use for the different button states

Note: The order of the <item> elements is important. When this drawable is referenced, the <item>s are traversed in-order to determine which one is appropriate for the current button state. Because the "normal" image is last, it is only applied when the conditions android:state_pressedandandroid:state_focused have both evaluated false.


Custom button ui
Custom Button -UI button), the 

  • Copy the images on the right into the res/drawable/ directory of your project. These will be used for the different button states.

  • Create a new file in the res/drawable/ directory named android_button.xml. Insert the following XML:

android_button.xml

  • This replaces the normal background image used for buttons throughout the system. In order for the drawable to change its image based on the button state, the image must be applied to the background.


Checkbox

Checkbox button), the 


Edit text

Edit Text button), the 


Radio buttons

Radio Buttons button), the 


Toggle button

Toggle Button button), the 

-alternative to radio buttons 


Rating bar

Rating Bar button), the 


ad