User Interface (사용자 인터페이스) - 안드로이드 기술 커뮤니티 ...

vermontdroningΚινητά – Ασύρματες Τεχνολογίες

10 Δεκ 2013 (πριν από 4 χρόνια και 22 μέρες)

101 εμφανίσεις

대학생을위한안드로이드애플리케이션교육자료–3 User Interface (사용자인터페이스)
www.kandroid.org 운영자: 양정수(yangjeongsoo@gmail.com), 닉네임:들풀
2Korea Android Community-www.kandroid.org
History : 웹표준및브라우저기술, GUI & GDI / GTK
Web의성공전제조건
-HTML : SGML 기반의쉽고모호한마크업언어(Compound Document Format의근간)
-Internet : TCP/IP기반의DecentralizedNetwork
-CSS : HTML로부터의미와스타일의분리, 그리고Cascade.
-DOM : Dynamic한HTML을가능하게함.
-ECMAScript: 표준Script 언어.
-Dynamic HTML의Interface : Event DOM 과Keyboard & Mouse
Web Browser 기술의구성요소
-Network : Network Performance Issue
-Parser : HTML, CSS, JavaScript, XML, 등등
-Layout Engine : Block, Inline, Table,
-JavaScript Engine : JavaScript Interpreter & Executor Performance (JIT Issue)
-DOM Interface Engine : COM/DCOM, XPCOM
-Rendering : GDI, GTK 등의System 영역에의존
-Event Handling : GDI, GTK 등의System 영역에의존
GUI & GDI/GTK 이후흐흠–XML 기반, Vector Processing 활용
-Linux : XUL & SVG Support (Cairo, PANGO , FreeType, FontConfig)
-Window Vista : AVALON(XUL + SVG, METRO) & INDIGO
3Korea Android Community-www.kandroid.org
TrueType에서는Quadratic Curve를사용하지만,
Construction of a quadratic Bézier curve
Animation of a quadratic Bézier curve,
t
in
[0,1]
Postscript에서는Cubic Bezier Curve를사용한다.
Construction of a cubic Bézier curve
Animation of a cubic Bézier curve,
t
in
[0,1]
Font 인프라기술의중요성
-1980년대후반: Apple TrueType
-Apple TrueType Hinting 특허취득
-MS & Apple 사용권공유.
-MS ClearType / OpenType
-Layout/Rasterisation의토대, 폰트
-CJK Issue 및CJK Unification.
GUI → ZUI
(Zoomable User Interface)
-MaxOS X
-Windows Vista
-Linux KDE & GNOME
History : GUI & GDI 관련인프라기술–Font Processing
4Korea Android Community-www.kandroid.org
GTK Main
Keyboard
Mouse
A Interface
entry open URL
A Navigator
Push
A Navigator
Open URL
A Interface
Stop
A Capi
Open URL
A Cache
Open URL
CCC
HTTP
File
About
Plugin
IO
A Html Text
A Plain Text
A Gif Image
A Jpeg Image
A Png Image
CCC
Unknown
Parser
DwPage
Parser Stack
Process Word
Process Space
Process Tag
DwStyle
Length & Percent
Boxes
Incremental
DwImage
Image
Image Map
Image Buffer
Space & Text
DI Cache
Selection
DwWidget
(GtkObject)
+-DwWidget
| +----DwBullet
| +----DwContainer
| | `----DwPage
| +----DwEmbedGtk
| +----DwHruler
| `----DwImage
`----(GtkWidget)
`----(GtkContainer)
+----(GtkBin)
| +----(GtkScrolledWindow)
| | `----GtkDwScrolledWindow
| `----GtkDwScrolledFrame
`----(GtkLayout)
`----GtkDwViewport
Image Cache Mechanism
Event Handling 기술의중요성
Timer
GUI Event는기본적으로Key, Mouse, Action Selection, Timer Event를포함하며, Network I/O 등과
같은Interrupt등을효율적으로관리함을목적으로한다. (아래의그림은GTK/Dillo구조예임)
History : GUI & GDI 관련인프라기술–Event Processing
5Korea Android Community-www.kandroid.org
Overview : Summary
•Activity Internals
•View Hierarchy
•Layout
•Widgets
•UI Events
•Menus
•Advanced Topics
-Adapters
-Styles and Themes
•CustomView
•AdapterView
•SurfaceView
•RemoteView
•merge
•include
•requestFocus
6Korea Android Community-www.kandroid.org
A
PPLICATIONS
Home
Alarm
Camera
Browser
IM
SMS/MMS
Dialer
Alarm

