From e4b05d70f8d82b478c5803ad52fb77875e4c9b4f Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Mon, 18 Feb 2013 13:41:36 +0000 Subject: Android: avoid unnecessary repeated set up of child views This change showed up a bug where highlights may fail to show if passed in while the page was set as blank. That bug is also fixed in this commit --- android/src/com/artifex/mupdfdemo/PageView.java | 3 +++ android/src/com/artifex/mupdfdemo/ReaderView.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'android') diff --git a/android/src/com/artifex/mupdfdemo/PageView.java b/android/src/com/artifex/mupdfdemo/PageView.java index b6b533bd..17673493 100644 --- a/android/src/com/artifex/mupdfdemo/PageView.java +++ b/android/src/com/artifex/mupdfdemo/PageView.java @@ -224,6 +224,9 @@ public abstract class PageView extends ViewGroup { } mIsBlank = false; + // Highlights may be missing because mIsBlank was true on last draw + if (mSearchView != null) + mSearchView.invalidate(); mPageNumber = page; if (mEntire == null) { diff --git a/android/src/com/artifex/mupdfdemo/ReaderView.java b/android/src/com/artifex/mupdfdemo/ReaderView.java index 9e738cac..d1e7c086 100644 --- a/android/src/com/artifex/mupdfdemo/ReaderView.java +++ b/android/src/com/artifex/mupdfdemo/ReaderView.java @@ -677,9 +677,9 @@ public class ReaderView extends AdapterView if (v == null) { v = mAdapter.getView(i, getCached(), this); addAndMeasureChild(i, v); + onChildSetup(i, v); + onScaleChild(v, mScale); } - onChildSetup(i, v); - onScaleChild(v, mScale); return v; } -- cgit v1.2.3