Resolve conflicts
|
@ -413,41 +413,6 @@ public class TurnType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getArrowWidthInDp(int tt) {
|
|
||||||
int result;
|
|
||||||
|
|
||||||
switch (tt){
|
|
||||||
case TurnType.C:
|
|
||||||
result = 12;
|
|
||||||
break;
|
|
||||||
case TurnType.TR:
|
|
||||||
case TurnType.TL:
|
|
||||||
result = 20;
|
|
||||||
break;
|
|
||||||
case TurnType.KR:
|
|
||||||
case TurnType.KL:
|
|
||||||
result = 13;
|
|
||||||
break;
|
|
||||||
case TurnType.TSLR:
|
|
||||||
case TurnType.TSLL:
|
|
||||||
result = 13;
|
|
||||||
break;
|
|
||||||
case TurnType.TSHR:
|
|
||||||
case TurnType.TSHL:
|
|
||||||
result = 19;
|
|
||||||
break;
|
|
||||||
case TurnType.TRU:
|
|
||||||
case TurnType.TU:
|
|
||||||
result = 24;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
result = 12;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int convertType(String lane) {
|
public static int convertType(String lane) {
|
||||||
int turn;
|
int turn;
|
||||||
if (lane.equals("none") || lane.equals("through")) {
|
if (lane.equals("none") || lane.equals("through")) {
|
||||||
|
|
|
@ -31,6 +31,7 @@ import net.osmand.search.core.SearchPhrase.SearchPhraseDataType;
|
||||||
import net.osmand.util.Algorithms;
|
import net.osmand.util.Algorithms;
|
||||||
import net.osmand.util.GeoPointParserUtil;
|
import net.osmand.util.GeoPointParserUtil;
|
||||||
import net.osmand.util.GeoPointParserUtil.GeoParsedPoint;
|
import net.osmand.util.GeoPointParserUtil.GeoParsedPoint;
|
||||||
|
import net.osmand.util.LocationParser;
|
||||||
import net.osmand.util.MapUtils;
|
import net.osmand.util.MapUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -1127,279 +1128,17 @@ public class SearchCoreFactory {
|
||||||
List<Double> d = new ArrayList<>();
|
List<Double> d = new ArrayList<>();
|
||||||
List<Object> all = new ArrayList<>();
|
List<Object> all = new ArrayList<>();
|
||||||
List<String> strings = new ArrayList<>();
|
List<String> strings = new ArrayList<>();
|
||||||
splitObjects(s, d, all, strings);
|
LocationParser.splitObjects(s, d, all, strings);
|
||||||
if (d.size() == 0) {
|
if (d.size() == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
double lat = parse1Coordinate(all, 0, all.size());
|
double lat = LocationParser.parse1Coordinate(all, 0, all.size());
|
||||||
return new LatLon(lat, 0);
|
return new LatLon(lat, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
LatLon parseLocation(String s) {
|
|
||||||
s = s.trim();
|
|
||||||
// detect OLC first
|
|
||||||
// avoid throwing exceptions by carefully checking exceptions
|
|
||||||
if (s.length() > 0 && OpenLocationCode.isValidCode(s)) {
|
|
||||||
OpenLocationCode olc = new OpenLocationCode(s);
|
|
||||||
if (olc.isFull()) {
|
|
||||||
OpenLocationCode.CodeArea codeArea = olc.decode();
|
|
||||||
return new LatLon(codeArea.getCenterLatitude(), codeArea.getCenterLongitude());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (s.length() == 0 || !(s.charAt(0) == '-' || Character.isDigit(s.charAt(0))
|
|
||||||
|| s.charAt(0) == 'S' || s.charAt(0) == 's'
|
|
||||||
|| s.charAt(0) == 'N' || s.charAt(0) == 'n'
|
|
||||||
|| s.contains("://"))) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
List<Double> d = new ArrayList<>();
|
|
||||||
List<Object> all = new ArrayList<>();
|
|
||||||
List<String> strings = new ArrayList<>();
|
|
||||||
splitObjects(s, d, all, strings);
|
|
||||||
if (d.size() == 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// detect UTM
|
|
||||||
if (all.size() == 4 && d.size() == 3 && all.get(1) instanceof String) {
|
|
||||||
char ch = all.get(1).toString().charAt(0);
|
|
||||||
if (Character.isLetter(ch)) {
|
|
||||||
UTMPoint upoint = new UTMPoint(d.get(2), d.get(1), d.get(0).intValue(), ch);
|
|
||||||
LatLonPoint ll = upoint.toLatLonPoint();
|
|
||||||
return new LatLon(ll.getLatitude(), ll.getLongitude());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (all.size() == 3 && d.size() == 2 && all.get(1) instanceof String) {
|
|
||||||
char ch = all.get(1).toString().charAt(0);
|
|
||||||
String combined = strings.get(2);
|
|
||||||
if (Character.isLetter(ch)) {
|
|
||||||
try {
|
|
||||||
String east = combined.substring(0, combined.length() / 2);
|
|
||||||
String north = combined.substring(combined.length() / 2, combined.length());
|
|
||||||
UTMPoint upoint = new UTMPoint(Double.parseDouble(north), Double.parseDouble(east), d.get(0)
|
|
||||||
.intValue(), ch);
|
|
||||||
LatLonPoint ll = upoint.toLatLonPoint();
|
|
||||||
return new LatLon(ll.getLatitude(), ll.getLongitude());
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// try to find split lat/lon position
|
|
||||||
int jointNumbers = 0;
|
|
||||||
int lastJoin = 0;
|
|
||||||
int degSplit = -1;
|
|
||||||
int degType = -1; // 0 - degree, 1 - minutes, 2 - seconds
|
|
||||||
boolean finishDegSplit = false;
|
|
||||||
int northSplit = -1;
|
|
||||||
int eastSplit = -1;
|
|
||||||
for (int i = 1; i < all.size(); i++ ) {
|
|
||||||
if (all.get(i - 1) instanceof Double && all.get(i) instanceof Double) {
|
|
||||||
jointNumbers ++;
|
|
||||||
lastJoin = i;
|
|
||||||
}
|
|
||||||
if (all.get(i).equals("n") || all.get(i).equals("s") ||
|
|
||||||
all.get(i).equals("N") || all.get(i).equals("S")) {
|
|
||||||
northSplit = i + 1;
|
|
||||||
}
|
|
||||||
if (all.get(i).equals("e") || all.get(i).equals("w") ||
|
|
||||||
all.get(i).equals("E") || all.get(i).equals("W")) {
|
|
||||||
eastSplit = i;
|
|
||||||
}
|
|
||||||
int dg = -1;
|
|
||||||
if (all.get(i).equals("°")) {
|
|
||||||
dg = 0;
|
|
||||||
} else if (all.get(i).equals("\'") || all.get(i).equals("′")) {
|
|
||||||
dg = 1;
|
|
||||||
} else if (all.get(i).equals("″") || all.get(i).equals("\"")) {
|
|
||||||
dg = 2;
|
|
||||||
}
|
|
||||||
if (dg != -1) {
|
|
||||||
if (!finishDegSplit) {
|
|
||||||
if (degType < dg) {
|
|
||||||
degSplit = i + 1;
|
|
||||||
degType = dg;
|
|
||||||
} else {
|
|
||||||
finishDegSplit = true;
|
|
||||||
degType = dg;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (degType < dg) {
|
|
||||||
degType = dg;
|
|
||||||
} else {
|
|
||||||
// reject delimiter
|
|
||||||
degSplit = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int split = -1;
|
|
||||||
if (jointNumbers == 1) {
|
|
||||||
split = lastJoin;
|
|
||||||
}
|
|
||||||
if (northSplit != -1 && northSplit < all.size() -1) {
|
|
||||||
split = northSplit;
|
|
||||||
} else if (eastSplit != -1 && eastSplit < all.size() -1) {
|
|
||||||
split = eastSplit;
|
|
||||||
} else if (degSplit != -1 && degSplit < all.size() -1) {
|
|
||||||
split = degSplit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (split != -1) {
|
|
||||||
double lat = parse1Coordinate(all, 0, split);
|
|
||||||
double lon = parse1Coordinate(all, split, all.size());
|
|
||||||
return new LatLon(lat, lon);
|
|
||||||
}
|
|
||||||
if (d.size() == 2) {
|
|
||||||
return new LatLon(d.get(0), d.get(1));
|
|
||||||
}
|
|
||||||
// simple url case
|
|
||||||
if (s.contains("://")) {
|
|
||||||
double lat = 0;
|
|
||||||
double lon = 0;
|
|
||||||
boolean only2decimals = true;
|
|
||||||
for (int i = 0; i < d.size(); i++) {
|
|
||||||
if (d.get(i).doubleValue() != d.get(i).intValue()) {
|
|
||||||
if (lat == 0) {
|
|
||||||
lat = d.get(i);
|
|
||||||
} else if (lon == 0) {
|
|
||||||
lon = d.get(i);
|
|
||||||
} else {
|
|
||||||
only2decimals = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (lat != 0 && lon != 0 && only2decimals) {
|
|
||||||
return new LatLon(lat, lon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// split by equal number of digits
|
|
||||||
if (d.size() > 2 && d.size() % 2 == 0) {
|
|
||||||
int ind = d.size() / 2 + 1;
|
|
||||||
int splitEq = -1;
|
|
||||||
for (int i = 0; i < all.size(); i++) {
|
|
||||||
if (all.get(i) instanceof Double) {
|
|
||||||
ind --;
|
|
||||||
}
|
|
||||||
if (ind == 0) {
|
|
||||||
splitEq = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (splitEq != -1) {
|
|
||||||
double lat = parse1Coordinate(all, 0, splitEq);
|
|
||||||
double lon = parse1Coordinate(all, splitEq, all.size());
|
|
||||||
return new LatLon(lat, lon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public double parse1Coordinate(List<Object> all, int begin, int end) {
|
|
||||||
boolean neg = false;
|
|
||||||
double d = 0;
|
|
||||||
int type = 0; // degree - 0, minutes - 1, seconds = 2
|
|
||||||
Double prevDouble = null;
|
|
||||||
for (int i = begin; i <= end; i++) {
|
|
||||||
Object o = i == end ? "" : all.get(i);
|
|
||||||
if(o.equals("S") || o.equals("W")) {
|
|
||||||
neg = !neg;
|
|
||||||
}
|
|
||||||
if (prevDouble != null) {
|
|
||||||
if (o.equals("°")) {
|
|
||||||
type = 0;
|
|
||||||
} else if (o.equals("′") /*o.equals("'")*/) {
|
|
||||||
// ' can be used as delimeter ignore it
|
|
||||||
type = 1;
|
|
||||||
} else if (o.equals("\"") || o.equals("″")) {
|
|
||||||
type = 2;
|
|
||||||
}
|
|
||||||
if (type == 0) {
|
|
||||||
double ld = prevDouble.doubleValue();
|
|
||||||
if (ld < 0) {
|
|
||||||
ld = -ld;
|
|
||||||
neg = true;
|
|
||||||
}
|
|
||||||
d += ld;
|
|
||||||
} else if (type == 1) {
|
|
||||||
d += prevDouble.doubleValue() / 60.f;
|
|
||||||
} else /*if (type == 1) */ {
|
|
||||||
d += prevDouble.doubleValue() / 3600.f;
|
|
||||||
}
|
|
||||||
type++;
|
|
||||||
}
|
|
||||||
if (o instanceof Double) {
|
|
||||||
prevDouble = (Double) o;
|
|
||||||
} else {
|
|
||||||
prevDouble = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (neg) {
|
|
||||||
d = -d;
|
|
||||||
}
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void splitObjects(String s, List<Double> d, List<Object> all, List<String> strings) {
|
|
||||||
boolean digit = false;
|
|
||||||
int word = -1;
|
|
||||||
for (int i = 0; i <= s.length(); i++) {
|
|
||||||
char ch = i == s.length() ? ' ' : s.charAt(i);
|
|
||||||
boolean dg = Character.isDigit(ch);
|
|
||||||
boolean nonwh = ch != ',' && ch != ' ' && ch != ';';
|
|
||||||
if (ch == '.' || dg || ch == '-' ) {
|
|
||||||
if (!digit) {
|
|
||||||
if (word != -1) {
|
|
||||||
all.add(s.substring(word, i));
|
|
||||||
strings.add(s.substring(word, i));
|
|
||||||
}
|
|
||||||
digit = true;
|
|
||||||
word = i;
|
|
||||||
} else {
|
|
||||||
if(word == -1) {
|
|
||||||
word = i;
|
|
||||||
}
|
|
||||||
// if digit
|
|
||||||
// continue
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (digit){
|
|
||||||
try {
|
|
||||||
double dl = Double.parseDouble(s.substring(word, i));
|
|
||||||
d.add(dl);
|
|
||||||
all.add(dl);
|
|
||||||
strings.add(s.substring(word, i));
|
|
||||||
digit = false;
|
|
||||||
word = -1;
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (nonwh) {
|
|
||||||
if(!Character.isLetter(ch)) {
|
|
||||||
if(word != -1) {
|
|
||||||
all.add(s.substring(word, i));
|
|
||||||
strings.add(s.substring(word, i));
|
|
||||||
}
|
|
||||||
all.add(s.substring(i, i + 1));
|
|
||||||
strings.add(s.substring(i, i +1));
|
|
||||||
word = -1;
|
|
||||||
} else if(word == -1) {
|
|
||||||
word = i;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (word != -1) {
|
|
||||||
all.add(s.substring(word, i));
|
|
||||||
strings.add(s.substring(word, i));
|
|
||||||
}
|
|
||||||
word = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void parseLocation(SearchPhrase phrase, SearchResultMatcher resultMatcher) {
|
private void parseLocation(SearchPhrase phrase, SearchResultMatcher resultMatcher) {
|
||||||
String lw = phrase.getUnknownSearchPhrase();
|
String lw = phrase.getUnknownSearchPhrase();
|
||||||
LatLon l = parseLocation(lw);
|
LatLon l = LocationParser.parseLocation(lw);
|
||||||
if (l != null) {
|
if (l != null) {
|
||||||
if (phrase.isSearchTypeAllowed(ObjectType.LOCATION)) {
|
if (phrase.isSearchTypeAllowed(ObjectType.LOCATION)) {
|
||||||
SearchResult sp = new SearchResult(phrase);
|
SearchResult sp = new SearchResult(phrase);
|
||||||
|
|
275
OsmAnd-java/src/net/osmand/util/LocationParser.java
Normal file
|
@ -0,0 +1,275 @@
|
||||||
|
package net.osmand.util;
|
||||||
|
|
||||||
|
import com.google.openlocationcode.OpenLocationCode;
|
||||||
|
import com.jwetherell.openmap.common.LatLonPoint;
|
||||||
|
import com.jwetherell.openmap.common.UTMPoint;
|
||||||
|
|
||||||
|
import net.osmand.data.LatLon;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class LocationParser {
|
||||||
|
public static LatLon parseLocation(String locPhrase) {
|
||||||
|
locPhrase = locPhrase.trim();
|
||||||
|
// detect OLC first
|
||||||
|
// avoid throwing exceptions by carefully checking exceptions
|
||||||
|
if (locPhrase.length() > 0 && OpenLocationCode.isValidCode(locPhrase)) {
|
||||||
|
OpenLocationCode olc = new OpenLocationCode(locPhrase);
|
||||||
|
if (olc.isFull()) {
|
||||||
|
OpenLocationCode.CodeArea codeArea = olc.decode();
|
||||||
|
return new LatLon(codeArea.getCenterLatitude(), codeArea.getCenterLongitude());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (locPhrase.length() == 0 || !(locPhrase.charAt(0) == '-' || Character.isDigit(locPhrase.charAt(0))
|
||||||
|
|| locPhrase.charAt(0) == 'S' || locPhrase.charAt(0) == 's'
|
||||||
|
|| locPhrase.charAt(0) == 'N' || locPhrase.charAt(0) == 'n'
|
||||||
|
|| locPhrase.contains("://"))) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<Double> d = new ArrayList<>();
|
||||||
|
List<Object> all = new ArrayList<>();
|
||||||
|
List<String> strings = new ArrayList<>();
|
||||||
|
splitObjects(locPhrase, d, all, strings);
|
||||||
|
if (d.size() == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// detect UTM
|
||||||
|
if (all.size() == 4 && d.size() == 3 && all.get(1) instanceof String) {
|
||||||
|
char ch = all.get(1).toString().charAt(0);
|
||||||
|
if (Character.isLetter(ch)) {
|
||||||
|
UTMPoint upoint = new UTMPoint(d.get(2), d.get(1), d.get(0).intValue(), ch);
|
||||||
|
LatLonPoint ll = upoint.toLatLonPoint();
|
||||||
|
return new LatLon(ll.getLatitude(), ll.getLongitude());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (all.size() == 3 && d.size() == 2 && all.get(1) instanceof String) {
|
||||||
|
char ch = all.get(1).toString().charAt(0);
|
||||||
|
String combined = strings.get(2);
|
||||||
|
if (Character.isLetter(ch)) {
|
||||||
|
try {
|
||||||
|
String east = combined.substring(0, combined.length() / 2);
|
||||||
|
String north = combined.substring(combined.length() / 2, combined.length());
|
||||||
|
UTMPoint upoint = new UTMPoint(Double.parseDouble(north), Double.parseDouble(east), d.get(0)
|
||||||
|
.intValue(), ch);
|
||||||
|
LatLonPoint ll = upoint.toLatLonPoint();
|
||||||
|
return new LatLon(ll.getLatitude(), ll.getLongitude());
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// try to find split lat/lon position
|
||||||
|
int jointNumbers = 0;
|
||||||
|
int lastJoin = 0;
|
||||||
|
int degSplit = -1;
|
||||||
|
int degType = -1; // 0 - degree, 1 - minutes, 2 - seconds
|
||||||
|
boolean finishDegSplit = false;
|
||||||
|
int northSplit = -1;
|
||||||
|
int eastSplit = -1;
|
||||||
|
for (int i = 1; i < all.size(); i++ ) {
|
||||||
|
if (all.get(i - 1) instanceof Double && all.get(i) instanceof Double) {
|
||||||
|
jointNumbers ++;
|
||||||
|
lastJoin = i;
|
||||||
|
}
|
||||||
|
if (all.get(i).equals("n") || all.get(i).equals("s") ||
|
||||||
|
all.get(i).equals("N") || all.get(i).equals("S")) {
|
||||||
|
northSplit = i + 1;
|
||||||
|
}
|
||||||
|
if (all.get(i).equals("e") || all.get(i).equals("w") ||
|
||||||
|
all.get(i).equals("E") || all.get(i).equals("W")) {
|
||||||
|
eastSplit = i;
|
||||||
|
}
|
||||||
|
int dg = -1;
|
||||||
|
if (all.get(i).equals("°")) {
|
||||||
|
dg = 0;
|
||||||
|
} else if (all.get(i).equals("\'") || all.get(i).equals("′")) {
|
||||||
|
dg = 1;
|
||||||
|
} else if (all.get(i).equals("″") || all.get(i).equals("\"")) {
|
||||||
|
dg = 2;
|
||||||
|
}
|
||||||
|
if (dg != -1) {
|
||||||
|
if (!finishDegSplit) {
|
||||||
|
if (degType < dg) {
|
||||||
|
degSplit = i + 1;
|
||||||
|
degType = dg;
|
||||||
|
} else {
|
||||||
|
finishDegSplit = true;
|
||||||
|
degType = dg;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (degType < dg) {
|
||||||
|
degType = dg;
|
||||||
|
} else {
|
||||||
|
// reject delimiter
|
||||||
|
degSplit = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int split = -1;
|
||||||
|
if (jointNumbers == 1) {
|
||||||
|
split = lastJoin;
|
||||||
|
}
|
||||||
|
if (northSplit != -1 && northSplit < all.size() -1) {
|
||||||
|
split = northSplit;
|
||||||
|
} else if (eastSplit != -1 && eastSplit < all.size() -1) {
|
||||||
|
split = eastSplit;
|
||||||
|
} else if (degSplit != -1 && degSplit < all.size() -1) {
|
||||||
|
split = degSplit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (split != -1) {
|
||||||
|
double lat = parse1Coordinate(all, 0, split);
|
||||||
|
double lon = parse1Coordinate(all, split, all.size());
|
||||||
|
return new LatLon(lat, lon);
|
||||||
|
}
|
||||||
|
if (d.size() == 2) {
|
||||||
|
return new LatLon(d.get(0), d.get(1));
|
||||||
|
}
|
||||||
|
// simple url case
|
||||||
|
if (locPhrase.contains("://")) {
|
||||||
|
double lat = 0;
|
||||||
|
double lon = 0;
|
||||||
|
boolean only2decimals = true;
|
||||||
|
for (int i = 0; i < d.size(); i++) {
|
||||||
|
if (d.get(i).doubleValue() != d.get(i).intValue()) {
|
||||||
|
if (lat == 0) {
|
||||||
|
lat = d.get(i);
|
||||||
|
} else if (lon == 0) {
|
||||||
|
lon = d.get(i);
|
||||||
|
} else {
|
||||||
|
only2decimals = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (lat != 0 && lon != 0 && only2decimals) {
|
||||||
|
return new LatLon(lat, lon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// split by equal number of digits
|
||||||
|
if (d.size() > 2 && d.size() % 2 == 0) {
|
||||||
|
int ind = d.size() / 2 + 1;
|
||||||
|
int splitEq = -1;
|
||||||
|
for (int i = 0; i < all.size(); i++) {
|
||||||
|
if (all.get(i) instanceof Double) {
|
||||||
|
ind --;
|
||||||
|
}
|
||||||
|
if (ind == 0) {
|
||||||
|
splitEq = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (splitEq != -1) {
|
||||||
|
double lat = parse1Coordinate(all, 0, splitEq);
|
||||||
|
double lon = parse1Coordinate(all, splitEq, all.size());
|
||||||
|
return new LatLon(lat, lon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static double parse1Coordinate(List<Object> all, int begin, int end) {
|
||||||
|
boolean neg = false;
|
||||||
|
double d = 0;
|
||||||
|
int type = 0; // degree - 0, minutes - 1, seconds = 2
|
||||||
|
Double prevDouble = null;
|
||||||
|
for (int i = begin; i <= end; i++) {
|
||||||
|
Object o = i == end ? "" : all.get(i);
|
||||||
|
if(o.equals("S") || o.equals("W")) {
|
||||||
|
neg = !neg;
|
||||||
|
}
|
||||||
|
if (prevDouble != null) {
|
||||||
|
if (o.equals("°")) {
|
||||||
|
type = 0;
|
||||||
|
} else if (o.equals("′") /*o.equals("'")*/) {
|
||||||
|
// ' can be used as delimeter ignore it
|
||||||
|
type = 1;
|
||||||
|
} else if (o.equals("\"") || o.equals("″")) {
|
||||||
|
type = 2;
|
||||||
|
}
|
||||||
|
if (type == 0) {
|
||||||
|
double ld = prevDouble.doubleValue();
|
||||||
|
if (ld < 0) {
|
||||||
|
ld = -ld;
|
||||||
|
neg = true;
|
||||||
|
}
|
||||||
|
d += ld;
|
||||||
|
} else if (type == 1) {
|
||||||
|
d += prevDouble.doubleValue() / 60.f;
|
||||||
|
} else /*if (type == 1) */ {
|
||||||
|
d += prevDouble.doubleValue() / 3600.f;
|
||||||
|
}
|
||||||
|
type++;
|
||||||
|
}
|
||||||
|
if (o instanceof Double) {
|
||||||
|
prevDouble = (Double) o;
|
||||||
|
} else {
|
||||||
|
prevDouble = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (neg) {
|
||||||
|
d = -d;
|
||||||
|
}
|
||||||
|
return d;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void splitObjects(String s, List<Double> d, List<Object> all, List<String> strings) {
|
||||||
|
boolean digit = false;
|
||||||
|
int word = -1;
|
||||||
|
for (int i = 0; i <= s.length(); i++) {
|
||||||
|
char ch = i == s.length() ? ' ' : s.charAt(i);
|
||||||
|
boolean dg = Character.isDigit(ch);
|
||||||
|
boolean nonwh = ch != ',' && ch != ' ' && ch != ';';
|
||||||
|
if (ch == '.' || dg || ch == '-' ) {
|
||||||
|
if (!digit) {
|
||||||
|
if (word != -1) {
|
||||||
|
all.add(s.substring(word, i));
|
||||||
|
strings.add(s.substring(word, i));
|
||||||
|
}
|
||||||
|
digit = true;
|
||||||
|
word = i;
|
||||||
|
} else {
|
||||||
|
if(word == -1) {
|
||||||
|
word = i;
|
||||||
|
}
|
||||||
|
// if digit
|
||||||
|
// continue
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (digit){
|
||||||
|
if (word != -1) {
|
||||||
|
try {
|
||||||
|
double dl = Double.parseDouble(s.substring(word, i));
|
||||||
|
d.add(dl);
|
||||||
|
all.add(dl);
|
||||||
|
strings.add(s.substring(word, i));
|
||||||
|
digit = false;
|
||||||
|
word = -1;
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nonwh) {
|
||||||
|
if(!Character.isLetter(ch)) {
|
||||||
|
if(word != -1) {
|
||||||
|
all.add(s.substring(word, i));
|
||||||
|
strings.add(s.substring(word, i));
|
||||||
|
}
|
||||||
|
all.add(s.substring(i, i + 1));
|
||||||
|
strings.add(s.substring(i, i +1));
|
||||||
|
word = -1;
|
||||||
|
} else if(word == -1) {
|
||||||
|
word = i;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (word != -1) {
|
||||||
|
all.add(s.substring(word, i));
|
||||||
|
strings.add(s.substring(word, i));
|
||||||
|
}
|
||||||
|
word = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +1,9 @@
|
||||||
package net.osmand.util;
|
package net.osmand.util;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.osmand.binary.BinaryMapIndexReader.SearchRequest;
|
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
import net.osmand.data.MapObject;
|
import net.osmand.data.MapObject;
|
||||||
import net.osmand.data.QuadPoint;
|
import net.osmand.data.QuadPoint;
|
||||||
|
|
|
@ -399,7 +399,7 @@ dependencies {
|
||||||
exclude group: 'com.android.support'
|
exclude group: 'com.android.support'
|
||||||
}
|
}
|
||||||
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
|
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
|
||||||
compile ("com.github.HITGIF:TextFieldBoxes:1.3.2"){
|
compile ("com.github.HITGIF:TextFieldBoxes:1.3.5"){
|
||||||
exclude group: 'com.android.support'
|
exclude group: 'com.android.support'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
OsmAnd/res/drawable-hdpi/bg_contextmenu_shadow_left_light.9.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
BIN
OsmAnd/res/drawable-hdpi/ic_action_device_topbar_two.png
Normal file
After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1 KiB |
BIN
OsmAnd/res/drawable-hdpi/ic_action_device_widget_two.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2 KiB |
BIN
OsmAnd/res/drawable-mdpi/bg_contextmenu_shadow_left_light.9.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
BIN
OsmAnd/res/drawable-mdpi/ic_action_device_topbar_two.png
Normal file
After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
BIN
OsmAnd/res/drawable-mdpi/ic_action_device_widget_two.png
Normal file
After Width: | Height: | Size: 1 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 948 B |
After Width: | Height: | Size: 924 B |
After Width: | Height: | Size: 1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
BIN
OsmAnd/res/drawable-xhdpi/bg_contextmenu_shadow_left_light.9.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-xhdpi/ic_action_device_topbar_two.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-xhdpi/ic_action_device_widget_two.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 5 KiB |
After Width: | Height: | Size: 5 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-xxhdpi/ic_action_device_topbar_two.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-xxhdpi/ic_action_device_widget_two.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 6 KiB |
After Width: | Height: | Size: 6 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 7.1 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 4 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 4.1 KiB |
5
OsmAnd/res/drawable/ic_keyboard_backspace.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@drawable/ic_action_backspace_fill" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@drawable/ic_action_backspace_stroke"/>
|
||||||
|
</selector>
|
5
OsmAnd/res/drawable/ic_keyboard_next_field.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@drawable/ic_action_next_field_fill" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@drawable/ic_action_next_field_stroke"/>
|
||||||
|
</selector>
|
5
OsmAnd/res/drawable/keyboard_item_add_button_dark_bg.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@color/keyboard_item_add_button_dark_bg_pressed" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@color/keyboard_item_add_button_dark_bg"/>
|
||||||
|
</selector>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@color/keyboard_item_add_button_light_bg_pressed" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@color/keyboard_item_add_button_light_bg"/>
|
||||||
|
</selector>
|
5
OsmAnd/res/drawable/keyboard_item_control_dark_bg.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@color/keyboard_item_control_dark_bg_pressed" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@color/keyboard_item_control_dark_bg"/>
|
||||||
|
</selector>
|
5
OsmAnd/res/drawable/keyboard_item_control_light_bg.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@color/keyboard_item_control_light_bg_pressed" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@color/keyboard_item_control_light_bg"/>
|
||||||
|
</selector>
|
|
@ -1,7 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@color/keyboard_item_dark_bg_pressed" android:state_pressed="true"/>
|
||||||
<item android:color="@color/map_widget_blue" android:state_pressed="true"/>
|
<item android:drawable="@color/keyboard_item_dark_bg"/>
|
||||||
<item android:color="@color/bg_color_dark"/>
|
|
||||||
|
|
||||||
</selector>
|
</selector>
|
5
OsmAnd/res/drawable/keyboard_item_icon_color_light.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:color="@color/keyboard_item_divider_control_color_light_pressed" android:state_pressed="true"/>
|
||||||
|
<item android:color="@color/keyboard_item_divider_control_color_light"/>
|
||||||
|
</selector>
|
|
@ -1,7 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@color/keyboard_item_light_bg_pressed" android:state_pressed="true"/>
|
||||||
<item android:drawable="@color/map_widget_blue" android:state_pressed="true"/>
|
<item android:drawable="@color/keyboard_item_light_bg"/>
|
||||||
<item android:drawable="@color/bg_color_light"/>
|
|
||||||
|
|
||||||
</selector>
|
</selector>
|
131
OsmAnd/res/layout-land/fragment_coordinate_input_dialog.xml
Normal file
|
@ -0,0 +1,131 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:id="@+id/app_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/coordinate_input_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="12dp"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
osmand:contentInsetLeft="4dp"
|
||||||
|
osmand:contentInsetStart="4dp"
|
||||||
|
osmand:contentInsetRight="16dp"
|
||||||
|
osmand:contentInsetEnd="16dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/back_button"
|
||||||
|
style="@style/Widget.AppCompat.ActionButton"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_arrow_back"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:layout_marginEnd="16dp"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:focusable="true"
|
||||||
|
android:focusableInTouchMode="true"/>
|
||||||
|
|
||||||
|
<net.osmand.plus.widgets.OsmandTextFieldBoxes
|
||||||
|
android:theme="@style/OsmandTextFieldBoxes"
|
||||||
|
android:id="@+id/latitude_box"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
osmand:labelText="@string/navigate_point_latitude"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:layout_marginRight="12dp">
|
||||||
|
|
||||||
|
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||||
|
android:textColor="@color/color_white"
|
||||||
|
android:textColorHint="@color/white_50_transparent"
|
||||||
|
android:inputType="numberSigned|numberDecimal"
|
||||||
|
android:imeOptions="actionNext"
|
||||||
|
android:id="@+id/latitude_edit_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
</net.osmand.plus.widgets.OsmandTextFieldBoxes>
|
||||||
|
|
||||||
|
<net.osmand.plus.widgets.OsmandTextFieldBoxes
|
||||||
|
android:theme="@style/OsmandTextFieldBoxes"
|
||||||
|
android:id="@+id/longitude_box"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
osmand:labelText="@string/navigate_point_longitude"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:layout_marginRight="12dp">
|
||||||
|
|
||||||
|
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||||
|
android:textColor="@color/color_white"
|
||||||
|
android:textColorHint="@color/white_50_transparent"
|
||||||
|
android:inputType="numberSigned|numberDecimal"
|
||||||
|
android:imeOptions="actionNext"
|
||||||
|
android:id="@+id/longitude_edit_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
</net.osmand.plus.widgets.OsmandTextFieldBoxes>
|
||||||
|
|
||||||
|
<net.osmand.plus.widgets.OsmandTextFieldBoxes
|
||||||
|
android:theme="@style/OsmandTextFieldBoxes"
|
||||||
|
android:id="@+id/name_box"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
osmand:labelText="@string/shared_string_name"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:layout_marginRight="10dp">
|
||||||
|
|
||||||
|
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||||
|
android:textColor="@color/color_white"
|
||||||
|
android:textColorHint="@color/white_50_transparent"
|
||||||
|
android:inputType="text"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:id="@+id/name_edit_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/access_hint_enter_name"/>
|
||||||
|
|
||||||
|
</net.osmand.plus.widgets.OsmandTextFieldBoxes>
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/options_button"
|
||||||
|
style="@style/Widget.AppCompat.ActionButton"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_overflow_menu_white"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/hand_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
38
OsmAnd/res/layout-land/input_coordinate_keyboard_item.xml
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/keyboard_item_top_spacing"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="0.35"/>
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:id="@+id/keyboard_item_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="0.3"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textAllCaps="true"
|
||||||
|
tools:text="3"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/keyboard_item_bottom_spacing"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="0.35"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/keyboard_item_image"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:scaleType="center"
|
||||||
|
tools:src="@drawable/ic_action_backspace_fill"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
41
OsmAnd/res/layout/coordinate_input_land_map_markers_list.xml
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.v4.widget.NestedScrollView
|
||||||
|
android:layout_weight="0.55"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:osmand="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/map_markers_layout"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="8dp"/>
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
osmand:cardUseCompatPadding="true"
|
||||||
|
osmand:cardCornerRadius="2dp">
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:nestedScrollingEnabled="false"
|
||||||
|
android:id="@+id/markers_recycler_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="8dp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.v4.widget.NestedScrollView>
|
45
OsmAnd/res/layout/coordinate_input_land_osmand_keyboard.xml
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_weight="0.45"
|
||||||
|
android:id="@+id/keyboard_layout"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<GridView
|
||||||
|
android:id="@+id/keyboard_grid_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginBottom="53dp"
|
||||||
|
android:horizontalSpacing="1dp"
|
||||||
|
android:numColumns="4"
|
||||||
|
android:stretchMode="columnWidth"
|
||||||
|
android:verticalSpacing="1dp"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/keyboard_divider"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="?attr/keyboard_controls_divider"/>
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:id="@+id/add_marker_button"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="52dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@string/shared_string_add"
|
||||||
|
android:textAllCaps="true"
|
||||||
|
android:textColor="@color/keyboard_item_button_text_color"
|
||||||
|
android:textSize="@dimen/default_list_text_size"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
|
@ -1,10 +1,10 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:osmand="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
@ -12,8 +12,8 @@
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:id="@+id/app_bar"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:background="@color/map_widget_blue"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
@ -21,8 +21,10 @@
|
||||||
android:id="@+id/coordinate_input_toolbar"
|
android:id="@+id/coordinate_input_toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dashboard_map_toolbar"
|
android:layout_height="@dimen/dashboard_map_toolbar"
|
||||||
app:contentInsetLeft="54dp"
|
osmand:contentInsetLeft="4dp"
|
||||||
app:contentInsetStart="54dp">
|
osmand:contentInsetStart="4dp"
|
||||||
|
osmand:contentInsetRight="0dp"
|
||||||
|
osmand:contentInsetEnd="0dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
@ -30,6 +32,15 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/back_button"
|
||||||
|
style="@style/Widget.AppCompat.ActionButton"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_arrow_back"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:layout_marginEnd="16dp"/>
|
||||||
|
|
||||||
<net.osmand.plus.widgets.TextViewEx
|
<net.osmand.plus.widgets.TextViewEx
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
@ -43,14 +54,14 @@
|
||||||
android:textSize="@dimen/dialog_header_text_size"/>
|
android:textSize="@dimen/dialog_header_text_size"/>
|
||||||
|
|
||||||
<net.osmand.plus.widgets.TextViewEx
|
<net.osmand.plus.widgets.TextViewEx
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
android:id="@+id/options_button"
|
android:id="@+id/options_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:paddingRight="16dp"
|
|
||||||
android:paddingLeft="16dp"
|
|
||||||
android:text="@string/shared_string_options"
|
android:text="@string/shared_string_options"
|
||||||
osmand:typeface="@string/font_roboto_regular"
|
osmand:typeface="@string/font_roboto_regular"
|
||||||
android:textAllCaps="true"
|
android:textAllCaps="true"
|
||||||
|
@ -61,6 +72,12 @@
|
||||||
|
|
||||||
</android.support.v7.widget.Toolbar>
|
</android.support.v7.widget.Toolbar>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:focusable="true"
|
||||||
|
android:focusableInTouchMode="true"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
android:paddingRight="16dp"
|
android:paddingRight="16dp"
|
||||||
|
@ -68,39 +85,45 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<net.osmand.plus.OsmandTextFieldBoxes
|
<net.osmand.plus.widgets.OsmandTextFieldBoxes
|
||||||
|
android:theme="@style/OsmandTextFieldBoxes"
|
||||||
android:id="@+id/latitude_box"
|
android:id="@+id/latitude_box"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:labelText="@string/navigate_point_latitude">
|
osmand:labelText="@string/navigate_point_latitude"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:layout_marginEnd="16dp">
|
||||||
|
|
||||||
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||||
android:hint="50:00.0000"
|
android:textColor="@color/color_white"
|
||||||
|
android:textColorHint="@color/white_50_transparent"
|
||||||
|
android:inputType="numberSigned|numberDecimal"
|
||||||
|
android:imeOptions="actionNext"
|
||||||
android:id="@+id/latitude_edit_text"
|
android:id="@+id/latitude_edit_text"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
</net.osmand.plus.OsmandTextFieldBoxes>
|
</net.osmand.plus.widgets.OsmandTextFieldBoxes>
|
||||||
|
|
||||||
<View
|
<net.osmand.plus.widgets.OsmandTextFieldBoxes
|
||||||
android:layout_width="16dp"
|
android:theme="@style/OsmandTextFieldBoxes"
|
||||||
android:layout_height="match_parent"/>
|
|
||||||
|
|
||||||
<net.osmand.plus.OsmandTextFieldBoxes
|
|
||||||
android:id="@+id/longitude_box"
|
android:id="@+id/longitude_box"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:labelText="@string/navigate_point_longitude">
|
osmand:labelText="@string/navigate_point_longitude">
|
||||||
|
|
||||||
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||||
android:hint="50:00.0000"
|
android:textColor="@color/color_white"
|
||||||
|
android:textColorHint="@color/white_50_transparent"
|
||||||
|
android:inputType="numberSigned|numberDecimal"
|
||||||
|
android:imeOptions="actionNext"
|
||||||
android:id="@+id/longitude_edit_text"
|
android:id="@+id/longitude_edit_text"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
</net.osmand.plus.OsmandTextFieldBoxes>
|
</net.osmand.plus.widgets.OsmandTextFieldBoxes>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -110,24 +133,27 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<net.osmand.plus.OsmandTextFieldBoxes
|
<net.osmand.plus.widgets.OsmandTextFieldBoxes
|
||||||
|
android:theme="@style/OsmandTextFieldBoxes"
|
||||||
android:id="@+id/name_box"
|
android:id="@+id/name_box"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:labelText="@string/shared_string_name">
|
osmand:labelText="@string/shared_string_name"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginRight="16dp">
|
||||||
|
|
||||||
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||||
|
android:textColor="@color/color_white"
|
||||||
|
android:textColorHint="@color/white_50_transparent"
|
||||||
|
android:inputType="text"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
android:hint="@string/access_hint_enter_name"
|
android:hint="@string/access_hint_enter_name"
|
||||||
android:id="@+id/name_edit_text"
|
android:id="@+id/name_edit_text"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
</net.osmand.plus.OsmandTextFieldBoxes>
|
</net.osmand.plus.widgets.OsmandTextFieldBoxes>
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="16dp"
|
|
||||||
android:layout_height="match_parent"/>
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
@ -139,6 +165,10 @@
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:paddingBottom="72dp"
|
||||||
|
android:id="@+id/markers_recycler_view"
|
||||||
|
android:clipToPadding="false"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
@ -155,50 +185,48 @@
|
||||||
android:id="@+id/keyboard_grid_view"
|
android:id="@+id/keyboard_grid_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/dashboard_divider"
|
|
||||||
android:horizontalSpacing="1dp"
|
android:horizontalSpacing="1dp"
|
||||||
android:verticalSpacing="1dp"
|
android:verticalSpacing="1dp"
|
||||||
android:stretchMode="columnWidth"
|
android:stretchMode="columnWidth"
|
||||||
android:numColumns="3"/>
|
android:numColumns="4"/>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/keyboard_divider"
|
android:id="@+id/keyboard_divider"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:background="?attr/dashboard_divider"/>
|
android:background="?attr/keyboard_controls_divider"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:background="?attr/bg_color"
|
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="56dp">
|
android:layout_height="56dp">
|
||||||
|
|
||||||
<ImageView
|
<android.support.v7.widget.AppCompatTextView
|
||||||
android:id="@+id/show_hide_keyboard_icon"
|
android:maxLines="1"
|
||||||
android:padding="@dimen/content_padding"
|
android:ellipsize="end"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:id="@+id/add_marker_button"
|
||||||
android:layout_gravity="center_vertical"
|
android:textAllCaps="true"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_weight="3"
|
||||||
osmand:src="@drawable/ic_action_arrow_down"/>
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="@color/keyboard_item_button_text_color"
|
||||||
|
android:textSize="@dimen/default_list_text_size"
|
||||||
|
android:text="@string/shared_string_add"/>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="1dp"
|
android:layout_width="1dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?attr/dashboard_divider"/>
|
android:background="?attr/keyboard_controls_divider"/>
|
||||||
|
|
||||||
<net.osmand.plus.widgets.TextViewEx
|
<ImageView
|
||||||
android:maxLines="1"
|
android:id="@+id/show_hide_keyboard_icon"
|
||||||
android:ellipsize="end"
|
android:layout_gravity="center_vertical"
|
||||||
android:id="@+id/add_marker"
|
|
||||||
android:textAllCaps="true"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center"
|
android:scaleType="center"
|
||||||
android:textColor="@color/keyboard_color"
|
tools:src="@drawable/ic_action_arrow_down"/>
|
||||||
osmand:typeface="@string/font_roboto_regular"
|
|
||||||
android:text="@string/shared_string_add"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -1,73 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="?attr/bg_color"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<ScrollView
|
|
||||||
android:id="@+id/marker_coordinate_input_scroll_view"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingBottom="@dimen/bottom_sheet_content_padding_small">
|
|
||||||
|
|
||||||
<net.osmand.plus.widgets.TextViewEx
|
|
||||||
android:id="@+id/coordinate_input_title"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/bottom_sheet_title_height"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:paddingEnd="@dimen/content_padding"
|
|
||||||
android:paddingLeft="@dimen/content_padding"
|
|
||||||
android:paddingRight="@dimen/content_padding"
|
|
||||||
android:paddingStart="@dimen/content_padding"
|
|
||||||
android:text="@string/fast_coordinates_input"
|
|
||||||
android:textAppearance="@style/TextAppearance.ListItemTitle"
|
|
||||||
osmand:typeface="@string/font_roboto_medium"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/bottom_sheet_descr_height"
|
|
||||||
android:paddingEnd="@dimen/content_padding"
|
|
||||||
android:paddingLeft="@dimen/content_padding"
|
|
||||||
android:paddingRight="@dimen/content_padding"
|
|
||||||
android:paddingStart="@dimen/content_padding"
|
|
||||||
android:text="@string/fast_coordinates_input_descr"
|
|
||||||
android:textColor="?android:textColorSecondary"
|
|
||||||
android:textSize="@dimen/default_desc_text_size"/>
|
|
||||||
|
|
||||||
<include layout="@layout/marker_coordinate_formats"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:background="?attr/dashboard_divider"/>
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/cancel_row"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/bottom_sheet_cancel_button_height"
|
|
||||||
android:background="?attr/selectableItemBackground">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:text="@string/shared_string_close"
|
|
||||||
android:textAllCaps="true"
|
|
||||||
android:textColor="?attr/color_dialog_buttons"
|
|
||||||
android:textSize="@dimen/default_desc_text_size"
|
|
||||||
android:textStyle="bold"/>
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
|
@ -42,10 +42,10 @@
|
||||||
android:paddingRight="@dimen/content_padding">
|
android:paddingRight="@dimen/content_padding">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:id="@+id/use_system_keyboard_icon"
|
android:id="@+id/use_system_keyboard_icon"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginEnd="@dimen/bottom_sheet_icon_margin"
|
android:layout_marginEnd="@dimen/bottom_sheet_icon_margin"
|
||||||
android:layout_marginRight="@dimen/bottom_sheet_icon_margin"
|
android:layout_marginRight="@dimen/bottom_sheet_icon_margin"
|
||||||
tools:src="@drawable/ic_action_keyboard"/>
|
tools:src="@drawable/ic_action_keyboard"/>
|
||||||
|
@ -71,25 +71,154 @@
|
||||||
android:focusableInTouchMode="false"/>
|
android:focusableInTouchMode="false"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/hand_row"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/bottom_sheet_list_item_height"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:descendantFocusability="blocksDescendants"
|
||||||
|
android:minHeight="@dimen/bottom_sheet_list_item_height"
|
||||||
|
android:paddingLeft="@dimen/content_padding"
|
||||||
|
android:paddingRight="@dimen/content_padding">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/hand_icon"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginEnd="@dimen/bottom_sheet_icon_margin"
|
||||||
|
android:layout_marginRight="@dimen/bottom_sheet_icon_margin"
|
||||||
|
tools:src="@drawable/ic_action_show_keypad_right"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:text="@string/show_number_pad"
|
||||||
|
android:textAppearance="@style/TextAppearance.ListItemTitle"/>
|
||||||
|
|
||||||
|
<net.osmand.plus.widgets.TextViewEx
|
||||||
|
osmand:typeface="@string/font_roboto_medium"
|
||||||
|
android:id="@+id/hand_text_view"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical|end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="@dimen/default_list_text_size"
|
||||||
|
tools:textColor="@color/map_widget_blue_pressed"
|
||||||
|
tools:text="Right"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:background="?attr/dashboard_divider"/>
|
android:background="?attr/dashboard_divider"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/go_to_next_field_row"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/bottom_sheet_list_item_height"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:descendantFocusability="blocksDescendants"
|
||||||
|
android:minHeight="@dimen/bottom_sheet_list_item_height"
|
||||||
|
android:paddingLeft="@dimen/content_padding"
|
||||||
|
android:paddingRight="@dimen/content_padding">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/go_to_next_field_icon"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginEnd="@dimen/bottom_sheet_icon_margin"
|
||||||
|
android:layout_marginRight="@dimen/bottom_sheet_icon_margin"
|
||||||
|
tools:src="@drawable/ic_action_keyboard"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textColor="?android:textColorSecondary"
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_weight="1"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textAllCaps="true"
|
android:text="@string/go_to_next_field"
|
||||||
android:paddingTop="@dimen/bottom_sheet_content_padding_small"
|
android:textAppearance="@style/TextAppearance.ListItemTitle"/>
|
||||||
android:paddingBottom="@dimen/bottom_sheet_content_padding_small"
|
|
||||||
android:paddingLeft="@dimen/content_padding"
|
|
||||||
android:paddingRight="@dimen/content_padding"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/coordinates_format"/>
|
|
||||||
|
|
||||||
<include layout="@layout/marker_coordinate_formats"/>
|
<android.support.v7.widget.SwitchCompat
|
||||||
|
android:id="@+id/go_to_next_field_switch"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical|end"
|
||||||
|
android:background="@null"
|
||||||
|
android:clickable="false"
|
||||||
|
android:focusable="false"
|
||||||
|
android:focusableInTouchMode="false"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/coordinate_input_accuracy_descr"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/bottom_sheet_descr_height"
|
||||||
|
android:paddingEnd="@dimen/content_padding"
|
||||||
|
android:paddingLeft="@dimen/bottom_sheet_divider_margin_start"
|
||||||
|
android:paddingRight="@dimen/content_padding"
|
||||||
|
android:paddingStart="@dimen/bottom_sheet_divider_margin_start"
|
||||||
|
android:textColor="?android:textColorSecondary"
|
||||||
|
android:textSize="@dimen/default_desc_text_size"
|
||||||
|
tools:text="@string/coordinate_input_accuracy_description"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/accuracy_row"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/bottom_sheet_list_item_height"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:minHeight="@dimen/bottom_sheet_list_item_height"
|
||||||
|
android:paddingEnd="@dimen/content_padding"
|
||||||
|
android:paddingLeft="@dimen/bottom_sheet_divider_margin_start"
|
||||||
|
android:paddingRight="@dimen/content_padding"
|
||||||
|
android:paddingStart="@dimen/bottom_sheet_divider_margin_start">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:textAppearance="@style/TextAppearance.ListItemTitle"
|
||||||
|
android:text="@string/digits_quantity"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/selected_accuracy_hint"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:text="00:00.0"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:textAppearance="@style/TextAppearance.ListItemTitle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/selected_accuracy"
|
||||||
|
tools:text="1"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/accuracy_arrow"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:src="@drawable/ic_action_arrow_drop_down"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,6 @@
|
||||||
android:background="?attr/dashboard_divider"/>
|
android:background="?attr/dashboard_divider"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:visibility="gone"
|
|
||||||
android:id="@+id/coordinate_input_row"
|
android:id="@+id/coordinate_input_row"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/bottom_sheet_list_item_height"
|
android:layout_height="@dimen/bottom_sheet_list_item_height"
|
||||||
|
|
|
@ -1,19 +1,38 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="56dp"
|
android:layout_height="56dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<net.osmand.plus.widgets.TextViewEx
|
<View
|
||||||
android:id="@+id/keyboard_item"
|
android:id="@+id/keyboard_item_top_spacing"
|
||||||
android:textAllCaps="true"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="0.25"/>
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:id="@+id/keyboard_item_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="@color/keyboard_color"
|
android:textAllCaps="true"
|
||||||
osmand:typeface="@string/font_roboto_regular"
|
|
||||||
tools:text="3"/>
|
tools:text="3"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/keyboard_item_bottom_spacing"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="0.25"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/keyboard_item_image"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:scaleType="center"
|
||||||
|
tools:src="@drawable/ic_action_backspace_fill"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -28,6 +28,17 @@
|
||||||
android:layout_height="@dimen/map_button_shadow_width"
|
android:layout_height="@dimen/map_button_shadow_width"
|
||||||
android:background="?attr/selectableItemBackground">
|
android:background="?attr/selectableItemBackground">
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatTextView
|
||||||
|
android:textSize="@dimen/default_list_text_size"
|
||||||
|
tools:text="3"
|
||||||
|
android:gravity="center"
|
||||||
|
android:id="@+id/map_marker_number_text_view"
|
||||||
|
android:layout_width="@dimen/map_button_shadow_width"
|
||||||
|
android:layout_height="@dimen/map_button_shadow_width"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
<android.support.v7.widget.AppCompatImageView
|
<android.support.v7.widget.AppCompatImageView
|
||||||
android:id="@+id/map_marker_reorder_icon"
|
android:id="@+id/map_marker_reorder_icon"
|
||||||
android:layout_width="@dimen/map_button_shadow_width"
|
android:layout_width="@dimen/map_button_shadow_width"
|
||||||
|
|