Merge remote-tracking branch 'origin/master'
|
@ -12,6 +12,7 @@ import java.util.LinkedHashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.parsers.SAXParser;
|
||||
|
@ -218,7 +219,7 @@ public class MapRenderingTypes {
|
|||
for(MapRulType type : types.values()){
|
||||
if(type.poiCategory != null && type.targetTagValue == null) {
|
||||
if(!amenityTypeNameToTagVal.containsKey(type.poiCategory)) {
|
||||
amenityTypeNameToTagVal.put(type.poiCategory, new LinkedHashMap<String, String>());
|
||||
amenityTypeNameToTagVal.put(type.poiCategory, new TreeMap<String, String>());
|
||||
}
|
||||
String name = type.value;
|
||||
if (name != null) {
|
||||
|
|
|
@ -216,7 +216,8 @@
|
|||
<filter appMode="pedestrian" tag="highway" value="bridleway" order="59"/>
|
||||
<filter tag="highway" value="bridleway" order="36"/>
|
||||
|
||||
<filter tag="natural" value="coastline_broken" order="35"/>
|
||||
<filter tag="natural" value="coastline_broken" order="35"/>
|
||||
<filter tag="natural" value="coastline_line" order="35"/>
|
||||
<filter tag="route" value="ferry" order="35"/>
|
||||
<filter tag="aeroway" value="" order="32"/>
|
||||
<filter tag="contour" value="" order="15"/>
|
||||
|
@ -1016,6 +1017,7 @@
|
|||
|
||||
<line>
|
||||
<filter minzoom="1" tag="natural" value="coastline_broken" color="#111111" strokeWidth="1"/>
|
||||
<filter minzoom="11" tag="natural" value="coastline_line" color="#cc999999" strokeWidth="1"/>
|
||||
<group>
|
||||
<filter viRendered="true" tag="highway" value="motorway" maxzoom="13" color="#6666CC"/>
|
||||
<!-- PALE-SCHEME filter hmRendered="true" tag="highway" value="motorway" maxzoom="13" color="#809bff"/ -->
|
||||
|
|
|
@ -90,7 +90,9 @@ public class OsmExtractionUI implements IMapLocationListener {
|
|||
if(!(e instanceof ThreadDeath)){
|
||||
ExceptionHandler.handle("Error in thread " + t.getName(), e); //$NON-NLS-1$
|
||||
}
|
||||
defaultHandler.uncaughtException(t, e);
|
||||
if(defaultHandler != null){
|
||||
defaultHandler.uncaughtException(t, e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 989 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 989 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 773 B After Width: | Height: | Size: 792 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.4 KiB |
|
@ -4,6 +4,7 @@
|
|||
android:background="@drawable/tab_menu_item_small">
|
||||
|
||||
<ImageView
|
||||
android:src="@drawable/expandable_category_unpushed"
|
||||
android:id="@+id/explist_indicator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -36,42 +36,4 @@ public class AndroidUtils {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param closeButton expand area of which element
|
||||
* @param left multiplier of width to add to left, 1 does nothing
|
||||
* @param top multiplier of height to add to top, 1 does nothing
|
||||
* @param right multiplier of width to add to right, 1 does nothing
|
||||
* @param bottom multiplier of height to add to bottom, 1 does nothing
|
||||
*/
|
||||
public static void expandClickableArea(final View closeButton,
|
||||
final int left, final int top, final int right, final int bottom) {
|
||||
closeButton.setOnTouchListener(new OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
v.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
closeButton.performClick();
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
// increase touch area for the button
|
||||
final View parent = (View) closeButton.getParent();
|
||||
parent.post(new Runnable() {
|
||||
// Post in the parent's message queue to make sure the parent
|
||||
// lays out its children before we call getHitRect()
|
||||
@Override
|
||||
public void run() {
|
||||
Rect r = new Rect();
|
||||
closeButton.getHitRect(r);
|
||||
r.left -= r.width() * left;
|
||||
r.top -= r.height() * top;
|
||||
r.right += r.width() * right;
|
||||
r.bottom += r.height() * bottom;
|
||||
parent.setTouchDelegate(new TouchDelegate(r, closeButton));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -201,10 +201,6 @@ public class OsmAndFormatter {
|
|||
public static String getPoiStringWithoutType(Amenity amenity, boolean en) {
|
||||
String type = SpecialPhrases.getSpecialPhrase(amenity.getSubType());
|
||||
String n = amenity.getName(en);
|
||||
|
||||
if (type == null) {
|
||||
type = amenity.getSubType();
|
||||
}
|
||||
if (n.indexOf(type) != -1) {
|
||||
// type is contained in name e.g.
|
||||
// n = "Bakery the Corner"
|
||||
|
|
|
@ -46,7 +46,6 @@ import android.content.res.Configuration;
|
|||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.text.format.DateFormat;
|
||||
import android.util.Log;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
@ -510,10 +509,10 @@ public class OsmandApplication extends Application {
|
|||
PrintStream printStream = new PrintStream(out);
|
||||
ex.printStackTrace(printStream);
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append(
|
||||
"Exception occured in thread " + thread.toString() + " : "). //$NON-NLS-1$ //$NON-NLS-2$
|
||||
append(DateFormat.format("MMMM dd, yyyy h:mm:ss", System.currentTimeMillis())).append("\n"). //$NON-NLS-1$//$NON-NLS-2$
|
||||
append(new String(out.toByteArray()));
|
||||
msg.append("Version " + Version.getFullVersion(OsmandApplication.this)). //$NON-NLS-1$
|
||||
append("Exception occured in thread " + thread.toString() + " : "). //$NON-NLS-1$ //$NON-NLS-2$
|
||||
append(DateFormat.format("MMMM dd, yyyy h:mm:ss", System.currentTimeMillis())).append("\n"). //$NON-NLS-1$//$NON-NLS-2$
|
||||
append(new String(out.toByteArray()));
|
||||
|
||||
if (file.getParentFile().canWrite()) {
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(file, true));
|
||||
|
|
|
@ -26,18 +26,22 @@ public class SpecialPhrases {
|
|||
*
|
||||
* If the language isn't set yet, a nullpointer exception will be thrown
|
||||
*
|
||||
* @param key the subtype to query
|
||||
* @param value the subtype to query
|
||||
* @return the special phrase according to the asked key, or "null" if the key isn't found
|
||||
*/
|
||||
public static String getSpecialPhrase(String key) {
|
||||
public static String getSpecialPhrase(String value) {
|
||||
if (m == null) {
|
||||
// do not throw exception because OsmAndApplication is not always initiliazed before
|
||||
// this call
|
||||
log.warn("The language has not been set for special phrases");
|
||||
return null;
|
||||
return value;
|
||||
|
||||
}
|
||||
return m.get(key);
|
||||
String specialValue = m.get(value);
|
||||
if(Algoritms.isEmpty(specialValue)) {
|
||||
return value;
|
||||
}
|
||||
return specialValue;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,10 @@
|
|||
*/
|
||||
package net.osmand.plus.activities;
|
||||
|
||||
import java.text.Collator;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -16,6 +19,7 @@ import net.osmand.plus.OsmandApplication;
|
|||
import net.osmand.plus.PoiFilter;
|
||||
import net.osmand.plus.PoiFiltersHelper;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.SpecialPhrases;
|
||||
import net.osmand.plus.activities.search.SearchActivity;
|
||||
import net.osmand.plus.activities.search.SearchPOIActivity;
|
||||
import android.app.AlertDialog;
|
||||
|
@ -197,8 +201,22 @@ public class EditPOIFilterActivity extends OsmandListActivity {
|
|||
}
|
||||
|
||||
final String[] array = subCategories.toArray(new String[0]);
|
||||
final Collator cl = Collator.getInstance();
|
||||
cl.setStrength(Collator.SECONDARY);
|
||||
Arrays.sort(array, 0, array.length, new Comparator<String>() {
|
||||
|
||||
@Override
|
||||
public int compare(String object1, String object2) {
|
||||
String v1 = SpecialPhrases.getSpecialPhrase(object1).replace('_', ' ');
|
||||
String v2 = SpecialPhrases.getSpecialPhrase(object2).replace('_', ' ');
|
||||
return cl.compare(v1, v2);
|
||||
}
|
||||
});
|
||||
final String[] visibleNames = new String[array.length];
|
||||
final boolean[] selected = new boolean[array.length];
|
||||
for (int i = 0; i < selected.length; i++) {
|
||||
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
visibleNames[i] = SpecialPhrases.getSpecialPhrase(array[i]).replace('_', ' ');
|
||||
if (acceptedCategories == null) {
|
||||
selected[i] = true;
|
||||
} else {
|
||||
|
@ -239,7 +257,7 @@ public class EditPOIFilterActivity extends OsmandListActivity {
|
|||
}
|
||||
});
|
||||
|
||||
builder.setMultiChoiceItems(array, selected, new DialogInterface.OnMultiChoiceClickListener() {
|
||||
builder.setMultiChoiceItems(visibleNames, selected, new DialogInterface.OnMultiChoiceClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int item, boolean isChecked) {
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.io.File;
|
|||
import java.text.MessageFormat;
|
||||
import java.util.Random;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.Version;
|
||||
import net.osmand.access.AccessibleAlertBuilder;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
|
@ -223,8 +222,6 @@ public class MainMenuActivity extends Activity {
|
|||
}
|
||||
}
|
||||
});
|
||||
AndroidUtils.expandClickableArea(closeButton, 1,1,3,3);
|
||||
|
||||
View searchButton = window.findViewById(R.id.SearchButton);
|
||||
searchButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
|
|
|
@ -353,7 +353,7 @@ public class EditingPOIActivity implements DialogProvider {
|
|||
}
|
||||
});
|
||||
}
|
||||
v.invalidate();
|
||||
layout.requestLayout();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -451,6 +451,7 @@ public class RouteProvider {
|
|||
RouteDirectionInfo last = directions.get(directions.size() - 1);
|
||||
// update speed using time and idstance
|
||||
last.setAverageSpeed((distanceToEnd[last.routePointOffset] - distanceToEnd[offset])/last.getAverageSpeed());
|
||||
last.distance = (int) (distanceToEnd[last.routePointOffset] - distanceToEnd[offset]);
|
||||
}
|
||||
// save time as a speed because we don't know distance of the route segment
|
||||
float avgSpeed = time;
|
||||
|
|
|
@ -57,6 +57,13 @@ bool processCoastlines(std::vector<MapDataObject*>& coastLines, int leftX, int
|
|||
o->types.push_back(tag_value("natural", "coastline_broken"));
|
||||
res.push_back(o);
|
||||
}
|
||||
// draw completed for debug purpose
|
||||
for (int i = 0; i < completedRings.size(); i++) {
|
||||
MapDataObject* o = new MapDataObject();
|
||||
o->points = completedRings[i];
|
||||
o->types.push_back(tag_value("natural", "coastline_line"));
|
||||
res.push_back(o);
|
||||
}
|
||||
|
||||
}
|
||||
if (!showIfThereIncompleted && uncompletedRings.size() > 0) {
|
||||
|
|