SlideShare ist ein Scribd-Unternehmen logo
1 von 62
Downloaden Sie, um offline zu lesen
HIT3328 / HIT8328 Software Development for
Mobile Devices
Dr. Rajesh Vasa, 2011
1
Twitter: @rvasa
Blog: http://rvasa.blogspot.com
Lecture 07
Dialogs, Tabs and
Lists
R. Vasa, 20122
Lecture Overview
•A short Detour into Design Patterns
•Dialogs
•Tabbed Layouts
•Enhancing Lists
R. Vasa, 20123
Design Patterns
•A general reusable solution to a commonly
occurring problem in software design
•Typically cover,
•Algorithm strategy
•Computational design
•Execution
•Implementation strategy
•Structural design
R. Vasa, 20124
API designers use these
patterns
•API designers use a number of these
patterns
•If you can recognise the patterns used -- it
will help you,
•learn the API faster & use it better
•understand the underlying problem that
motivated designers to choose the pattern
•Improve your own code by adapting the
pattern (assuming the pattern used by API
designer is good)
R. Vasa, 20125
API Design - Android Example
•Android API designers built their SDK
around the Method Chaining and Builder
pattern in many instances
•What are they? Why have they used it?
R. Vasa, 20126
Quick Concept Clarification
•Before we go into the pattern in depth
•We need to know the following:
•Mutable Vs Immutable objects
•Command-Query Separation Principle
•Fluent Interfaces
R. Vasa, 20127
Mutable vs Immutable Objects
•In Object oriented languages -- some
objects are designed to be immutable
•That is, once created -- they are constants
•In Java -- Strings are immutable
•Constant (immutable) offer better memory
allocation strategies
•However, if we change these objects too
often -- then we pay a high price
R. Vasa, 20128
Immutable Vs Mutable Objects
•In Java, if we perform a large number of
string modifications
•It is better to use StringBuffer
•StringBuffer is Mutable (can be changed)
•During design (over years) we discovered
that mutable objects should have certain
design properties
•But -- our thinking was boxed!!!!
R. Vasa, 20129
Command - Query Separation
Principle
•Good Object Oriented design should ensure
that a method is either a command or a
query
•Simply put,
•getName() -- Query -- Should not change
state
•setName() -- Command -- Can change state
•Methods that perform both are considered
poor practice
This principle boxed our thinking (to some extentThis principle boxed our thinking (to some extent)
R. Vasa, 20121
Command - Query Separation
Principle
•Consequences of this principle,
•“set” Methods should not return (i.e. void)
•This principle has influenced quite a large
pool of API code (Java, .NET and others)
•Side-effect,
•We end up writing a large number of set
methods
•Often one per line
R. Vasa, 20121
Command-Query Principle At
Work
private void makeNormalOrder(Customer customer)
{
Order o1 = new Order();
customer.addOrder(o1);
OrderLine line1 = new OrderLine(6, Product.find("TAL"));
o1.addLine(line1);
OrderLine line2 = new OrderLine(5, Product.find("HPK"));
o1.addLine(line2);
OrderLine line3 = new OrderLine(3, Product.find("LGV"));
o1.addLine(line3);
line2.setSkippable(true);
o1.setRush(true);
}
Commands and Queries are clearly separatedCommands and Queries are clearly separated
Example from:
http://martinfowler.com/bliki/FluentInterface.html
R. Vasa, 20121
Command-Query Principle At
Work
private void makeNormalOrder(Customer customer)
{
Order o1 = new Order();
customer.addOrder(o1);
OrderLine line1 = new OrderLine(6, Product.find("TAL"));
o1.addLine(line1);
OrderLine line2 = new OrderLine(5, Product.find("HPK"));
o1.addLine(line2);
OrderLine line3 = new OrderLine(3, Product.find("LGV"));
o1.addLine(line3);
line2.setSkippable(true);
o1.setRush(true);
}
Example from:
http://martinfowler.com/bliki/FluentInterface.html
Code is needlessly messy, long and convolutedCode is needlessly messy, long and convoluted
R. Vasa, 20121
Fluent Interface
•The concept is that we should write code
that is better to read
•That is, it communicates the intent much
more clearly
R. Vasa, 20121
Fluent Interfaces Example
private void makeFluentOrder(Customer customer)
{
customer.newOrder()
.with(6, "TAL")
.with(5, "HPK").skippable()
.with(3, "LGV")
.priorityRush();
}
Example from:
http://martinfowler.com/bliki/FluentInterface.html
Easier to read -- but is C-Q still followed?Easier to read -- but is C-Q still followed?
Commands change state and return --
but intent of the principle is not really
violated
Commands change state and return --
but intent of the principle is not really
violated
R. Vasa, 20121
Fluent Interfaces & C-Q
Principle
private void makeFluentOrder(Customer customer)
{
customer.newOrder()
.with(6, "TAL")
.with(5, "HPK").skippable()
.with(3, "LGV")
.priorityRush();
}
Example from:
http://martinfowler.com/bliki/FluentInterface.html
with() methods [commands]
update and return the order
object
with() methods [commands]
update and return the order
object
public Order with(int i, String string)public Order with(int i, String string)
R. Vasa, 20121
Method Chaining Pattern
private void makeFluentOrder(Customer customer)
{
customer.newOrder()
.with(6, "TAL")
.with(5, "HPK").skippable()
.with(3, "LGV")
.priorityRush();
}
Method Chaining Pattern - Object
is mutated and returned back
Method Chaining Pattern - Object
is mutated and returned back
R. Vasa, 20121
Back to Android API Design
•Android SDK designers are influenced by
these ideas around fluent interfaces and
method chaining
•They combine it with the Builder Pattern to
help construct layouts and views
•This pattern is highlighted in the examples
that follow ....
R. Vasa, 20121
Lecture Roadmap - Where are
we?
•A short Detour into Design Patterns
•Dialogs
•Tabbed Layouts
•Enhancing Lists
R. Vasa, 20121
Dialogs
• How long have I been alive?
Date Dialog Alert Dialog
R. Vasa, 20122
Dialogs are flexible
Date Dialog
(SDK Provided)
Custom Alert
Dialog
Title and Icon
R. Vasa, 20122
Dialogs are flexible
Date Dialog
(SDK Provided)
Custom Alert
Dialog
Title and Icon
Message
R. Vasa, 20122
Dialogs are flexible
Date Dialog
(SDK Provided)
Custom Alert
Dialog
Title and Icon
Message
Control
Buttons
R. Vasa, 20122
Dialogs are useful for error
messages
Custom Alert
Dialog
Ideal for simple error messages
R. Vasa, 20122
Date Picker Dialog
private MutableDateTime mdt = new
MutableDateTime(1990,1,1,10,10,0,0);
Mutable Date Time from Joda Time library (see
sample code)
We can set a default date value for the dialog
R. Vasa, 20122
Short Problem - Usability
Question
•In this context, what should be the default
date shown?
20 years ago Current
Should it be something else? -- Is it important?
R. Vasa, 20122
Constructing Custom Alter
Dialogs
This code uses a built-in icon,
but can be any appropriate
drawable
This code uses a built-in icon,
but can be any appropriate
drawable
See
http://androiddrawableexplorer.appspot.com/
for a full list of built-in drawable resources
and their names
R. Vasa, 20122
Constructing Custom Alter
Dialogs
We can set buttons
(positive/negative/neutral)
We can set buttons
(positive/negative/neutral)
R. Vasa, 20122
Constructing Custom Alter
Dialogs
Button Click
implementatio
n
Button Click
implementatio
n
R. Vasa, 20122
Deconstructing the Patterns in
Use
Dialog Builder - Inner ClassDialog Builder - Inner Class
Method Chaining PatternMethod Chaining Pattern
R. Vasa, 20123
Showing a Dialog
public void onBackPressed()
{
showDialog(EXIT_DIALOG);
}
This is a method
provided by the
Activity class
This is a method
provided by the
Activity class
We have to provide
these constants for
the call-back
We have to provide
these constants for
the call-back
R. Vasa, 20123
Dialogs are Constructed via
Call-Backs
public void onBackPressed()
{
showDialog(EXIT_DIALOG);
}
Triggers
the call
back
This is
displayed to
the user
This is
displayed to
the user
R. Vasa, 20123
Why go through so much
trouble?public void onBackPressed()
{
showDialog(EXIT_DIALOG);
}
Because dialogs needs a
parent Activity for life cycle
management
Because dialogs needs a
parent Activity for life cycle
management
Offers
separation of
concerns
Offers
separation of
concerns
R. Vasa, 20123
Lecture Roadmap - Where are
we?
•A short Detour into Design Patterns
•Dialogs
•Tabbed Layouts
•Enhancing Lists
R. Vasa, 20123
Tabbed Layouts
R. Vasa, 20123
Tabbed Layouts - Concepts
Tab Host (container)
R. Vasa, 20123
Tabbed Layouts - Concepts
Tab Widget
Tab Host (container)
R. Vasa, 20123
Tabbed Layouts - Concepts
Tab Host (container)
Tab Widget
Frame Layout is used to
switch the visible content
for a tab
R. Vasa, 20123
Layout of a Tabbed App.
bHost contains the TabWidget and the FrameLayo
R. Vasa, 20123
Layout of a Tabbed App.
Two views in
the frame
layout to
switch around
Two views in
the frame
layout to
switch around
R. Vasa, 20124
Wiring up the Activity
Method chaining usedMethod chaining used
R. Vasa, 20124
Wiring up the Activity
TabSpec
populates the tab
widget
TabSpec
populates the tab
widget
R. Vasa, 20124
Tabs need multiple icon
resources
Selected Icon Unselected Icon
We have to provide both icons to improve look & feelWe have to provide both icons to improve look & feel
R. Vasa, 20124
Working with Multiple Icons
State information is provided as a drawable resourceState information is provided as a drawable resource
Note: XML file is
placed in the
drawable folder
R. Vasa, 20124
Using Icon State Information
Icon selection is managed
by SDK (via convention)
Icon selection is managed
by SDK (via convention)
R. Vasa, 20124
Tabs can load different
activities
•If a tab needs to start a new activity,
•We need to start it with Intents
R. Vasa, 20124
Tabs can load different
activities
Intent is reused in this example --
because this method copies the
value internally
Intent is reused in this example --
because this method copies the
value internally
Method Chaining used hereMethod Chaining used here
R. Vasa, 20124
Lecture Roadmap - Where are
we?
•A short Detour into Design Patterns
•Dialogs
•Tabbed Layouts
•Enhancing Lists
R. Vasa, 20124
Enhancing Lists
Latitude / Longitude
Example
Drop down
showing
matching options
Drop down
showing
matching options
R. Vasa, 20124
Recall: Lists get data via an
Adapter
ListView
Data Source
Adapter
R. Vasa, 20125
We can tie an adapter to Edit
Text View
Data Adapter set for AutoCompleteTextView
R. Vasa, 20125
Listening to Selection
cityView.addTextChangedListener(this);
public class LatLongActivity extends Activity implements TextWatcher
R. Vasa, 20125
Listening to Selection
cityView.addTextChangedListener(this);
public class LatLongActivity extends Activity implements TextWatcher
R. Vasa, 20125
Lecture Roadmap - Where are
we?
•A short Detour into Design Patterns
•Dialogs
•Tabbed Layouts
•Enhancing Lists (with images)
R. Vasa, 20125
Lists with Images
Latitude / Longitude
Example
Melbourne & Sydney have
special images. Rest use
same icon
Melbourne & Sydney have
special images. Rest use
same icon
R. Vasa, 20125
Custom List Row
We can specify a
custom layout for rows
in a list
We can specify a
custom layout for rows
in a list
R. Vasa, 20125
Custom List Row
Layout provides the
default icon to show for
each row item
Layout provides the
default icon to show for
each row item
R. Vasa, 20125
We provide a custom row
adapter
•The standard adapter will display using a
pre-defined (SDK provided) layout
•We have to override this behaviour with our
own “row” rendering functionality
// use custom row adapter
setListAdapter(new RowIconAdapter());
public class LatLongActivity extends ListActivity
Note: See Sample Code for details
R. Vasa, 20125
Custom Row Adapter
class RowIconAdapter extends ArrayAdapter<String>
{
public RowIconAdapter()
{super(LatLongActivity.this, R.layout.listrow, R.id.row_label, cityNames);}
public View getView(int pos, View cView, ViewGroup parent)
{
View row = super.getView(pos, cView, parent); // DEFAULT ROW
ImageView icon = (ImageView) row.findViewById(R.id.row_icon);
String city = cityNames[pos];
if (city.startsWith("Melb"))
icon.setImageResource(R.drawable.melbourne);
else if (city.startsWith("Syd"))
icon.setImageResource(R.drawable.sydney);
else
icon.setImageResource(R.drawable.location);
return row;
}}
R. Vasa, 20125
A Few List View Related Issues
As we scroll down, we get more
cities
R. Vasa, 20126
A Few List View Related Issues
View objects on Rows not
shown are destroyed as we
scroll up/down
View objects on Rows not
shown are destroyed as we
scroll up/down
Only 7
rows
(views) are
kept in
RAM
R. Vasa, 20126
A Few List View Related Issues
View objects on Rows not shown
are destroyed as we scroll
up/down
View objects on Rows not shown
are destroyed as we scroll
up/down
Design Tip: Make sure that rows
are constructed as quickly as
possible
Design Tip: Make sure that rows
are constructed as quickly as
possible
R. Vasa, 20126
Lecture Roadmap - Where are
we?
•A short Detour into Design Patterns
•Dialogs
•Tabbed Layouts
•Enhancing Lists

Weitere ähnliche Inhalte

Ähnlich wie HIT3328 - Chapter0701 - Dialogs, Tabs and Lists

HIT3328 - Chapter03 - Simple Interactive Apps
HIT3328 - Chapter03 - Simple Interactive AppsHIT3328 - Chapter03 - Simple Interactive Apps
HIT3328 - Chapter03 - Simple Interactive AppsYhal Htet Aung
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principlesdeonpmeyer
 
III - Better angularjs
III - Better angularjsIII - Better angularjs
III - Better angularjsWebF
 
Refactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 RecapRefactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 RecapDave Orme
 
Azure DevOps for Developers
Azure DevOps for DevelopersAzure DevOps for Developers
Azure DevOps for DevelopersSarah Dutkiewicz
 
Agile_goa_2013_clean_code_tdd
Agile_goa_2013_clean_code_tddAgile_goa_2013_clean_code_tdd
Agile_goa_2013_clean_code_tddSrinivasa GV
 
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital.AI
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The EnterpriseDaniel Egan
 
Building data pipelines at Shopee with DEC
Building data pipelines at Shopee with DECBuilding data pipelines at Shopee with DEC
Building data pipelines at Shopee with DECRim Zaidullin
 
Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts
Oracle ADF Architecture TV - Design - Advanced ADF Task Flow ConceptsOracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts
Oracle ADF Architecture TV - Design - Advanced ADF Task Flow ConceptsChris Muir
 
Change RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDBChange RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDBApaichon Punopas
 
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...jaxLondonConference
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9google
 
55 New Features in Java SE 8
55 New Features in Java SE 855 New Features in Java SE 8
55 New Features in Java SE 8Simon Ritter
 
Action-Domain-Responder: A Web-Specific Refinement of Model-View-Controller
Action-Domain-Responder: A Web-Specific Refinement of Model-View-ControllerAction-Domain-Responder: A Web-Specific Refinement of Model-View-Controller
Action-Domain-Responder: A Web-Specific Refinement of Model-View-ControllerPaul Jones
 
Java jdk-update-nov10-sde-v3m
Java jdk-update-nov10-sde-v3mJava jdk-update-nov10-sde-v3m
Java jdk-update-nov10-sde-v3mSteve Elliott
 

Ähnlich wie HIT3328 - Chapter0701 - Dialogs, Tabs and Lists (20)

HIT3328 - Chapter03 - Simple Interactive Apps
HIT3328 - Chapter03 - Simple Interactive AppsHIT3328 - Chapter03 - Simple Interactive Apps
HIT3328 - Chapter03 - Simple Interactive Apps
 
Dao example
Dao exampleDao example
Dao example
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
 
III - Better angularjs
III - Better angularjsIII - Better angularjs
III - Better angularjs
 
Refactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 RecapRefactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 Recap
 
Azure DevOps for Developers
Azure DevOps for DevelopersAzure DevOps for Developers
Azure DevOps for Developers
 
Agile_goa_2013_clean_code_tdd
Agile_goa_2013_clean_code_tddAgile_goa_2013_clean_code_tdd
Agile_goa_2013_clean_code_tdd
 
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
 
Best practices tekx
Best practices tekxBest practices tekx
Best practices tekx
 
Building data pipelines at Shopee with DEC
Building data pipelines at Shopee with DECBuilding data pipelines at Shopee with DEC
Building data pipelines at Shopee with DEC
 
Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts
Oracle ADF Architecture TV - Design - Advanced ADF Task Flow ConceptsOracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts
Oracle ADF Architecture TV - Design - Advanced ADF Task Flow Concepts
 
Change RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDBChange RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDB
 
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9
 
55 New Features in Java SE 8
55 New Features in Java SE 855 New Features in Java SE 8
55 New Features in Java SE 8
 
Action-Domain-Responder: A Web-Specific Refinement of Model-View-Controller
Action-Domain-Responder: A Web-Specific Refinement of Model-View-ControllerAction-Domain-Responder: A Web-Specific Refinement of Model-View-Controller
Action-Domain-Responder: A Web-Specific Refinement of Model-View-Controller
 
Java jdk-update-nov10-sde-v3m
Java jdk-update-nov10-sde-v3mJava jdk-update-nov10-sde-v3m
Java jdk-update-nov10-sde-v3m
 

Mehr von Yhal Htet Aung

HIT3328 - Chapter02 - Foundation and Tools
HIT3328 - Chapter02 - Foundation and ToolsHIT3328 - Chapter02 - Foundation and Tools
HIT3328 - Chapter02 - Foundation and ToolsYhal Htet Aung
 
HIT3328 - Chapter04 - Complex Interactions
HIT3328 - Chapter04 - Complex InteractionsHIT3328 - Chapter04 - Complex Interactions
HIT3328 - Chapter04 - Complex InteractionsYhal Htet Aung
 
HIT3328 - Chapter01 - Platforms and Devices
HIT3328 - Chapter01 - Platforms and DevicesHIT3328 - Chapter01 - Platforms and Devices
HIT3328 - Chapter01 - Platforms and DevicesYhal Htet Aung
 
CSC1100 - Chapter11 - Programming Languages and Program Development
CSC1100 - Chapter11 - Programming Languages and Program DevelopmentCSC1100 - Chapter11 - Programming Languages and Program Development
CSC1100 - Chapter11 - Programming Languages and Program DevelopmentYhal Htet Aung
 
CSC1100 - Chapter10 - Information System
CSC1100 - Chapter10 - Information SystemCSC1100 - Chapter10 - Information System
CSC1100 - Chapter10 - Information SystemYhal Htet Aung
 
CSC1100 - Chapter09 - Computer Security, Ethics and Privacy
CSC1100 - Chapter09 - Computer Security, Ethics and PrivacyCSC1100 - Chapter09 - Computer Security, Ethics and Privacy
CSC1100 - Chapter09 - Computer Security, Ethics and PrivacyYhal Htet Aung
 
CSC1100 - Chapter08 - Database Management
CSC1100 - Chapter08 - Database ManagementCSC1100 - Chapter08 - Database Management
CSC1100 - Chapter08 - Database ManagementYhal Htet Aung
 
CSC1100 - Chapter07 - Communications & Networks
CSC1100 - Chapter07 - Communications & NetworksCSC1100 - Chapter07 - Communications & Networks
CSC1100 - Chapter07 - Communications & NetworksYhal Htet Aung
 
CSC1100 - Chapter05 - Storage
CSC1100 - Chapter05 - StorageCSC1100 - Chapter05 - Storage
CSC1100 - Chapter05 - StorageYhal Htet Aung
 
CSC1100 - Chapter04 - Output
CSC1100 - Chapter04 - OutputCSC1100 - Chapter04 - Output
CSC1100 - Chapter04 - OutputYhal Htet Aung
 
CSC1100 - Chapter02 - Components of the System Unit
CSC1100 - Chapter02 - Components of the System UnitCSC1100 - Chapter02 - Components of the System Unit
CSC1100 - Chapter02 - Components of the System UnitYhal Htet Aung
 
CSC1100 - Chapter01 - Overview of Using Computers
CSC1100 - Chapter01 - Overview of Using ComputersCSC1100 - Chapter01 - Overview of Using Computers
CSC1100 - Chapter01 - Overview of Using ComputersYhal Htet Aung
 
CSC1100 - Chapter12 - Flow Charts
CSC1100 - Chapter12 - Flow ChartsCSC1100 - Chapter12 - Flow Charts
CSC1100 - Chapter12 - Flow ChartsYhal Htet Aung
 

Mehr von Yhal Htet Aung (13)

HIT3328 - Chapter02 - Foundation and Tools
HIT3328 - Chapter02 - Foundation and ToolsHIT3328 - Chapter02 - Foundation and Tools
HIT3328 - Chapter02 - Foundation and Tools
 
HIT3328 - Chapter04 - Complex Interactions
HIT3328 - Chapter04 - Complex InteractionsHIT3328 - Chapter04 - Complex Interactions
HIT3328 - Chapter04 - Complex Interactions
 
HIT3328 - Chapter01 - Platforms and Devices
HIT3328 - Chapter01 - Platforms and DevicesHIT3328 - Chapter01 - Platforms and Devices
HIT3328 - Chapter01 - Platforms and Devices
 
CSC1100 - Chapter11 - Programming Languages and Program Development
CSC1100 - Chapter11 - Programming Languages and Program DevelopmentCSC1100 - Chapter11 - Programming Languages and Program Development
CSC1100 - Chapter11 - Programming Languages and Program Development
 
CSC1100 - Chapter10 - Information System
CSC1100 - Chapter10 - Information SystemCSC1100 - Chapter10 - Information System
CSC1100 - Chapter10 - Information System
 
CSC1100 - Chapter09 - Computer Security, Ethics and Privacy
CSC1100 - Chapter09 - Computer Security, Ethics and PrivacyCSC1100 - Chapter09 - Computer Security, Ethics and Privacy
CSC1100 - Chapter09 - Computer Security, Ethics and Privacy
 
CSC1100 - Chapter08 - Database Management
CSC1100 - Chapter08 - Database ManagementCSC1100 - Chapter08 - Database Management
CSC1100 - Chapter08 - Database Management
 
CSC1100 - Chapter07 - Communications & Networks
CSC1100 - Chapter07 - Communications & NetworksCSC1100 - Chapter07 - Communications & Networks
CSC1100 - Chapter07 - Communications & Networks
 
CSC1100 - Chapter05 - Storage
CSC1100 - Chapter05 - StorageCSC1100 - Chapter05 - Storage
CSC1100 - Chapter05 - Storage
 
CSC1100 - Chapter04 - Output
CSC1100 - Chapter04 - OutputCSC1100 - Chapter04 - Output
CSC1100 - Chapter04 - Output
 
CSC1100 - Chapter02 - Components of the System Unit
CSC1100 - Chapter02 - Components of the System UnitCSC1100 - Chapter02 - Components of the System Unit
CSC1100 - Chapter02 - Components of the System Unit
 
CSC1100 - Chapter01 - Overview of Using Computers
CSC1100 - Chapter01 - Overview of Using ComputersCSC1100 - Chapter01 - Overview of Using Computers
CSC1100 - Chapter01 - Overview of Using Computers
 
CSC1100 - Chapter12 - Flow Charts
CSC1100 - Chapter12 - Flow ChartsCSC1100 - Chapter12 - Flow Charts
CSC1100 - Chapter12 - Flow Charts
 

Kürzlich hochgeladen

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Kürzlich hochgeladen (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

HIT3328 - Chapter0701 - Dialogs, Tabs and Lists

  • 1. HIT3328 / HIT8328 Software Development for Mobile Devices Dr. Rajesh Vasa, 2011 1 Twitter: @rvasa Blog: http://rvasa.blogspot.com Lecture 07 Dialogs, Tabs and Lists
  • 2. R. Vasa, 20122 Lecture Overview •A short Detour into Design Patterns •Dialogs •Tabbed Layouts •Enhancing Lists
  • 3. R. Vasa, 20123 Design Patterns •A general reusable solution to a commonly occurring problem in software design •Typically cover, •Algorithm strategy •Computational design •Execution •Implementation strategy •Structural design
  • 4. R. Vasa, 20124 API designers use these patterns •API designers use a number of these patterns •If you can recognise the patterns used -- it will help you, •learn the API faster & use it better •understand the underlying problem that motivated designers to choose the pattern •Improve your own code by adapting the pattern (assuming the pattern used by API designer is good)
  • 5. R. Vasa, 20125 API Design - Android Example •Android API designers built their SDK around the Method Chaining and Builder pattern in many instances •What are they? Why have they used it?
  • 6. R. Vasa, 20126 Quick Concept Clarification •Before we go into the pattern in depth •We need to know the following: •Mutable Vs Immutable objects •Command-Query Separation Principle •Fluent Interfaces
  • 7. R. Vasa, 20127 Mutable vs Immutable Objects •In Object oriented languages -- some objects are designed to be immutable •That is, once created -- they are constants •In Java -- Strings are immutable •Constant (immutable) offer better memory allocation strategies •However, if we change these objects too often -- then we pay a high price
  • 8. R. Vasa, 20128 Immutable Vs Mutable Objects •In Java, if we perform a large number of string modifications •It is better to use StringBuffer •StringBuffer is Mutable (can be changed) •During design (over years) we discovered that mutable objects should have certain design properties •But -- our thinking was boxed!!!!
  • 9. R. Vasa, 20129 Command - Query Separation Principle •Good Object Oriented design should ensure that a method is either a command or a query •Simply put, •getName() -- Query -- Should not change state •setName() -- Command -- Can change state •Methods that perform both are considered poor practice This principle boxed our thinking (to some extentThis principle boxed our thinking (to some extent)
  • 10. R. Vasa, 20121 Command - Query Separation Principle •Consequences of this principle, •“set” Methods should not return (i.e. void) •This principle has influenced quite a large pool of API code (Java, .NET and others) •Side-effect, •We end up writing a large number of set methods •Often one per line
  • 11. R. Vasa, 20121 Command-Query Principle At Work private void makeNormalOrder(Customer customer) { Order o1 = new Order(); customer.addOrder(o1); OrderLine line1 = new OrderLine(6, Product.find("TAL")); o1.addLine(line1); OrderLine line2 = new OrderLine(5, Product.find("HPK")); o1.addLine(line2); OrderLine line3 = new OrderLine(3, Product.find("LGV")); o1.addLine(line3); line2.setSkippable(true); o1.setRush(true); } Commands and Queries are clearly separatedCommands and Queries are clearly separated Example from: http://martinfowler.com/bliki/FluentInterface.html
  • 12. R. Vasa, 20121 Command-Query Principle At Work private void makeNormalOrder(Customer customer) { Order o1 = new Order(); customer.addOrder(o1); OrderLine line1 = new OrderLine(6, Product.find("TAL")); o1.addLine(line1); OrderLine line2 = new OrderLine(5, Product.find("HPK")); o1.addLine(line2); OrderLine line3 = new OrderLine(3, Product.find("LGV")); o1.addLine(line3); line2.setSkippable(true); o1.setRush(true); } Example from: http://martinfowler.com/bliki/FluentInterface.html Code is needlessly messy, long and convolutedCode is needlessly messy, long and convoluted
  • 13. R. Vasa, 20121 Fluent Interface •The concept is that we should write code that is better to read •That is, it communicates the intent much more clearly
  • 14. R. Vasa, 20121 Fluent Interfaces Example private void makeFluentOrder(Customer customer) { customer.newOrder() .with(6, "TAL") .with(5, "HPK").skippable() .with(3, "LGV") .priorityRush(); } Example from: http://martinfowler.com/bliki/FluentInterface.html Easier to read -- but is C-Q still followed?Easier to read -- but is C-Q still followed? Commands change state and return -- but intent of the principle is not really violated Commands change state and return -- but intent of the principle is not really violated
  • 15. R. Vasa, 20121 Fluent Interfaces & C-Q Principle private void makeFluentOrder(Customer customer) { customer.newOrder() .with(6, "TAL") .with(5, "HPK").skippable() .with(3, "LGV") .priorityRush(); } Example from: http://martinfowler.com/bliki/FluentInterface.html with() methods [commands] update and return the order object with() methods [commands] update and return the order object public Order with(int i, String string)public Order with(int i, String string)
  • 16. R. Vasa, 20121 Method Chaining Pattern private void makeFluentOrder(Customer customer) { customer.newOrder() .with(6, "TAL") .with(5, "HPK").skippable() .with(3, "LGV") .priorityRush(); } Method Chaining Pattern - Object is mutated and returned back Method Chaining Pattern - Object is mutated and returned back
  • 17. R. Vasa, 20121 Back to Android API Design •Android SDK designers are influenced by these ideas around fluent interfaces and method chaining •They combine it with the Builder Pattern to help construct layouts and views •This pattern is highlighted in the examples that follow ....
  • 18. R. Vasa, 20121 Lecture Roadmap - Where are we? •A short Detour into Design Patterns •Dialogs •Tabbed Layouts •Enhancing Lists
  • 19. R. Vasa, 20121 Dialogs • How long have I been alive? Date Dialog Alert Dialog
  • 20. R. Vasa, 20122 Dialogs are flexible Date Dialog (SDK Provided) Custom Alert Dialog Title and Icon
  • 21. R. Vasa, 20122 Dialogs are flexible Date Dialog (SDK Provided) Custom Alert Dialog Title and Icon Message
  • 22. R. Vasa, 20122 Dialogs are flexible Date Dialog (SDK Provided) Custom Alert Dialog Title and Icon Message Control Buttons
  • 23. R. Vasa, 20122 Dialogs are useful for error messages Custom Alert Dialog Ideal for simple error messages
  • 24. R. Vasa, 20122 Date Picker Dialog private MutableDateTime mdt = new MutableDateTime(1990,1,1,10,10,0,0); Mutable Date Time from Joda Time library (see sample code) We can set a default date value for the dialog
  • 25. R. Vasa, 20122 Short Problem - Usability Question •In this context, what should be the default date shown? 20 years ago Current Should it be something else? -- Is it important?
  • 26. R. Vasa, 20122 Constructing Custom Alter Dialogs This code uses a built-in icon, but can be any appropriate drawable This code uses a built-in icon, but can be any appropriate drawable See http://androiddrawableexplorer.appspot.com/ for a full list of built-in drawable resources and their names
  • 27. R. Vasa, 20122 Constructing Custom Alter Dialogs We can set buttons (positive/negative/neutral) We can set buttons (positive/negative/neutral)
  • 28. R. Vasa, 20122 Constructing Custom Alter Dialogs Button Click implementatio n Button Click implementatio n
  • 29. R. Vasa, 20122 Deconstructing the Patterns in Use Dialog Builder - Inner ClassDialog Builder - Inner Class Method Chaining PatternMethod Chaining Pattern
  • 30. R. Vasa, 20123 Showing a Dialog public void onBackPressed() { showDialog(EXIT_DIALOG); } This is a method provided by the Activity class This is a method provided by the Activity class We have to provide these constants for the call-back We have to provide these constants for the call-back
  • 31. R. Vasa, 20123 Dialogs are Constructed via Call-Backs public void onBackPressed() { showDialog(EXIT_DIALOG); } Triggers the call back This is displayed to the user This is displayed to the user
  • 32. R. Vasa, 20123 Why go through so much trouble?public void onBackPressed() { showDialog(EXIT_DIALOG); } Because dialogs needs a parent Activity for life cycle management Because dialogs needs a parent Activity for life cycle management Offers separation of concerns Offers separation of concerns
  • 33. R. Vasa, 20123 Lecture Roadmap - Where are we? •A short Detour into Design Patterns •Dialogs •Tabbed Layouts •Enhancing Lists
  • 35. R. Vasa, 20123 Tabbed Layouts - Concepts Tab Host (container)
  • 36. R. Vasa, 20123 Tabbed Layouts - Concepts Tab Widget Tab Host (container)
  • 37. R. Vasa, 20123 Tabbed Layouts - Concepts Tab Host (container) Tab Widget Frame Layout is used to switch the visible content for a tab
  • 38. R. Vasa, 20123 Layout of a Tabbed App. bHost contains the TabWidget and the FrameLayo
  • 39. R. Vasa, 20123 Layout of a Tabbed App. Two views in the frame layout to switch around Two views in the frame layout to switch around
  • 40. R. Vasa, 20124 Wiring up the Activity Method chaining usedMethod chaining used
  • 41. R. Vasa, 20124 Wiring up the Activity TabSpec populates the tab widget TabSpec populates the tab widget
  • 42. R. Vasa, 20124 Tabs need multiple icon resources Selected Icon Unselected Icon We have to provide both icons to improve look & feelWe have to provide both icons to improve look & feel
  • 43. R. Vasa, 20124 Working with Multiple Icons State information is provided as a drawable resourceState information is provided as a drawable resource Note: XML file is placed in the drawable folder
  • 44. R. Vasa, 20124 Using Icon State Information Icon selection is managed by SDK (via convention) Icon selection is managed by SDK (via convention)
  • 45. R. Vasa, 20124 Tabs can load different activities •If a tab needs to start a new activity, •We need to start it with Intents
  • 46. R. Vasa, 20124 Tabs can load different activities Intent is reused in this example -- because this method copies the value internally Intent is reused in this example -- because this method copies the value internally Method Chaining used hereMethod Chaining used here
  • 47. R. Vasa, 20124 Lecture Roadmap - Where are we? •A short Detour into Design Patterns •Dialogs •Tabbed Layouts •Enhancing Lists
  • 48. R. Vasa, 20124 Enhancing Lists Latitude / Longitude Example Drop down showing matching options Drop down showing matching options
  • 49. R. Vasa, 20124 Recall: Lists get data via an Adapter ListView Data Source Adapter
  • 50. R. Vasa, 20125 We can tie an adapter to Edit Text View Data Adapter set for AutoCompleteTextView
  • 51. R. Vasa, 20125 Listening to Selection cityView.addTextChangedListener(this); public class LatLongActivity extends Activity implements TextWatcher
  • 52. R. Vasa, 20125 Listening to Selection cityView.addTextChangedListener(this); public class LatLongActivity extends Activity implements TextWatcher
  • 53. R. Vasa, 20125 Lecture Roadmap - Where are we? •A short Detour into Design Patterns •Dialogs •Tabbed Layouts •Enhancing Lists (with images)
  • 54. R. Vasa, 20125 Lists with Images Latitude / Longitude Example Melbourne & Sydney have special images. Rest use same icon Melbourne & Sydney have special images. Rest use same icon
  • 55. R. Vasa, 20125 Custom List Row We can specify a custom layout for rows in a list We can specify a custom layout for rows in a list
  • 56. R. Vasa, 20125 Custom List Row Layout provides the default icon to show for each row item Layout provides the default icon to show for each row item
  • 57. R. Vasa, 20125 We provide a custom row adapter •The standard adapter will display using a pre-defined (SDK provided) layout •We have to override this behaviour with our own “row” rendering functionality // use custom row adapter setListAdapter(new RowIconAdapter()); public class LatLongActivity extends ListActivity Note: See Sample Code for details
  • 58. R. Vasa, 20125 Custom Row Adapter class RowIconAdapter extends ArrayAdapter<String> { public RowIconAdapter() {super(LatLongActivity.this, R.layout.listrow, R.id.row_label, cityNames);} public View getView(int pos, View cView, ViewGroup parent) { View row = super.getView(pos, cView, parent); // DEFAULT ROW ImageView icon = (ImageView) row.findViewById(R.id.row_icon); String city = cityNames[pos]; if (city.startsWith("Melb")) icon.setImageResource(R.drawable.melbourne); else if (city.startsWith("Syd")) icon.setImageResource(R.drawable.sydney); else icon.setImageResource(R.drawable.location); return row; }}
  • 59. R. Vasa, 20125 A Few List View Related Issues As we scroll down, we get more cities
  • 60. R. Vasa, 20126 A Few List View Related Issues View objects on Rows not shown are destroyed as we scroll up/down View objects on Rows not shown are destroyed as we scroll up/down Only 7 rows (views) are kept in RAM
  • 61. R. Vasa, 20126 A Few List View Related Issues View objects on Rows not shown are destroyed as we scroll up/down View objects on Rows not shown are destroyed as we scroll up/down Design Tip: Make sure that rows are constructed as quickly as possible Design Tip: Make sure that rows are constructed as quickly as possible
  • 62. R. Vasa, 20126 Lecture Roadmap - Where are we? •A short Detour into Design Patterns •Dialogs •Tabbed Layouts •Enhancing Lists