From 5cef3209cb8364041818268cae42f83a6a120b99 Mon Sep 17 00:00:00 2001 From: pasniak Date: Sat, 29 Apr 2017 19:48:54 -0400 Subject: [PATCH] Fix WebAppPlanInterfaceTest failure by initializing ShadowedText (which loads assets) lazily --- app/src/main/java/com/ds/avare/StorageService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/ds/avare/StorageService.java b/app/src/main/java/com/ds/avare/StorageService.java index 3a8532364..c68e235a9 100644 --- a/app/src/main/java/com/ds/avare/StorageService.java +++ b/app/src/main/java/com/ds/avare/StorageService.java @@ -46,6 +46,7 @@ import com.ds.avare.place.Area; import com.ds.avare.place.Destination; import com.ds.avare.place.GameTFR; +import com.ds.avare.place.Obstacle; import com.ds.avare.place.Plan; import com.ds.avare.position.Movement; import com.ds.avare.position.Pan; @@ -57,7 +58,6 @@ import com.ds.avare.shapes.TFRShape; import com.ds.avare.shapes.TileMap; import com.ds.avare.storage.DataSource; -import com.ds.avare.place.Obstacle; import com.ds.avare.userDefinedWaypoints.UDWMgr; import com.ds.avare.utils.BitmapHolder; import com.ds.avare.utils.InfoLines; @@ -369,7 +369,7 @@ public void onCreate() { mInfoLines = new InfoLines(this); - mShadowedText = new ShadowedText(getApplicationContext()); + mShadowedText = null; mDraw = new Draw(); mPixelDraw = new PixelDraw(); @@ -1254,6 +1254,9 @@ public void setCheckLists(LinkedList list) { } public ShadowedText getShadowedText() { + if (mShadowedText==null) { + mShadowedText = new ShadowedText(getApplicationContext()); + } return mShadowedText; }