Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2012-09-09 20:00:11 +02:00
commit 3353cfa4e4
19 changed files with 50 additions and 60 deletions

View file

@ -12,6 +12,7 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.TreeMap;
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParser;
@ -218,7 +219,7 @@ public class MapRenderingTypes {
for(MapRulType type : types.values()){ for(MapRulType type : types.values()){
if(type.poiCategory != null && type.targetTagValue == null) { if(type.poiCategory != null && type.targetTagValue == null) {
if(!amenityTypeNameToTagVal.containsKey(type.poiCategory)) { 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; String name = type.value;
if (name != null) { if (name != null) {

View file

@ -216,7 +216,8 @@
<filter appMode="pedestrian" tag="highway" value="bridleway" order="59"/> <filter appMode="pedestrian" tag="highway" value="bridleway" order="59"/>
<filter tag="highway" value="bridleway" order="36"/> <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="route" value="ferry" order="35"/>
<filter tag="aeroway" value="" order="32"/> <filter tag="aeroway" value="" order="32"/>
<filter tag="contour" value="" order="15"/> <filter tag="contour" value="" order="15"/>
@ -1016,6 +1017,7 @@
<line> <line>
<filter minzoom="1" tag="natural" value="coastline_broken" color="#111111" strokeWidth="1"/> <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> <group>
<filter viRendered="true" tag="highway" value="motorway" maxzoom="13" color="#6666CC"/> <filter viRendered="true" tag="highway" value="motorway" maxzoom="13" color="#6666CC"/>
<!-- PALE-SCHEME filter hmRendered="true" tag="highway" value="motorway" maxzoom="13" color="#809bff"/ --> <!-- PALE-SCHEME filter hmRendered="true" tag="highway" value="motorway" maxzoom="13" color="#809bff"/ -->

View file

@ -90,7 +90,9 @@ public class OsmExtractionUI implements IMapLocationListener {
if(!(e instanceof ThreadDeath)){ if(!(e instanceof ThreadDeath)){
ExceptionHandler.handle("Error in thread " + t.getName(), e); //$NON-NLS-1$ ExceptionHandler.handle("Error in thread " + t.getName(), e); //$NON-NLS-1$
} }
defaultHandler.uncaughtException(t, e); if(defaultHandler != null){
defaultHandler.uncaughtException(t, e);
}
} }
}); });

Binary file not shown.

Before

Width:  |  Height:  |  Size: 797 B

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 797 B

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 773 B

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -4,6 +4,7 @@
android:background="@drawable/tab_menu_item_small"> android:background="@drawable/tab_menu_item_small">
<ImageView <ImageView
android:src="@drawable/expandable_category_unpushed"
android:id="@+id/explist_indicator" android:id="@+id/explist_indicator"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View file

@ -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));
}
});
}
} }

View file

