summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-06-23 07:13:25 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-06-23 07:13:25 -0700
commit41e6e0c49f51e5bafca4912d407202f572d4e208 (patch)
treedc2bf7f938a2fa05c692da08b7c59ed3eca86eb5 /core
parent4786626b0fe62181f35afcc49f0d0aa10dc715e2 (diff)
parentc34188a95405526416325604386af4f48ba20918 (diff)
downloadframeworks_base-41e6e0c49f51e5bafca4912d407202f572d4e208.zip
frameworks_base-41e6e0c49f51e5bafca4912d407202f572d4e208.tar.gz
frameworks_base-41e6e0c49f51e5bafca4912d407202f572d4e208.tar.bz2
am c34188a9: resolved conflicts for merge of f8f76d52 to jb-dev-plus-aosp
* commit 'c34188a95405526416325604386af4f48ba20918': Add the possibility to modify the View focus rect
Diffstat (limited to 'core')
-rw-r--r--core/java/android/view/FocusFinder.java4
-rw-r--r--core/java/android/view/View.java12
2 files changed, 14 insertions, 2 deletions
diff --git a/core/java/android/view/FocusFinder.java b/core/java/android/view/FocusFinder.java
index 9063cea..31a9f05 100644
--- a/core/java/android/view/FocusFinder.java
+++ b/core/java/android/view/FocusFinder.java
@@ -250,8 +250,8 @@ public class FocusFinder {
// only interested in other non-root views
if (focusable == focused || focusable == root) continue;
- // get visible bounds of other view in same coordinate system
- focusable.getDrawingRect(mOtherRect);
+ // get focus bounds of other view in same coordinate system
+ focusable.getFocusRect(mOtherRect);
root.offsetDescendantRectToMyCoords(focusable, mOtherRect);
if (isBetterCandidate(direction, focusedRect, mOtherRect, mBestCandidateRect)) {
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 25f6516..a6a5427 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -8726,6 +8726,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
/**
+ * When searching for a view to focus this rectangle is used when considering if this view is
+ * a good candidate for receiving focus.
+ *
+ * By default, the rectangle is the {@link #getDrawingRect}) of the view.
+ *
+ * @param r The rectangle to fill in, in this view's coordinates.
+ */
+ public void getFocusRect(Rect r) {
+ getDrawingRect(r);
+ }
+
+ /**
* Utility method to retrieve the inverse of the current mMatrix property.
* We cache the matrix to avoid recalculating it when transform properties
* have not changed.