diff --git a/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java b/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java index bbe7f02d42..66c5080f54 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java @@ -35,17 +35,14 @@ public class DiscountHelper { public static void checkAndDisplay(final MapActivity mapActivity) { - if (mBannerVisible) { showDiscountBanner(mapActivity, mTitle, mDescription, mIcon, mUrl); } - if (System.currentTimeMillis() - mLastCheckTime < 1000 * 60 * 60 * 24 || !mapActivity.getMyApplication().getSettings().isInternetConnectionAvailable()) { return; } mLastCheckTime = System.currentTimeMillis(); - new AsyncTask() { @Override @@ -54,7 +51,6 @@ public class DiscountHelper { String res = AndroidNetworkUtils.sendRequest(mapActivity.getMyApplication(), "http://osmand.net/api/motd", null, "Requesting discount info...", false); return res; - } catch (Exception e) { logError("Requesting discount info error: ", e); return null; diff --git a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java index 01acfe9786..7439e7064a 100644 --- a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java +++ b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java @@ -784,7 +784,7 @@ public class MapRenderRepositories { if (checkWhetherInterrupted()) { // revert if it was interrupted // (be smart a bit do not revert if road already drawn) - if(currentRenderingContext.lastRenderedKey < 35) { + if(currentRenderingContext.lastRenderedKey < OsmandRenderer.DEFAULT_LINE_MAX) { reuse = this.bmp; this.bmp = this.prevBmp; this.bmpLocation = this.prevBmpLocation; diff --git a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java index c00b6fd1ee..426fdc7b1f 100644 --- a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java @@ -59,6 +59,10 @@ public class OsmandRenderer { private Paint paint; private Paint paintIcon; + public static final int DEFAULT_POLYGON_MAX = 11; + public static final int DEFAULT_LINE_MAX = 100; + public static final int DEFAULT_POINTS_MAX = 200; + public static final int TILE_SIZE = 256; private static final int MAX_V = 75; @@ -260,16 +264,16 @@ public class OsmandRenderer { rc.lastRenderedKey = 0; drawObject(rc, cv, render, polygonsArray, 0); - rc.lastRenderedKey = 5; + rc.lastRenderedKey = DEFAULT_POLYGON_MAX; if (rc.shadowRenderingMode > 1) { drawObject(rc, cv, render, linesArray, 1); } - rc.lastRenderedKey = 40; + rc.lastRenderedKey = (DEFAULT_LINE_MAX + DEFAULT_POLYGON_MAX) / 2; drawObject(rc, cv, render, linesArray, 2); - rc.lastRenderedKey = 60; + rc.lastRenderedKey = DEFAULT_LINE_MAX; drawObject(rc, cv, render, pointsArray, 3); - rc.lastRenderedKey = 125; + rc.lastRenderedKey = DEFAULT_POINTS_MAX; long beforeIconTextTime = System.currentTimeMillis() - now;