Clock
Albums
Media Player
Calendar
Email
Voice Dial
Contacts
A
PPLICATION
F
RAMEWORK
Activity
Manager
Package
Manager
Window
Manager
Telephony
Manager
Content
Provider
Resource
Manager
View
System
Location
Manager
Notification
Manager

L
IBRARIES
Surface Manager
A
NDROID
R
UNTIME
Dalvik Virtual Machine
Core Libraries
H
ARDWARE
A
BSTRACTION
L
AYER
Graphics
Audio
Camera
Bluetooth
GPS
Radio(RIL)
WiFi

L
INUX
K
ERNEL
Display Driver
Camera Driver
Bluetooth Driver
Shared Memory
Driver
Binder (IPC)
Driver
USB Driver
Keypad Driver
WiFi Driver
Audio
Driver
Power
Management
OpenGL|ES
SGL
Media Framework
FreeType
SSL
SQLite
WebKit
Libc
A
PPLICATIONS
Home
Home
Alarm
Alarm
Camera
Camera
Browser
Browser
IM
IM
SMS/MMS
SMS/MMS
Dialer
Dialer
Alarm
Alarm


Clock
Clock
Albums
Albums
Media Player
Media Player
Calendar
Calendar
Email
Email
Voice Dial
Voice Dial
Contacts
Contacts
A
PPLICATION
F
RAMEWORK
Activity
Manager
Activity
Manager
Package
Manager
Package
Manager
Window
Manager
Window
Manager
Telephony
Manager
Telephony
Manager
Content
Provider
Content
Provider
Resource
Manager
Resource
Manager
View
System
View
System
Location
Manager
Location
Manager
Notification
Manager
Notification
Manager


L
IBRARIES
Surface Manager
Surface Manager
A
NDROID
R
UNTIME
Dalvik Virtual Machine
Dalvik Virtual Machine
Core Libraries
Core Libraries
H
ARDWARE
A
BSTRACTION
L
AYER
Graphics
Graphics
Audio
Audio
Camera
Camera
Bluetooth
Bluetooth
GPS
GPS
Radio(RIL)
Radio(RIL)
WiFi
WiFi


