You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
implement View.getLocationOnScreen() properly
This commit is contained in:
@@ -1040,9 +1040,11 @@ public class View extends Object {
|
|||||||
|
|
||||||
protected void onScrollChanged(int l, int t, int oldl, int oldt) {}
|
protected void onScrollChanged(int l, int t, int oldl, int oldt) {}
|
||||||
|
|
||||||
public void getLocationOnScreen(int[] location) { // FIXME: actually return the widget's location (and also have the onclick callback convert to window coordinates, because is seems that's what android deals in..)
|
public void getLocationOnScreen(int[] location) {
|
||||||
location[0] = 0;
|
Rect rect = new Rect();
|
||||||
location[1] = 0;
|
getGlobalVisibleRect(rect);
|
||||||
|
location[0] = rect.left;
|
||||||
|
location[1] = rect.top;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean performHapticFeedback(int feedbackConstant) {
|
public boolean performHapticFeedback(int feedbackConstant) {
|
||||||
|
|||||||
Reference in New Issue
Block a user