|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.view.FocusFinder
public class FocusFinder
The algorithm used for finding the next focusable view in a given direction from a view that currently has focus.
| Field Summary | |
|---|---|
(package private) Rect |
mBestCandidateRect
|
(package private) Rect |
mFocusedRect
|
(package private) Rect |
mOtherRect
|
| Method Summary | |
|---|---|
(package private) boolean |
beamBeats(int direction,
Rect source,
Rect rect1,
Rect rect2)
One rectangle may be another candidate than another by virtue of being exclusively in the beam of the source rect. |
(package private) boolean |
beamsOverlap(int direction,
Rect rect1,
Rect rect2)
Do the "beams" w.r.t the given direcition's axos of rect1 and rect2 overlap? |
View |
findNearestTouchable(ViewGroup root,
int x,
int y,
int direction,
int[] deltas)
Find the nearest touchable view to the specified view. |
View |
findNextFocus(ViewGroup root,
View focused,
int direction)
Find the next view to take focus in root's descendants, starting from the view that currently is focused. |
View |
findNextFocusFromRect(ViewGroup root,
Rect focusedRect,
int direction)
Find the next view to take focus in root's descendants, searching from a particular rectangle in root's coordinates. |
static FocusFinder |
getInstance()
Get the focus finder for this thread. |
(package private) int |
getWeightedDistanceFor(int majorAxisDistance,
int minorAxisDistance)
Fudge-factor opportunity: how to calculate distance given major and minor axis distances. |
(package private) boolean |
isBetterCandidate(int direction,
Rect source,
Rect rect1,
Rect rect2)
Is rect1 a better candidate than rect2 for a focus search in a particular direction from a source rect? This is the core routine that determines the order of focus searching. |
(package private) boolean |
isCandidate(Rect srcRect,
Rect destRect,
int direction)
Is destRect a candidate for the next focus given the direction? This checks whether the dest is at least partially to the direction of (e.g left of) from source. |
(package private) boolean |
isToDirectionOf(int direction,
Rect src,
Rect dest)
e.g for left, is 'to left of' |
(package private) static int |
majorAxisDistance(int direction,
Rect source,
Rect dest)
|
(package private) static int |
majorAxisDistanceRaw(int direction,
Rect source,
Rect dest)
|
(package private) static int |
majorAxisDistanceToFarEdge(int direction,
Rect source,
Rect dest)
|
(package private) static int |
majorAxisDistanceToFarEdgeRaw(int direction,
Rect source,
Rect dest)
|
(package private) static int |
minorAxisDistance(int direction,
Rect source,
Rect dest)
Find the distance on the minor axis w.r.t the direction to the nearest edge of the destination rectange. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
Rect mFocusedRect
Rect mOtherRect
Rect mBestCandidateRect
| Method Detail |
|---|
public static FocusFinder getInstance()
public final View findNextFocus(ViewGroup root,
View focused,
int direction)
root - Contains focusedfocused - Has focus now.direction - Direction to look.
public View findNextFocusFromRect(ViewGroup root,
Rect focusedRect,
int direction)
root - Contains focusedRect.focusedRect - The starting point of the search.direction - Direction to look.
boolean isBetterCandidate(int direction,
Rect source,
Rect rect1,
Rect rect2)
direction - the direction (up, down, left, right)source - The source we are searching fromrect1 - The candidate rectanglerect2 - The current best candidate.
boolean beamBeats(int direction,
Rect source,
Rect rect1,
Rect rect2)
int getWeightedDistanceFor(int majorAxisDistance,
int minorAxisDistance)
boolean isCandidate(Rect srcRect,
Rect destRect,
int direction)
boolean beamsOverlap(int direction,
Rect rect1,
Rect rect2)
direction - the direction (up, down, left, right)rect1 - The first rectanglerect2 - The second rectangle
boolean isToDirectionOf(int direction,
Rect src,
Rect dest)
static int majorAxisDistance(int direction,
Rect source,
Rect dest)
static int majorAxisDistanceRaw(int direction,
Rect source,
Rect dest)
static int majorAxisDistanceToFarEdge(int direction,
Rect source,
Rect dest)
majorAxisDistance(int, android.graphics.Rect, android.graphics.Rect)).
static int majorAxisDistanceToFarEdgeRaw(int direction,
Rect source,
Rect dest)
static int minorAxisDistance(int direction,
Rect source,
Rect dest)
direction - the direction (up, down, left, right)source - The source rect.dest - The destination rect.
public View findNearestTouchable(ViewGroup root,
int x,
int y,
int direction,
int[] deltas)
root - The root of the tree in which to searchx - X coordinate from which to start the searchy - Y coordinate from which to start the searchdirection - Direction to lookdeltas - Offset from the
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||