}
obj = target;
+ int sh = scrollView.getHeight();
+ int lh = this.getHeight();
+ int maxY = lh - sh;
+ int py = scrollView.getScrollY();
+ int sdy = 10;
+ int N = 100;
+ if (y < N){
+ if (py > 0){
+ if (py < sdy){
+ sdy = py;
+ }
+ scrollView.smoothScrollTo(0, py - sdy);
+ currentY -= sdy;
+ }
+ }
+ else if (sh - y < N){
+ if (py < maxY){
+ if (maxY - py < sdy){
+ sdy = maxY - py;
+ }
+ scrollView.smoothScrollTo(0, py + sdy);
+ currentY += sdy;
+ }
+ }
+
int diffX = offsetX - x;
int diffY = offsetY - y;