Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-01-21 08:53:55 +01:00
commit 9c08ad80c8
3 changed files with 35 additions and 32 deletions

View file

@ -27,7 +27,7 @@ import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceUpdateFreq
public class PerformLiveUpdateAsyncTask
extends AsyncTask<String, Object, IncrementalChangesManager.IncrementalUpdateList> {
private final static Log LOG = PlatformUtil.getLog(OsmLiveActivity.class);
private final static Log LOG = PlatformUtil.getLog(PerformLiveUpdateAsyncTask.class);
private final Context context;
private final LocalIndexInfo localIndexInfo;
@ -42,6 +42,7 @@ public class PerformLiveUpdateAsyncTask
@Override
protected void onPreExecute() {
LOG.debug("onPreExecute");
if (context instanceof AbstractDownloadActivity) {
AbstractDownloadActivity activity = (AbstractDownloadActivity) context;
activity.setSupportProgressBarIndeterminateVisibility(true);
@ -58,6 +59,7 @@ public class PerformLiveUpdateAsyncTask
@Override
protected IncrementalChangesManager.IncrementalUpdateList doInBackground(String... params) {
LOG.debug("doInBackground");
final OsmandApplication myApplication = getMyApplication();
IncrementalChangesManager cm = myApplication.getResourceManager().getChangesManager();
return cm.getUpdatesByMonth(params[0]);
@ -65,6 +67,7 @@ public class PerformLiveUpdateAsyncTask
@Override
protected void onPostExecute(IncrementalChangesManager.IncrementalUpdateList result) {
LOG.debug("onPostExecute");
if (context instanceof AbstractDownloadActivity) {
AbstractDownloadActivity activity = (AbstractDownloadActivity) context;
activity.setSupportProgressBarIndeterminateVisibility(false);

View file

@ -14,7 +14,7 @@ import org.apache.commons.logging.Log;
public class DoubleTapScaleDetector {
private static final Log LOG = PlatformUtil.getLog(DoubleTapScaleDetector.class);
private static final int DOUBLE_TAPPING_DELTA = ViewConfiguration.getTapTimeout() + 100;
private static final int DP_PER_1X = 100;
private static final int DP_PER_1X = 200;
private final DoubleTapZoomListener listener;
protected final Context ctx;
@ -23,6 +23,7 @@ public class DoubleTapScaleDetector {
private boolean isDoubleTapping = false;
private float startX;
private float startY;
private float scale;
public DoubleTapScaleDetector(Context ctx, DoubleTapZoomListener listener) {
this.ctx = ctx;
@ -37,7 +38,7 @@ public class DoubleTapScaleDetector {
if (event.getAction() == MotionEvent.ACTION_UP) {
if (isDoubleTapping) {
isDoubleTapping = false;
listener.onZoomEnded(1, 0);
listener.onZoomEnded(scale, 0);
return true;
} else {
startTime = currentTime;
@ -55,7 +56,7 @@ public class DoubleTapScaleDetector {
if (isDoubleTapping) {
float delta = convertPxToDp((int) (startY - event.getY()));
float scaleDelta = delta / DP_PER_1X;
float scale = 1 - scaleDelta;
scale = 1 - scaleDelta;
listener.onZoomingOrRotating(scale, 0);
return true;
} else {

View file

@ -770,12 +770,11 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
return true;
}
}
if (!doubleTapScaleDetector.onTouchEvent(event)) {
if (!multiTouchSupport.onTouchEvent(event)) {
/* return */
doubleTapScaleDetector.onTouchEvent(event);
gestureDetector.onTouchEvent(event);
}
}
return true;
}