@ -201,10 +201,6 @@ public class OsmAndFormatter {
public static String getPoiStringWithoutType(Amenity amenity, boolean en) { public static String getPoiStringWithoutType(Amenity amenity, boolean en) {
String type = SpecialPhrases.getSpecialPhrase(amenity.getSubType()); String type = SpecialPhrases.getSpecialPhrase(amenity.getSubType());
String n = amenity.getName(en); String n = amenity.getName(en);
if (type == null) {
type = amenity.getSubType();
}
if (n.indexOf(type) != -1) { if (n.indexOf(type) != -1) {
// type is contained in name e.g. // type is contained in name e.g.
// n = "Bakery the Corner" // n = "Bakery the Corner"

View file

@ -46,7 +46,6 @@ import android.content.res.Configuration;
import android.os.Build; import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.text.format.DateFormat; import android.text.format.DateFormat;
import android.util.Log;
import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityManager;
import android.widget.Toast; import android.widget.Toast;
@ -510,10 +509,10 @@ public class OsmandApplication extends Application {
PrintStream printStream = new PrintStream(out); PrintStream printStream = new PrintStream(out);
ex.printStackTrace(printStream); ex.printStackTrace(printStream);
StringBuilder msg = new StringBuilder(); StringBuilder msg = new StringBuilder();
msg.append( msg.append("Version " + Version.getFullVersion(OsmandApplication.this)). //$NON-NLS-1$
"Exception occured in thread " + thread.toString() + " : "). //$NON-NLS-1$ //$NON-NLS-2$ 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(DateFormat.format("MMMM dd, yyyy h:mm:ss", System.currentTimeMillis())).append("\n"). //$NON-NLS-1$//$NON-NLS-2$
append(new String(out.toByteArray())); append(new String(out.toByteArray()));
if (file.getParentFile().canWrite()) { if (file.getParentFile().canWrite()) {
BufferedWriter writer = new BufferedWriter(new FileWriter(file, true)); BufferedWriter writer = new BufferedWriter(new FileWriter(file, true));

View file

@ -26,18 +26,22 @@ public class SpecialPhrases {
* *
* If the language isn't set yet, a nullpointer exception will be thrown * 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 * @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) { if (m == null) {
// do not throw exception because OsmAndApplication is not always initiliazed before // do not throw exception because OsmAndApplication is not always initiliazed before
// this call // this call
log.warn("The language has not been set for special phrases"); 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;
} }
/** /**

View file

@ -3,7 +3,10 @@
*/ */
package net.osmand.plus.activities; package net.osmand.plus.activities;
import java.text.Collator;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.Set; import java.util.Set;
@ -16,6 +19,7 @@ import net.osmand.plus.OsmandApplication;
import net.osmand.plus.PoiFilter; import net.osmand.plus.PoiFilter;
import net.osmand.plus.PoiFiltersHelper; import net.osmand.plus.PoiFiltersHelper;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.SpecialPhrases;
import net.osmand.plus.activities.search.SearchActivity; import net.osmand.plus.activities.search.SearchActivity;
import net.osmand.plus.activities.search.SearchPOIActivity; import net.osmand.plus.activities.search.SearchPOIActivity;
import android.app.AlertDialog; import android.app.AlertDialog;
@ -197,8 +201,22 @@ public class EditPOIFilterActivity extends OsmandListActivity {
} }
final String[] array = subCategories.toArray(new String[0]); 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]; 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) { if (acceptedCategories == null) {
selected[i] = true; selected[i] = true;
} else { } 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 @Override
public void onClick(DialogInterface dialog, int item, boolean isChecked) { public void onClick(DialogInterface dialog, int item, boolean isChecked) {

View file

@ -4,7 +4,6 @@ import java.io.File;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.Random; import java.util.Random;
import net.osmand.AndroidUtils;
import net.osmand.Version; import net.osmand.Version;
import net.osmand.access.AccessibleAlertBuilder; import net.osmand.access.AccessibleAlertBuilder;
import net.osmand.plus.OsmandApplication; 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); View searchButton = window.findViewById(R.id.SearchButton);
searchButton.setOnClickListener(new OnClickListener() { searchButton.setOnClickListener(new OnClickListener() {
@Override @Override

View file

@ -353,7 +353,7 @@ public class EditingPOIActivity implements DialogProvider {
} }
}); });
} }
v.invalidate(); layout.requestLayout();
} }
}); });

View file

@ -451,6 +451,7 @@ public class RouteProvider {
RouteDirectionInfo last = directions.get(directions.size() - 1); RouteDirectionInfo last = directions.get(directions.size() - 1);
// update speed using time and idstance // update speed using time and idstance
last.setAverageSpeed((distanceToEnd[last.routePointOffset] - distanceToEnd[offset])/last.getAverageSpeed()); 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 // save time as a speed because we don't know distance of the route segment
float avgSpeed = time; float avgSpeed = time;

View file

@ -57,6 +57,13 @@ bool processCoastlines(std::vector<MapDataObject*>& coastLines, int leftX, int
o->types.push_back(tag_value("natural", "coastline_broken")); o->types.push_back(tag_value("natural", "coastline_broken"));
res.push_back(o); 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) { if (!showIfThereIncompleted && uncompletedRings.size() > 0) {