Copyright© Jeffrey Jongko, Ateneo de Manila University Editing ListAdapter Data part 2.

Slides:



Advertisements
Similar presentations
CE881: Mobile and Social Application Programming Simon M. Lucas Menus and Dialogs.
Advertisements

Tackling Android Fragmentation Dev:Mobile Inmeta consulting 16 klocs – not rocket science.
Android Using Menus Yuliana Setiowati Rizky Yuniar Hakkun Ahmad Syauqi Ahsan 1Politeknik Elektronika Negeri Surabaya.
Style guide exercise Symbian 3 Nelli Kihniä, Hung Nguyen.
 Options Menu ◦ The primary collection of menu items for an activity, which appears when the user touches the MENU button. When your application is running.
 User Interface - Raeha Sandalwala.  Introduction to UI  Layouts  UI Controls  Menus and ‘Toasts’  Notifications  Other interesting UIs ◦ ListView.
User Interface Classes.  Design Principles  Views & Layouts  Event Handling  Menus  Dialogs.
Cosc 5/4730 Blackberry and Android: Menus. BLACKBERRY.
Programming Based on Events
Creating Menu. Objectives Create a menu system for a form –Create a menu –Create a menu titles –Create a menu items –Create a submenu –Modify menu –Edit.
Cosc 4730 Android TabActivity and ListView. TabActivity A TabActivity allows for multiple “tabs”. – Each Tab is it’s own activity and the “root” activity.
1 CGS1060 Mobile UIs Copyright 2012 by Janson Industries.
Lesley Bross, August 25, 2010 ArcGIS 10 Add-In Components and Controls.
PROG Mobile Java Application Development PROG Mobile Java Application Development Event Handling Creating Menus.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
CS5103 Software Engineering Lecture 08 Android Development II.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Concurrency in Android with.
User Group Meeting Dashboard Features Products Customers Vendors Quick Find Menu/Search Shortcuts Popups Key Performance Indicators Tasks.
Favorite Twitter® Searches App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Copyright© Jeffrey Jongko, Ateneo de Manila University Android.
Multiple Forms, Standard Modules, And Menus
Introduction to Object-Oriented Programming
@2011 Mihail L. Sichitiu1 Android Introduction GUI Menu Many thanks to Jun Bum Lim for his help with this tutorial.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Copyright© Jeffrey Jongko, Ateneo de Manila University Of Activities, Intents and Applications.
By BuilderMT BMT Cloud Models and Options Manager by BuilderMT Using Cloud MoM to build and manage a Builder’s Model & Option database BuilderMT Cloud.
CS378 - Mobile Computing More UI - Part 2. Special Menus Two special application menus – options menu – context menu Options menu replaced by action bar.
LEARNING KINDLE FOR PC WITH ACCESSIBILITY AND A SCREEN READER Norman Coombs
Programming Mobile Applications with Android September, Albacete, Spain Jesus Martínez-Gómez.
Copyright© Jeffrey Jongko, Ateneo de Manila University Basic Views and Layouts.
Themes and Menus: The Sudoku Example Content taken from book: “Hello, Android” by Ed Burnette Third Edition.
Using Ajax to Improve uPortal User Experience Jen Bourey Yale University
Copyright© Jeffrey Jongko, Ateneo de Manila University Custom ListAdapters.
Menu Creation Business Rules Menu System By George Tisdale (April 2005)
Copyright © Curt Hill More Components Varying the input of Dev-C++ Windows Programs.
Android Using Menus Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright © CommonsWare, LLC. ISBN:
Android 11: Events, Menus, and the Action Bar Kirk Scott 1.
Styles, Dialog Boxes, and Menus. Styles Allow creation of a common format – placed in res/values/styles.xml – file name is incidental Can be applied.
Mobile Programming Lecture 7 Dialogs, Menus, and SharedPreferences.
Copyright© Jeffrey Jongko, Ateneo de Manila University Deconstructing HelloWorld.
Android Application Lifecycle and Menus
Inheritance and Subclasses CS 21a. 6/28/2004 Copyright 2004, by the authors of these slides, and Ateneo de Manila University. All rights reserved L16:
CS378 - Mobile Computing More UI - Part 2. Special Menus Two special application menus – options menu – context menu Options menu replaced by action bar.
Presented by Syed Baber Development Lead Mazik Global.
Creating Menus Menu Bar – behaves like standard Windows menus Can be used in place of or in addition to buttons to execute a procedure Menu items are controls.
6 Copyright © 2004, Oracle. All rights reserved. Adding Custom Validation.
Log in Register Enter password Forget password Switch User Sign in First time Other Enter user name( ) and password Main Page Enter to retrieve.
Menu Creation 1.Perform a task analysis for Raskin’s idea of user-created menus (p.100). 2.What should the commands for the menu creation system be? NB.
Blaise Senior UX Designer at AllofUs Friend of foxes Android UI The Basics.
Events. Slide 2©SoftMoore Consulting Events Events are generated when a user interacts with the view objects of an application. Examples –button clicked–
Lecture 8 the Preference Menu. Settings... Sudoku settings s Music Play background music Hints Show hints during play We add some strings to the strings.xml.
Chapter 7 Multiple Forms, Modules, and Menus. Section 7.2 MODULES A module contains code—declarations and procedures—that are used by other files in a.
CSCI 6962: Server-side Desig n and Programming ASP Server Controls.
User Interaction Radan Ganchev Astea Solutions. Content Basic input events Gestures Drag and drop Sensors.
Fragments and Menus Chapter 4 1. Objectives Learn three different types of menus: options, context, and popup Learn to configure the ActionBar and Toolbar.
Menus. Menus are a common user interface component in many types of applications. The options menu is the primary collection of menu items for an activity.
Introduction to android
Android Programming - Features
CS499 – Mobile Application Development
CS240: Advanced Programming Concepts
Android 16: Menus Kirk Scott.
Politeknik Elektronika Negeri Surabaya
Mobile Application Development BSCS-7 Lecture # 11
CIS 470 Mobile App Development
Android Topics Custom ArrayAdapters
[Update PPE for Worker] Worker Register
Android Developer Fundamentals V2 Lesson 4
Objects First with Java
Activities and Fragments
Preference Activity class
Presentation transcript:

