Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-12-07 16:50:38 +01:00
commit 84a9de4082
4 changed files with 31 additions and 10 deletions

View file

@ -1258,7 +1258,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
settings.setLastKnownMapLocation((float) mapView.getLatitude(), (float) mapView.getLongitude());
AnimateDraggingMapThread animatedThread = mapView.getAnimatedDraggingThread();
if (animatedThread.isAnimating() && animatedThread.getTargetIntZoom() != 0) {
if (animatedThread.isAnimating() && animatedThread.getTargetIntZoom() != 0 && !mapViewTrackingUtilities.isMapLinkedToLocation()) {
settings.setMapLocationToShow(animatedThread.getTargetLatitude(), animatedThread.getTargetLongitude(),
animatedThread.getTargetIntZoom());
}

View file

@ -138,11 +138,12 @@ public class GeoIntentActivity extends OsmandListActivity {
settings.setMapLocationToShow(p.getLatitude(), p.getLongitude(),
settings.getLastKnownMapZoom(), pd); //$NON-NLS-1$
MapActivity.launchMapActivityMoveToTop(GeoIntentActivity.this);
} else {
Uri uri = intent.getData();
String searchString = p != null && p.isGeoAddress() ? p.getQuery() : uri.toString();
settings.setSearchRequestToShow(searchString);
MapActivity.launchMapActivityMoveToTop(GeoIntentActivity.this);
}
Uri uri = intent.getData();
String searchString = p != null && p.isGeoAddress() ? p.getQuery() : uri.toString();
settings.setSearchRequestToShow(searchString);
MapActivity.launchMapActivityMoveToTop(GeoIntentActivity.this);
} catch (Exception e) {
e.printStackTrace();
}

View file

@ -1,11 +1,13 @@
package net.osmand.plus.helpers;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.ParcelFileDescriptor;
import android.provider.OpenableColumns;
@ -183,7 +185,9 @@ public class GpxImportHelper {
@Override
protected void onPostExecute(GPXFile result) {
progress.dismiss();
if (isActivityNotDestroyed(activity)) {
progress.dismiss();
}
handleResult(result, fileName, save, useImportDir, false);
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
@ -221,7 +225,9 @@ public class GpxImportHelper {
@Override
protected void onPostExecute(final GPXFile result) {
progress.dismiss();
if (isActivityNotDestroyed(activity)) {
progress.dismiss();
}
importFavourites(result, fileName, save, useImportDir, forceImportFavourites);
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
@ -251,7 +257,9 @@ public class GpxImportHelper {
@Override
protected void onPostExecute(GPXFile result) {
progress.dismiss();
if (isActivityNotDestroyed(activity)) {
progress.dismiss();
}
Toast.makeText(activity, R.string.fav_imported_sucessfully, Toast.LENGTH_LONG).show();
final Intent newIntent = new Intent(activity, app.getAppCustomization().getFavoritesActivity());
newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
@ -307,7 +315,9 @@ public class GpxImportHelper {
@Override
protected void onPostExecute(GPXFile result) {
progress.dismiss();
if (isActivityNotDestroyed(activity)) {
progress.dismiss();
}
handleResult(result, name, save, useImportDir, false);
}
@ -352,12 +362,21 @@ public class GpxImportHelper {
@Override
protected void onPostExecute(GPXFile result) {
progress.dismiss();
if (isActivityNotDestroyed(activity)) {
progress.dismiss();
}
handleResult(result, name, save, useImportDir, false);
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private boolean isActivityNotDestroyed(Activity activity) {
if (Build.VERSION.SDK_INT >= 17) {
return !activity.isFinishing() && !activity.isDestroyed();
}
return !activity.isFinishing();
}
private void handleResult(final GPXFile result, final String name, final boolean save,
final boolean useImportDir, boolean forceImportFavourites) {
if (result != null) {

View file

@ -44,6 +44,7 @@ public class ShareMenuFragment extends Fragment implements OnItemClickListener {
View mainView = view.findViewById(R.id.main_view);
if (menu.isLandscapeLayout()) {
AndroidUtils.addStatusBarPadding21v(getContext(), view);
AndroidUtils.setBackground(view.getContext(), mainView, !menu.isLight(),
R.drawable.bg_left_menu_light, R.drawable.bg_left_menu_dark);
} else {