L
INUX
K
ERNEL
Display Driver
Display Driver
Camera Driver
Camera Driver
Bluetooth Driver
Bluetooth Driver
Shared Memory
Driver
Shared Memory
Driver
Binder (IPC)
Driver
Binder (IPC)
Driver
USB Driver
USB Driver
Keypad Driver
Keypad Driver
WiFi Driver
WiFi Driver
Audio
Driver
Audio
Driver
Power
Management
Power
Management
OpenGL|ES
OpenGL|ES
SGL
SGL
Media Framework
Media Framework
FreeType
FreeType
SSL
SSL
SQLite
SQLite
WebKit
WebKit
Libc
Libc
Overview :Android Platform Stack vs. View/Window System
7Korea Android Community-www.kandroid.org
Activity Internal : Application Process Internal
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/...
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextViewandroid:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a TextView" />
<Buttonandroid:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a Button" />
</LinearLayout>
public classHelloAndroidextendsActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
8Korea Android Community-www.kandroid.org
Thread
(UI)Thread
Intent
Receiver
Activity
Activity
Looper
Message
Queue
UI
Events
System
Events
Local
Service Call
External
Service
Calls
Activity Internal : Application Process Internal
Process
9Korea Android Community-www.kandroid.org
public class MyActivityextends Activity{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main1);
Button btn_next= (Button) findViewById(R.id.next);
btn_next.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent i= new Intent();
ComponentNamecomp =
new ComponentName("org.kandroid.testApp",
"org.kandroid.testApp.MyNextActivity");
i.setComponent(comp);
startActivity(i);
}
});
}
}
Activity Internal : Sample Activity -MyActivity
10Korea Android Community-www.kandroid.org
public class MyNextActivityextends Activity{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main2);
}
}
Activity Internal : Sample Activity -MyNextActivity
11Korea Android Community-www.kandroid.org
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.kandroid.testApp"
android:versionCode="1"
android:versionName="1.0.0">
<applicationandroid:icon="@drawable/icon" android:label="@string/app_name">
<activityandroid:name=".MyActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activityandroid:name=".MyNextActivity"
android:label="@string/app_name" >
</activity>
</application>
</manifest>
Activity Internal : Sample Activity –AndroidManifest.xml
12Korea Android Community-www.kandroid.org
> adbinstall <full_path>\MyActivity.apk
> adbshell
# am start -n org.kandroid.testApp/.MyActivity
Activity Internal : Android Apk Install and Launch
Android
Application
(.apk)
Zip Format
Custom Key)
jarsigner
(keytool)
adb(pm)
install
am
start
Signed
Android
Application
(.apk)
by
Debug Key
Signed
Android
Application
(.apk)
by
Custom Key
결과물:
App. Launch
zipalign
Aligned
Android
Application
(.apk)
Debug Key
Aligned
Android
Application
(.apk)
Default process
13Korea Android Community-www.kandroid.org
system_server
zygote
RuntimeInit
AndroidRuntime
ZygoteInit
Dalvik VM
ApplicationContext
Application
ActivityThread
Instrumentation
ApplicationThread
WindowManager
ActivityManager
PackageManager
fork
socket
# am start -n org.kandroid.testApp/.MyActivity
= startActivity(Intent)
zygote (org.kandroid.testApp)
1
2
fork
bind App
launch Activity
connect back
3
4
5
6
Thread
Looper
Message
Queue
MyActivity
Activity Internal : startActivityProcess
14Korea Android Community-www.kandroid.org
PhoneWindow$DecorView
(FrameLayout)
LinearLayout
FrameLayout
(id/content)
FrameLayout
TextView
(id/title)
Activity
ViewRoot
(Handler)
MIDWindow$DecorView
PRODUCT_POLICY
TextView
LinearLayout
ImageView
User
Defined
Layout
Thread
Looper
Message
Queue
UI
Events
System
Events
Activity Internal : How Android Draws View
// 측정패스
onMeasure(
intwidthMeasureSpec,
intheightMeasureSpec) { }
// 레이아웃패스
onLayout(booleanchanged,
intleft, inttop,
intright, intbottom) { }
// 드로잉시점
onDraw(Canvascanvas) { }
15Korea Android Community-www.kandroid.org
PhoneWindow$DecorView
(FrameLayout)
LinearLayout
FrameLayout
(id/content)
FrameLayout
TextView
(id/title)
Activity
ViewRoot
(Handler)
Window
Surface
Session
Window
Window Manager
Token
LayoutParams
(for window layer)
Application
system_server
Activity Internal : How Android Draws View
16Korea Android Community-www.kandroid.org
•The Viewclass represents
the basic building block for user interface components.
•A Viewoccupies a rectangular area on the screen
and is responsible for drawing and event handling.
•Viewis the base class for widgets,
which are used to create interactive UI components
(buttons, text fields, etc.).
•The ViewGroupsubclass is the base class for layouts,
which are invisible containers that hold other Views
(or other ViewGroups) and define their layout properties.
Overview : View, ViewGroup, Layout, Widget
ViewGroup
___Layout
Widget
View
17Korea Android Community-www.kandroid.org
View 계층구조
On the Android platform, you define an Activity's UI using a hierarchy of View and
ViewGroup nodes, as shown in the diagram below. This hierarchy tree can be as
simple or complex as you need it to be, and you can build it up using Android's set of
predefined widgets and layouts, or with custom Views that you create yourself.
Overview : View Hierarchy
ViewGroup
View
View
View
ViewGroup
View
View
18Korea Android Community-www.kandroid.org
Layout The name of an XML element is respective to the Java class that it represents.
So a <TextView> element creates a TextViewin your UI, and a <LinearLayout> element
creates a LinearLayout view group. When you load a layout resource, the Android
system initializes these run-time objects, corresponding to the elements in your layout.
Overview : Layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextViewandroid:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a TextView" />
<Buttonandroid:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a Button" />
</LinearLayout>
public classHelloAndroidextendsActivity {
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
19Korea Android Community-www.kandroid.org
Widgets A widget is a View object that serves as an interface for interaction with the user.
Android provides a set of fully implemented widgets, like buttons, checkboxes, and text-
entry fields, so you can quickly build your UI. Some widgets provided by Android are
more complex, like a date picker, a clock, and zoom controls. But you're not limited to
the kinds of widgets provided by the Android platform. If you'd like to do something more
customized and create your own actionable elements, you can, by defining your own
View object or by extending and combining existing widgets.
Overview : Widgets
20Korea Android Community-www.kandroid.org
UI Events
Overview : UI Events
Once you've added some Views/widgets to the UI, you probably want to know about the user's
interaction with them, so you can perform actions. To be informed of UI events, you need to
do one of two things:
Define an event listener and register it with the View.
More often than not, this is how you'll listen for events. The View class contains a collection of
nested interfaces named On<something>Listener, each with a callback method called
On<something>(). For example, View.OnClickListener(for handling "clicks" on a View),
View.OnTouchListener(for handling touch screen events in a View), and View.OnKeyListener
(for handling device key presses within a View). So if you want your View to be notified when it
is "clicked" (such as when a button is selected), implement OnClickListenerand define its
onClick() callback method (where you perform the action upon click), and register it to the
View with setOnClickListener().
Override an existing callback method for the View.
This is what you should do when you've implemented your own View class and want to listen
for specific events that occur within it. Example events you can handle include when the
screen is touched (onTouchEvent()), when the trackball is moved (onTrackballEvent()), or when
a key on the device is pressed (onKeyDown()). This allows you to define the default behavior
for each event inside your custom View and determine whether the event should be passed on
to some other child View. Again, these are callbacks to the View class, so your only chance to
define them is when you build a custom component.
21Korea Android Community-www.kandroid.org
setContentView(R.layout.main);
Button btn_next= (Button) findViewById(R.id.next);
btn_next.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(i);
}
});
public class CustomViewextends View {
@Override
public booleanonKeyDown(intkeyCode, KeyEventevent) {
// TODO Auto-generated method stub
return super.onKeyDown(keyCode, event);
}
@Override
public booleanonTouchEvent(MotionEventevent) {
// TODO Auto-generated method stub
return super.onTouchEvent(event);
}
@Override
public booleanonTrackballEvent(MotionEventevent) {
// TODO Auto-generated method stub
return super.onTrackballEvent(event);
}
}
Define an event listener
and register it with the View.
Override an existing callback
method for the View.
Overview : UI Events
22Korea Android Community-www.kandroid.org
Menu
Application menus are another important part of an application's UI. Menus offers a
reliable interface that reveals application functions and settings. The most common
application menu is revealed by pressing the MENU keyon the device. However, you
can also add Context Menus, which may be revealed when the user presses and holds
down on an item.
Menus are also structured using a View hierarchy, but you don't define this structure
yourself. Instead, you define the onCreateOptionsMenu()or onCreateContextMenu()
callback methods for your Activity and declare the items that you want to include in your
menu. At the appropriate time, Android will automatically create the necessary View
hierarchy for the menu and draw each of your menu items in it.
Menus also handle their own events, so there's no need to register event listeners on
the items in your menu. When an item in your menu is selected, the
onOptionsItemSelected() or onContextItemSelected() method will be called by the
framework.
And just like your application layout, you have the option to declare the items for
you menu in an XML file.
Overview : Menu
23Korea Android Community-www.kandroid.org
Overview : Advanced Topics -Adapters
Adapters
Sometimes you'll want to populate a view group with some information that can't be
hard-coded, instead, you want to bind your view to an external source of data. To do
this, you use an AdapterViewas your view group and each child View is initialized
and populated with data from the Adapter.
The AdapterViewobject is an implementation of ViewGroup that determines its child
views based on a given Adapter object. The Adapter acts like a courier between your
data source (perhaps an array of external strings) and the AdapterView, which displays it.
There are several implementations of the Adapter class, for specific tasks, such as the
CursorAdapterfor reading database data from a Cursor, or an ArrayAdapterfor reading
from an arbitrary array.
24Korea Android Community-www.kandroid.org
Styles and Themes Perhaps you're not satisfied with the look of the standard widgets. To revise them, you
can create some of your own styles and themes.
•A styleis a set of one or more formatting attributes that you can apply as a unit
to individual elements in your layout. For example, you could define a style that
specifies a certain text size and color, then apply it to only specific View elements.
•A themeis a set of one or more formatting attributes that you can apply as a
unit to all activities in an application, or just a single activity. For example, you
could define a theme that sets specific colors for the window frame and the panel
background, and sets text sizes and colors for menus. This theme can then be
applied to specific activities or the entire application.
Styles and themes are resources. Android provides some default style and theme
resources that you can use, or you can declare your own custom style and theme
resources.
Overview : Advanced Topics -Styles and Themes
25Korea Android Community-www.kandroid.org
class CustomViewextendsView{
public CustomView(Context context) {
super(context);
}
@Override
protected void onDraw(Canvas canvas) {
}
@Override
protected void onMeasure(intwidthMeasureSpec,
intheightMeasureSpec) {
setMeasuredDimension(100, 100);
}
}
CustomView
Custom Views
26Korea Android Community-www.kandroid.org
Custom Layouts
public class GridLayoutextends ViewGroup {
@Override
protected void onMeasure(intwidthMeasureSpec,
intheightMeasureSpec) {
final intcount = getChildCount();
for (inti= 0; i< count; i++) {
final View child = getChildAt(i);
// Define measurement spec of each child
child.measure(childWidthSpec, childheightSpec);
}
setMeasuredDimension(widthSpecSize, heightSpecSize);
}
@Override
protected void onLayout(booleanchanged, intl, intt, intr, intb) {
final intcount = getChildCount();
for (inti= 0; i< count; i++) {
View child = getChildAt(i);
if (child.getVisibility() != GONE) {
// Compute position of each child
child.layout(left, top, right, bottom);
}
}
}
}
CustomView
27Korea Android Community-www.kandroid.org
AdapterView
The AdapterViewis a ViewGroup subclass whose child Views are determined by an
Adapter that binds to data of some type. AdapterViewis useful whenever you need t
o display stored data (as opposed to resource strings or drawables) in your layout.
Gallery, ListView, and Spinnerare examples of AdapterViewsubclasses that you ca
n use to bind to a specific type of data and display it in a certain way.
AdapterViewobjects have two main responsibilities:
•Filling the layout with data
•Handling user selections
AdapterView
•ListView
•Spinner
•Gallery
•…
External
Data Source
Cursor
ArrayList
Adapter
28Korea Android Community-www.kandroid.org
ArrayList<RowItem> budgetCategoryItems= new ArrayList<RowItem>();
String[] budget_category= getResources().getStringArray(R.array.budget_category);
String[] budget_budget= getResources().getStringArray(R.array.budget_budget);
String[] budget_actual= getResources().getStringArray(R.array.budget_actual);
ListViewbudget_list= (ListView) view.findViewById(R.id.budget_list);
ListAdaptermAdapter= new SimpleAdapter(
this,
budgetCategoryItems,
R.layout.budget_row,
new String[] {RowItem.ROW_TEXT_1, RowItem.ROW_TEXT_2, RowItem.ROW_TEXT_3},
new int[]{ R.id.text_1, R.id.text_2, R.id.text_3});
budget_list.setAdapter(mAdapter);
Filling the Layout with Data
AdapterView
29Korea Android Community-www.kandroid.org
R1_Col1R1_Col2R1_Col3
R2_Col1R2_Col2R2_Col3
R3_Col1R3_Col2R3_Col3
R4_Col1R4_Col2R4_Col3
R5_Col1R5_Col2R5_Col3
R1_Col1
R1_Col2R1_Col2
Key Array
ID Array
Adapter
AdapterView
<RelativeLayout>
<TextViewid="@+id/text_1" />
<TextViewid="@+id/text_3" />
<TextViewid="@+id/text_2" />
</RelativeLayout>
List<? extends Map<String, ?>>
30Korea Android Community-www.kandroid.org
TextView
LinearLayout
ImageView
<?xml version=
"1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent“ …
>
<TextView
android:text=
"제4회코리아안드로이드세미나“ …/>
<ImageView
android:src=
"@drawable/android_logo“ …/>
<SurfaceView
android:width=“100dip”
android:height=“100dip” />
</LinearLayout>
SurfaceView
invalidate()
draw()
Punch
Hole
?
SurfaceView
31Korea Android Community-www.kandroid.org
PhoneWindow$DecorView
(FrameLayout)
LinearLayout
FrameLayout
(id/content)
FrameLayout
TextView
(id/title)
Activity
ViewRoot
(Handler)
Window Manager
LayoutParams
(for window layer)
SurfaceView
TextView
LinearLayout
ImageView
SurfaceView
Thread
Looper
Message
Queue
Secondary
Thread
for
New Surface
32Korea Android Community-www.kandroid.org
RemoteView: ex) AppWidget
http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html
http://code.google.com/p/wiktionary-android/
http://android-developers.blogspot.com/2009/04/widget-design-guidelines.html
http://developer.android.com/guide/practices/ui_guidelines/widget_design.html
Android 1.5 Special Feature
33Korea Android Community-www.kandroid.org
java.lang.Object
↳android.view.LayoutInflater
Class Overview
This class is used to instantiate layout XML file into its corresponding View objects. It is
never be used directly --use getLayoutInflater() or getSystemService(String) to retrieve a
standard LayoutInflaterinstance that is already hooked up to the current context and
correctly configured for the device you are running on. For example:
LayoutInflaterinflater= (LayoutInflater)
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
To create a new LayoutInflaterwith an additional LayoutInflater.Factoryfor your own
views, you can use cloneInContext(Context) to clone an existing ViewFactory, and then
call setFactory(LayoutInflater.Factory) on it to include your Factory.
For performance reasons, view inflation relies heavily on pre-processing of XML files
that is done at build time. Therefore, it is not currently possible to use LayoutInflaterwith
an XmlPullParserover a plain XML file at runtime; it only works with an XmlPullParser
returned from a compiled resource (R.somethingfile.)
LayoutInflator
34Korea Android Community-www.kandroid.org
The UI toolkit lets you also use three special tags that are not mapped to a View instance:
<requestFocus />, <merge /> and <include />.
Special Tag : include, merge and requestFocus
<com.android.launcher.Workspace
android:id="@+id/workspace"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
launcher:defaultScreen="1">
<includeandroid:id="@+id/cell1" layout="@layout/workspace_screen" />
<includeandroid:id="@+id/cell2" layout="@layout/workspace_screen" />
<includeandroid:id="@+id/cell3" layout="@layout/workspace_screen" />
</com.android.launcher.Workspace>
<includeandroid:layout_width="fill_parent" layout="@layout/image_holder" />
<includeandroid:layout_width="256dip" layout="@layout/image_holder" />
35Korea Android Community-www.kandroid.org
That's where the <merge /> tag comes in handy. When the LayoutInflaterencounters this tag, it skips it
and adds the <merge /> children to the <merge /> parent.Special Tag : include, mergeand requestFocus
<mergexmlns:android=“…">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="center"
android:src="@drawable/golden_gate" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dip"
android:layout_gravity="center_horizontal|bottom"
android:padding="12dip"
android:background="#AA000000"
android:textColor="#ffffffff"
android:text="Golden Gate" />
</merge>
36Korea Android Community-www.kandroid.org
Advanced Topic
1.Current Features (Froyo)
•LayoutInflator
•CustomView, AdapterView, RemoteView, SurfaceView
•WindowManagerInternals
Event Dispatching
Surface and SurfaceFlinger
•Shard Memory Usage
2.New Features (Gingerbread)
•Faster and native event dispatching and processing
Native event dispatching pipeline
Faster event dispatching using shard memory
WindowManageroptimazationsfor native event paths
•Native Applications with a standard NativeActivity
37Korea Android Community-www.kandroid.org
질의및응답
Q & A