private void handleHighlightAyah(int sura, int ayah) { if (mImageView == null) { return; } mImageView.highlightAyah(sura, ayah); 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(); }
public void highlightAyah(int sura, int ayah) { View v = mQuranPage.getCurrentPage(); HighlightingImageView iv = (HighlightingImageView) v.findViewById(R.id.page_image); if (iv != null) { HighlightingImageView hi = (HighlightingImageView) iv; hi.highlightAyah(sura, ayah); if (QuranSettings.getInstance().isAutoScroll() && v.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { AyahBounds yBounds = hi.getYBoundsForCurrentHighlight(); if (yBounds != null) mQuranPage.scrollToAyah(R.id.page_scroller, yBounds); } mQuranPage.invalidate(); } }