DKU-MUST Mobile ICT Education Center 11. AdapterView.

Slides:



Advertisements
Similar presentations
Chapter 3 – Web Design Tables & Page Layout
Advertisements

Android UserInterfaces Nasrullah Niazi. overView All user interface elements in an Android app are built using View and ViewGroup objects. A View is an.
Android User Interface
Android Selection Widgets Yuliana Setiowati Rizky Yuniar Hakkun 1Politeknik Elektronika Negeri Surabaya.
Chapter 3: Engage! Android User Input, Variables, and Operations
Unlocking Android Chapter 4.  Understanding activities and views  Exploring the Activity lifecycle  Working with resources  Defining the AndroidManifest.xml.
 User Interface - Raeha Sandalwala.  Introduction to UI  Layouts  UI Controls  Menus and ‘Toasts’  Notifications  Other interesting UIs ◦ ListView.
Filip Debelić What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android,
By: Jeremy Smith.  Introduction  Droid Draw  Add XML file  Layouts  LinearLayout  RelativeLayout  Objects  Notifications  Toast  Status Bar.
Using the File Manager WebCT 6. Understanding File Manager The File Manager is the area where all course files are stored. Whenever you link a file in.
Layout and Control in UI The user interface (UI) is the graphical interface user can see and interact with your app comprising UI controls like textbox,
Cosc 4730 Android TabActivity and ListView. TabActivity A TabActivity allows for multiple “tabs”. – Each Tab is it’s own activity and the “root” activity.
Android Development (Basics)
CS378 - Mobile Computing User Interface Basics MIKE!! LOOK HERE FOR intercepting the ListView items:
Android: Layouts David Meredith
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 9: Customize! Navigating with a Master/Detail.
CS5103 Software Engineering Lecture 08 Android Development II.
Chapter 5: Investigate! Lists, Arrays, and Web Browsers.
Chapter 9: Customize! Navigating with Tabs on a Tablet App.
How-To: Office XP PowerPoint By Allen Kuceba PowerPoint The infamous white screen intimidates many new users when they start a new PowerPoint These steps.
Chapter 2: Simplify! The Android User Interface
Tip Calculator App Building an Android App with Java © by Pearson Education, Inc. All Rights Reserved.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 5: Investigate! Android Lists, Arrays,
ANDROID – INTERFACE AND LAYOUT L. Grewe. Interfaces: Two Alternatives Code or XML  You have two ways you can create the interface(s) of your Application.
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
Frank Xu Gannon University.  Linear Layout  Relative Layout  Table Layout.
Mobile Computing Lecture#11 Adapters and Dialogs.
Domain 3 Understanding the Adobe Dreamweaver CS5 Interface.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
ListView.
Engage! Android User Input, Variables,
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 7: Reveal! Displaying Pictures in a GridView.
Programming Mobile Applications with Android September, Albacete, Spain Jesus Martínez-Gómez.
Android Boot Camp for Developers Using Java, 3E
User Interfaces: Part 1 (View Groups and Layouts).
Chapter 7: Reveal! Displaying Pictures in a Gallery.
Configuring Android Development Environment Nilesh Singh.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 15 Advanced Tables.
1 Chapter 12: Form Builder Objects and Flexible Code.
WaveMaker Visual AJAX Studio 4.0 Training Basics: Building Your First Application Designer Basics.
First Venture into the Android World Chapter 1 Part 2.
Copyright© Jeffrey Jongko, Ateneo de Manila University Custom ListAdapters.
By Felixberto Dominic B. Eruela.  Using a computer to create, edit, and print documents. Of all computer applications, word processing is the most common.
By: Ms. Abeer Helwa 1. CREATE A WORD DOCUMENT 2 Blank document Templates To create a new blank document: click the File tab and click Blank document.
January 2006Colby College ITS Setting Up Course Pages.
MOBILE COMPUTING D10K-7D02 MC05: Android UI Design Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran.
ListView and ExpandableListView
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Adapters 1 CS440. Adapters (again!)  Adapters are bridging classes, that bind data to user-interface Views. The adapter is responsible for creating the.
CS378 - Mobile Computing User Interface Basics. User Interface Elements View – Control – ViewGroup Layout Widget (Compound Control) Many pre built Views.
Positioning Objects with CSS and Tables
Building User Interfaces Basic Applications
Chapter 28. Copyright 2003, Paradigm Publishing Inc. CHAPTER 28 BACKNEXTEND 28-2 LINKS TO OBJECTIVES Table Calculations Table Properties Fields in a Table.
Integrating Components and Dynamic Text Boxes with the Animated Map– Lesson 101 Integrating Components and Dynamic Text Boxes with the Animated Map Lesson.
Http :// developer. android. com / guide / topics / fundamentals. html.
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Chapter 5: Investigate! Lists, Arrays, and Web Browsers.
CS499 – Mobile Application Development
Weebly Elements, Continued
Android Development: Advanced Widgets using Adapters
Android Lists and Fragments
Building User Interfaces Basic Applications
Android Topics Custom ArrayAdapters
HNDIT2417 Mobile Application Development
ListView ? BaseAdapter ?.
Reactive Android Development
Korea Software HRD Center
UI Elements 2.
Presentation transcript:

