Merge branch 'master' of ssh://github.com/osmandapp/Osmand

This commit is contained in:
PavelRatushny 2017-10-20 13:55:19 +03:00
commit d687b02ead
7 changed files with 35 additions and 5 deletions

View file

@ -39,10 +39,10 @@ android {
defaultConfig {
minSdkVersion System.getenv("MIN_SDK_VERSION") ? System.getenv("MIN_SDK_VERSION").toInteger() : 14
targetSdkVersion 23
versionCode 270
versionCode 300
versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode
multiDexEnabled true
versionName "2.7.0"
versionName "3.0.0"
versionName System.getenv("APK_VERSION")? System.getenv("APK_VERSION").toString(): versionName
versionName System.getenv("APK_VERSION_SUFFIX")? versionName + System.getenv("APK_VERSION_SUFFIX").toString(): versionName
}

View file

@ -787,6 +787,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
progressTitle.setText(titleProgressController.caption);
progressBar.setIndeterminate(titleProgressController.indeterminate);
progressBar.setProgress(titleProgressController.progress);
progressBar.setVisibility(titleProgressController.progressVisible ? View.VISIBLE : View.GONE);
final ImageView progressButton = (ImageView) view.findViewById(R.id.progressButton);
progressButton.setVisibility(titleProgressController.buttonVisible ? View.VISIBLE : View.GONE);

View file

@ -440,7 +440,9 @@ public abstract class MenuController extends BaseMenuController {
leftDownloadButtonController.visible = !downloaded;
leftDownloadButtonController.leftIconId = R.drawable.ic_action_import;
boolean downloadIndexes = getMapActivity().getMyApplication().getSettings().isInternetConnectionAvailable()
boolean internetConnectionAvailable =
getMapActivity().getMyApplication().getSettings().isInternetConnectionAvailable();
boolean downloadIndexes = internetConnectionAvailable
&& !downloadThread.getIndexes().isDownloadedFromInternet
&& !downloadThread.getIndexes().downloadFromInternetFailed;
@ -470,6 +472,9 @@ public abstract class MenuController extends BaseMenuController {
} else if (downloadIndexes) {
titleProgressController.setIndexesDownloadMode();
titleProgressController.visible = true;
} else if (!internetConnectionAvailable) {
titleProgressController.setNoInternetConnectionMode();
titleProgressController.visible = true;
} else {
titleProgressController.visible = false;
}
@ -507,16 +512,25 @@ public abstract class MenuController extends BaseMenuController {
public int progress = 0;
public boolean indeterminate;
public boolean visible;
public boolean progressVisible;
public boolean buttonVisible;
public void setIndexesDownloadMode() {
caption = getMapActivity().getString(R.string.downloading_list_indexes);
indeterminate = true;
progressVisible = true;
buttonVisible = false;
}
public void setNoInternetConnectionMode() {
caption = getMapActivity().getString(R.string.no_index_file_to_download);
progressVisible = false;
buttonVisible = false;
}
public void setMapDownloadMode() {
indeterminate = false;
progressVisible = true;
buttonVisible = true;
}

View file

@ -353,7 +353,9 @@ public class MapDataMenuController extends MenuController {
topRightTitleButtonController.visible = (otherIndexItems != null && otherIndexItems.size() > 0)
|| (otherLocalIndexInfos != null && otherLocalIndexInfos.size() > 0);
boolean downloadIndexes = getMapActivity().getMyApplication().getSettings().isInternetConnectionAvailable()
boolean internetConnectionAvailable =
getMapActivity().getMyApplication().getSettings().isInternetConnectionAvailable();
boolean downloadIndexes = internetConnectionAvailable
&& !downloadThread.getIndexes().isDownloadedFromInternet
&& !downloadThread.getIndexes().downloadFromInternetFailed;
@ -383,6 +385,9 @@ public class MapDataMenuController extends MenuController {
} else if (downloadIndexes) {
titleProgressController.setIndexesDownloadMode();
titleProgressController.visible = true;
} else if (!internetConnectionAvailable) {
titleProgressController.setNoInternetConnectionMode();
titleProgressController.visible = true;
} else {
titleProgressController.visible = false;
}

View file

@ -72,7 +72,11 @@ public class MapMarkerSelectionFragment extends BaseOsmAndDialogFragment {
LatLon myLoc = l == null ? null : new LatLon(l.getLatitude(), l.getLongitude());
useCenter = !mapLinked;
loc = (useCenter ? mw : myLoc);
heading = useCenter ? -mapRotation : head;
if (useCenter) {
heading = -mapRotation;
} else {
heading = head;
}
}
}
nightMode = !app.getSettings().isLightContent();

View file

@ -55,6 +55,9 @@ public class MapMarkersActiveFragment extends Fragment implements OsmAndCompassL
@Override
public void onItemClick(View view) {
int pos = recyclerView.getChildAdapterPosition(view);
if (pos == RecyclerView.NO_POSITION) {
return;
}
MapMarker marker = adapter.getItem(pos);
mapActivity.getMyApplication().getSettings().setMapLocationToShow(marker.getLatitude(), marker.getLongitude(),
15, marker.getPointDescription(mapActivity), true, marker);

View file

@ -184,6 +184,9 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel
@Override
public void onItemClick(View view) {
int pos = recyclerView.getChildAdapterPosition(view);
if (pos == RecyclerView.NO_POSITION) {
return;
}
Object item = adapter.getItem(pos);
if (item instanceof MapMarker) {
MapMarker marker = (MapMarker) item;