Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-10-24 12:48:07 +02:00
commit 5cce604afd
5 changed files with 76 additions and 12 deletions

View file

@ -3635,4 +3635,11 @@
<string name="poi_amperage">Ток</string>
<string name="poi_charging_station_output">Мощность зарядной станции</string>
<string name="poi_map_type_topo">Тип карты: топографическая</string>
<string name="poi_map_type_street">Тип карты: карта улиц</string>
<string name="poi_map_type_scheme">Тип карты: схематическая</string>
<string name="poi_map_size_site">Охват карты: место</string>
<string name="poi_map_size_city">Охват карты: город</string>
<string name="poi_map_size_region">Охват карты: регион</string>
</resources>

View file

@ -3624,4 +3624,12 @@
<string name="poi_amperage">Amperage</string>
<string name="poi_charging_station_output">Сharging station output</string>
<string name="poi_map_type_topo">Map type: topo</string>
<string name="poi_map_type_street">Map type: street</string>
<string name="poi_map_type_scheme">Map type: scheme</string>
<string name="poi_map_type_toposcope">Map type: toposcope</string>
<string name="poi_map_size_site">Map size: site</string>
<string name="poi_map_size_city">Map size: city</string>
<string name="poi_map_size_region">Map size: region</string>
</resources>

View file

@ -856,7 +856,52 @@ public class GpxUiHelper {
if (res != 0) {
return res;
}
return -i1.getFileName().toLowerCase().compareTo(i2.getFileName().toLowerCase());
String name1 = i1.getFileName();
String name2 = i2.getFileName();
int d1 = depth(name1);
int d2 = depth(name2);
if (d1 != d2) {
return d1 - d2;
}
int lastSame = 0;
for (int i = 0; i < name1.length() && i < name2.length(); i++) {
if (name1.charAt(i) != name2.charAt(i)) {
break;
}
if (name1.charAt(i) == '/') {
lastSame = i + 1;
}
}
boolean isDigitStarts1 = isLastSameStartsWithDigit(name1, lastSame);
boolean isDigitStarts2 = isLastSameStartsWithDigit(name2, lastSame);
res = isDigitStarts1 == isDigitStarts2 ? 0 : isDigitStarts1 ? -1 : 1;
if (res != 0) {
return res;
}
if (isDigitStarts1) {
return -name1.compareToIgnoreCase(name2);
}
return name1.compareToIgnoreCase(name2);
}
private int depth(String name1) {
int d = 0;
for (int i = 0; i < name1.length(); i++) {
if (name1.charAt(i) == '/') {
d++;
}
}
return d;
}
private boolean isLastSameStartsWithDigit(String name1, int lastSame) {
if (name1.length() > lastSame) {
return Character.isDigit(name1.charAt(lastSame));
}
return false;
}
});
return list;

View file

@ -574,7 +574,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
}
private void restoreCustomMapRatio() {
if (map.hasCustomMapRatio()) {
if (map != null && map.hasCustomMapRatio()) {
map.restoreMapRatio();
}
}
@ -881,16 +881,18 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
public void onPause() {
restoreCustomMapRatio();
ViewParent parent = view.getParent();
if (parent != null && containerLayoutListener != null) {
((View) parent).removeOnLayoutChangeListener(containerLayoutListener);
if (view != null) {
ViewParent parent = view.getParent();
if (parent != null && containerLayoutListener != null) {
((View) parent).removeOnLayoutChangeListener(containerLayoutListener);
}
getMapActivity().getMapViewTrackingUtilities().setContextMenu(null);
getMapActivity().getMapViewTrackingUtilities().setMapLinkedToLocation(false);
if (!wasDrawerDisabled) {
getMapActivity().enableDrawer();
}
menu.updateControlsVisibility(false);
}
getMapActivity().getMapViewTrackingUtilities().setContextMenu(null);
getMapActivity().getMapViewTrackingUtilities().setMapLinkedToLocation(false);
if (!wasDrawerDisabled) {
getMapActivity().enableDrawer();
}
menu.updateControlsVisibility(false);
super.onPause();
}

View file

@ -268,7 +268,9 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
public void afterTextChanged(Editable s) {
if (!getEditPoiData().isInEdit()) {
getEditPoiData().updateTypeTag(s.toString());
poiTypeTextInputLayout.setHint(editPoiData.getPoiCategory().getTranslation());
if (!getMyApplication().isApplicationInitializing()) {
poiTypeTextInputLayout.setHint(editPoiData.getPoiCategory().getTranslation());
}
}
}
});