Code example for ScrollView

Methods: smoothScrollTo, getScrollX

0
    if (mScrollView != null) {
      AyahBounds yBounds = mImageView.getYBoundsForCurrentHighlight();
      if (yBounds != null) {
        int screenHeight = QuranScreenInfo.getInstance().getHeight();
        int y = yBounds.getMinY() - (int) (0.05 * screenHeight);
        mScrollView.smoothScrollTo(mScrollView.getScrollX(), y);
      } 
    } 
    mImageView.invalidate();
  } 
 
  @Override 
  public void unHighlightAyat() { 
    mImageView.unhighlight();
  } 
 
  private void handleLongPress(MotionEvent event) {
    QuranAyah result = ImageAyahUtils.getAyahFromCoordinates(
        mCoordinateData, mImageView, event.getX(), event.getY());
    if (result != null) {
      mImageView.highlightAyah(result.getSura(), result.getAyah());