Merge pull request #9122 from osmandapp/fix_9067

Fix_9067
This commit is contained in:
max-klaus 2020-06-02 18:08:11 +03:00 committed by GitHub
commit f40cd01730
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 16 deletions

View file

@ -1,8 +1,6 @@
package net.osmand.plus.views; package net.osmand.plus.views;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
import android.content.Context; import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
@ -103,19 +101,7 @@ public class OsmAndMapSurfaceView extends SurfaceView implements Callback {
return mapView.onTouchEvent(event); return mapView.onTouchEvent(event);
} }
@Override
protected void onDraw(Canvas canvas) {
if(mapView == null) {
return;
}
boolean nightMode = mapView.getApplication().getDaynightHelper().isNightMode();
DrawSettings drawSettings = new DrawSettings(nightMode, false);
mapView.drawOverMap(canvas, mapView.getCurrentRotatedTileBox().copy(), drawSettings);
}
public OsmandMapTileView getMapView() { public OsmandMapTileView getMapView() {
return mapView; return mapView;
} }
} }

View file

@ -13,6 +13,7 @@ import android.graphics.Paint;
import android.graphics.Paint.Style; import android.graphics.Paint.Style;
import android.graphics.PointF; import android.graphics.PointF;
import android.graphics.RectF; import android.graphics.RectF;
import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.os.SystemClock; import android.os.SystemClock;
@ -42,10 +43,10 @@ import net.osmand.map.MapTileDownloader.IMapDownloaderCallback;
import net.osmand.plus.OsmAndConstants; import net.osmand.plus.OsmAndConstants;
import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.settings.backend.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.helpers.TwoFingerTapDetector; import net.osmand.plus.helpers.TwoFingerTapDetector;
import net.osmand.plus.settings.backend.OsmandSettings;
import net.osmand.plus.views.MultiTouchSupport.MultiTouchZoomListener; import net.osmand.plus.views.MultiTouchSupport.MultiTouchZoomListener;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
import net.osmand.render.RenderingRuleSearchRequest; import net.osmand.render.RenderingRuleSearchRequest;
@ -267,6 +268,9 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
view.setClickable(true); view.setClickable(true);
view.setLongClickable(true); view.setLongClickable(true);
view.setFocusable(true); view.setFocusable(true);
if (Build.VERSION.SDK_INT >= 26) {
view.setDefaultFocusHighlightEnabled(false);
}
refreshMap(true); refreshMap(true);
} }