DKU-MUST Mobile ICT Education Center 11. AdapterView

Page  2 Goal How to learn the ListView and GridView How to learn the Gallery and Spinner

Page  3 1. ListView, GridView ▶ AdapterView  Overview the AdapterView An AdapterView is a view whose children are determined by an Adapter See ListView, GridView, Spinner and Gallery for commonly used subclasses of AdapterView used together with the ArrayAdapter class. -A concrete BaseAdapter that is backed by an array of arbitrary objects. By default this class expects that the provided resource id references a single TextView. If you want to use a more complex layout, use the constructors that also takes a field id. That field id should reference a TextView in the larger layout resource. -However the TextView is referenced, it will be filled with the toString() of each object in the array. You can add lists or arrays of custom objects. Override the toString() method of your objects to determine what text will be displayed for the item in the list. -To use something other than TextViews for the array display, for instance, ImageViews, or to have some of data besides toString() results fill the views, override getView(int, View, ViewGroup) to return the type of view you want.

Page  4 1. ListView, GridView ▶ AdapterView  Overview the AdapterView

Page  5  ListView Overview A view that shows items in a vertically scrolling list. The items come from the ListAdapter associated with this view  Create a ListView using XML Coding the between and Java Code : Fill the data in the ListView ① 리스트뷰에 나열할 내용을 미리 String 배열로 만들어 놓는다. ② 리스트뷰 변수를 생성하고 XML 의 에 대응시킨다. ③ ArrayAdapter 형의 변수를 선언하고, 리스트뷰의 모양과 내용을 ①번 배열로 채운다. ④ ③번에서 생성한 어레이어댑터를 ②번의 리스트뷰 변수에 적용시킨다. ⑤ 리스트뷰의 항목을 클릭했을 때 동작하는 리스너를 정의한다. 1. ListView, GridView ▶ ListView

Page  6  Example of Basic ListView(1/2) : XML Code 1. ListView, GridView ▶ ListView

Page  7  Example of Basic ListView(2/2) : Java Code 1. ListView, GridView ▶ ListView

Page  8  Setting the ListView of the various appearance RadioButton : simple_list_item_single_choice CheckBox : simple_list_item_multiple_choice 1. ListView, GridView ▶ ListView

Page  9  Dynamically add/delete of the ListView Define the ArrayList, and Using the add( ), remove( ) method  Example - Dynamically add/delete of the ListView(1/2) : XML Code 1. ListView, GridView ▶ ListView

Page  10  Example-Dynamically add/delete of the ListView(2/2) : JAVA Code 1. ListView, GridView ▶ ListView

Page  11 [Practice 11-1] Movie Poster 1 (1/6)  Using a GridView grid to put multiple pictures(movie poster). If you click on the movie poster, poster emerges as a dialog box.  Project Info. Project Name : Project11_1 Package Name : com.cookandroid.project11_1 build SDK : Goolge API 15 or 16 Minimum Required SDK : API 15 or 16 Activity Name : Project11_1Activity Layout Name : main Title : Project11_1 1. ListView, GridView ▶ GridView

