Lines Matching defs:direction

38             @Nullable T focused, @FocusRelativeDirection int direction, boolean isLayoutRtl,
49 switch (direction) {
55 throw new IllegalArgumentException("direction must be one of "
142 @Nullable T focused, @NonNull Rect focusedRect, int direction) {
147 switch (direction) {
161 throw new IllegalArgumentException("direction must be one of "
177 if (isBetterCandidate(direction, focusedRect, focusableRect, bestCandidateRect)) {
188 * in a particular direction from a source rect? This is the core
191 * @param direction the direction (up, down, left, right)
199 @FocusRealDirection int direction, @NonNull Rect source,
203 if (!isCandidate(source, candidate, direction)) {
209 if (!isCandidate(source, currentBest, direction)) {
214 if (beamBeats(direction, source, candidate, currentBest)) {
219 if (beamBeats(direction, source, currentBest, candidate)) {
226 majorAxisDistance(direction, source, candidate),
227 minorAxisDistance(direction, source, candidate));
229 majorAxisDistance(direction, source, currentBest),
230 minorAxisDistance(direction, source, currentBest));
241 private static boolean beamBeats(@FocusRealDirection int direction,
243 final boolean rect1InSrcBeam = beamsOverlap(direction, source, rect1);
244 final boolean rect2InSrcBeam = beamsOverlap(direction, source, rect2);
253 // If rect1 is to the direction of, and rect2 is not, rect1 wins.
254 // For example, for direction left, if rect1 is to the left of the
257 if (!isToDirectionOf(direction, source, rect2)) {
263 if (direction == View.FOCUS_LEFT || direction == View.FOCUS_RIGHT) {
269 // direction down, completely closer means for rect2's top edge to
271 return majorAxisDistance(direction, source, rect1)
272 < majorAxisDistanceToFarEdge(direction, source, rect2);
288 * Is destRect a candidate for the next focus given the direction? This
289 * checks whether the dest is at least partially to the direction of
296 @FocusRealDirection int direction) {
297 switch (direction) {
311 throw new IllegalArgumentException("direction must be one of "
317 * Do the "beams" w.r.t the given direction's axis of rect1 and rect2 overlap?
319 * @param direction the direction (up, down, left, right)
324 private static boolean beamsOverlap(@FocusRealDirection int direction,
326 switch (direction) {
334 throw new IllegalArgumentException("direction must be one of "
341 private static boolean isToDirectionOf(@FocusRealDirection int direction,
343 switch (direction) {
353 throw new IllegalArgumentException("direction must be one of "
358 * @return the distance from the edge furthest in the given direction
359 * of source to the edge nearest in the given direction of
360 * dest. If the dest is not in the direction from source,
363 private static int majorAxisDistance(@FocusRealDirection int direction,
365 return Math.max(0, majorAxisDistanceRaw(direction, source, dest));
368 private static int majorAxisDistanceRaw(@FocusRealDirection int direction,
370 switch (direction) {
380 throw new IllegalArgumentException("direction must be one of "
385 * @return the distance along the major axis w.r.t the direction from
387 * not in the direction from source, returns 1 to break ties
390 private static int majorAxisDistanceToFarEdge(@FocusRealDirection int direction,
392 return Math.max(1, majorAxisDistanceToFarEdgeRaw(direction, source, dest));
396 @FocusRealDirection int direction, @NonNull Rect source,
398 switch (direction) {
408 throw new IllegalArgumentException("direction must be one of "
413 * Finds the distance on the minor axis w.r.t the direction to the
416 * @param direction the direction (up, down, left, right)
421 private static int minorAxisDistance(@FocusRealDirection int direction, @NonNull Rect source,
423 switch (direction) {
435 throw new IllegalArgumentException("direction must be one of "