Copyright© Jeffrey Jongko, Ateneo de Manila University Editing ListAdapter Data part 2

Selection and Touch  Selection and Touch are two different interaction systems in Android  Selection is used when using Arrows/Fire keys  Touch is used when you tap using a touch screen  These two are independent of each other  It is a major UI design issue to be able to handle both cleanly  Usually, focuses on Touch since many phones no longer have arrow/fire keys

Example  When interaction with a ListView you can do the following  Use the arrow keys to move around and use the fire key to select the row  Tap the ListView and row directly  For now, we will focus on the use of Touch

Copyright© Jeffrey Jongko, Ateneo de Manila University Context Sensitive Menus

 Context Sensitive Menus are menus whose contents are dependent on the selected item (the context)  The Activity class is responsible for the creation of these menus and provides methods that need to be overridden (just like the Options menu)

General Steps  To enable Context Menus you need to do the following  Register which view needs context menus  Override onCreateContextMenu()  Override onContextItemSelected()

registerForContextMenu()  For a view to have a context menu, it must be registered to the activity using registerForContextMenu(View)  Any number of views can have context menus, just register them all

Example ListView lv = getListView(); lv.setTextFilterEnabled(true); // NOTE: REGISTER listview for context menu registerForContextMenu(lv);

onCreateContextMenu()  Works similar to the onCreateOptionsMenu()  Use a MenuInflater to initialize the menu based on an XML file  Alternatively you can invoke the menu’s add() method to add options programatically  E.g. for dynamic menus

public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); MenuInflater inflater = getMenuInflater(); // places the contents of the XML to the menu inflater.inflate(R.menu.context_menu, menu); }

Example XML <menu xmlns:android="

onContextItemSelected()  To handle selections override onContextItemSelected(MenuItem item)  Switch against the menuItem’s ID to determine which action was selected  Make sure to propagate the call to the superclass should none of the cases handle the option

AdapterContextMenuInfo  The MenuItem parameter contains a ContextMenuInfo object retrieved from using getMenuInfo()  For a ListView, it returns an AdapterContextMenuInfo instance  The main job of this class is to pass back the  following  target view – which specific view this menu is for  position of the view within the targetView  This will allow you to extract the specific object within the backing data  id of the view within the targetView

public boolean onContextItemSelected(MenuItem item) { AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); switch (item.getItemId()) { case R.id.delete: // delete the currently selected row // NOTE: trigger the changes sampleList.remove(info.position); adapter.notifyDataSetChanged(); return true; default: return super.onContextItemSelected(item); }

Extras  Other menu features  Submenus  MenuGroups  Checkable menus  Shortcut keys  Check out file:///C:/android-sdk- windows/docs/guide/topics/ui/menus.html