Page  12  Design the Screen Add a GridView in the main.xml Add a dialog.xml(For a large poster) Copy the 10 image(using the movie poster) in the /res/drawable-hdpi 1. ListView, GridView ▶ GridView [Practice 11-1] Movie Poster 1 (2/6)

Page  13  Java coding 1 Defined the MyGridAdapter Inherits BaseAdapter 1. ListView, GridView ▶ GridView [Practice 11-1] Movie Poster 1 (3/6)

Page  14  Java coding 2 Movie poster picture file ID is specified as an array 1. ListView, GridView ▶ GridView [Practice 11-1] Movie Poster 1 (4/6)

Page  15  Java coding 3 Update the getCount( ) and getView() metgod 1. ListView, GridView ▶ GridView [Practice 11-1] Movie Poster 1 (5/6)

Page  16  Java coding 4 1. ListView, GridView ▶ GridView [Practice 11-1] Movie Poster 1 (6/6)

Page  17  Update the [Practice 11-1] - When you click the movie poster, show the title in the another dialog page - update the icon Hint define the string array(same count the posterID) [Self Test 11-1] 1. ListView, GridView ▶ GridView

Page  Gallery, Spinner ▶ Gallery  Gallery Overview A view that shows items in a center-locked, horizontally scrolling list. The default values for the Gallery assume you will be using Theme_galleryItemBackground as the background for each View given to the Gallery from the Adapter. If you are not doing this, you may need to adjust some Gallery properties, such as the spacing. Views given to the Gallery should use Gallery.LayoutParams as their layout parameters type. 사진이나 이미지를 배치하고 좌우로 스크롤해서 볼 수 있도록 해준다. 이미지 목록을 스크롤하는 기능만 있으므로 이미지를 클릭하면 큰 이미지를 보이게 하는 방법은 Java 코드를 추가하여 사용 그리드뷰와 효과는 비슷하지만 좀 더 부드럽고 고급스런 느낌

Page  19 [Practice 11-2] Movie Poster 2 (1/5)  Make the Movie Poster Using the gallery When you click the movie poster, show the original size of the image in the ImageView  Project Info. Project Name : Project11_2 Package Name : com.cookandroid.project11_2 build SDK : Goolge API 15 or 16 Minimum Required SDK : API 15 or 16 Activity Name : Project11_2Activity Layout Name : main Title : Project11_2 2. Gallery, Spinner ▶ Gallery

Page  20  Design the Screen Andd a Gallery and ImageView in the main.xml Copy the 10 movie poster image in the /res/drawable-hdpi folder 2. Gallery, Spinner ▶ Gallery [Practice 11-2] Movie Poster 2 (2/5)

Page  21  Java Coding 1 Define the MyGalleryAdapter MyGalleryAdapter inderits from BaseAdapter Applied to the MyGalleryAdapter variable on the GridView of the main.xml 2. Gallery, Spinner ▶ Gallery [Practice 11-2] Movie Poster 2 (3/5)

Page  22  Java Coding 2 Update the getCount( ) and getView( ) method. 2. Gallery, Spinner ▶ Gallery [Practice 11-2] Movie Poster 2 (4/5)

Page  23  Java Coding 3 When you click the movie image in the gallery, show the original size of the image in the ImageView. 2. Gallery, Spinner ▶ Gallery [Practice 11-2] Movie Poster 2 (5/5)

Page  24  Update the [practice 11-2] When you click the movie poster, show the Toast message(movie title) Toast mssage appears with an icon. [Self Test 11-2] 2. Gallery, Spinner ▶ Gallery

Page  25  Overview the Spinner Spinners provide a quick way to select one value from a set. In the default state, a spinner shows its currently selected value. Touching the spinner displays a dropdown menu with all other available values, from which the user can select a new one.  Example of the Spinner(1/2) : XML Code 2. Gallery, Spinner ▶ Spinner

Page  26  Example of the Spinner(2/2) : Java Code 2. Gallery, Spinner ▶ Spinner

Page  27  Update the Spinner example When you select the movie title in the spinner, show the movie poster in the ImageView. Hint: Using the setOnItemSelectedListener( ) method of the Spinner [Self Test 11-3] 2. Gallery, Spinner ▶ Spinner

DKU-MUST Mobile ICT Education Center