Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maxweight (supersedes #1467) #1622

Merged
merged 90 commits into from Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
031d3f7
maxweight
matkoniecz Jun 20, 2019
24417a9
custom layouts
matkoniecz Jun 21, 2019
04c6cdf
2.5 t maxweight is perfectly normal
matkoniecz Jun 22, 2019
1b58eaa
exclude ways without explicit signage
matkoniecz Jun 22, 2019
08a89dc
fix query
matkoniecz Jun 22, 2019
5313999
atually require bridges
matkoniecz Jun 22, 2019
b1c168c
USA signs
matkoniecz Jun 22, 2019
1b16840
add missing TONS in usa sign
matkoniecz Jun 22, 2019
fc740ab
more generic names for generic variables
matkoniecz Jun 22, 2019
b32aee6
drop apparently not needed import
matkoniecz Jun 22, 2019
05d2a8c
select metric by default
matkoniecz Jun 22, 2019
f666297
add USA layout to Australia and Canada
matkoniecz Jun 22, 2019
b91591c
center US style maxweight
matkoniecz Jun 22, 2019
5686b73
revert unneded change
matkoniecz Jun 22, 2019
f14d627
finish revert
matkoniecz Jun 22, 2019
a2a00ca
ops
matkoniecz Jun 22, 2019
1dabd6c
add escape hatch in form of leaving notes
matkoniecz Jul 1, 2019
d2b3952
stop using maxheight sign in maxweight input
matkoniecz Jul 1, 2019
2ad6bbf
use more human language
matkoniecz Jul 1, 2019
13cb253
handle bizarre case of incorrect maxweight:signed tags
matkoniecz Jul 1, 2019
4d97a42
simplify code
matkoniecz Jul 1, 2019
5345dfa
reorder, disable in US CA AU
matkoniecz Jul 1, 2019
384011d
better phrasing
matkoniecz Jul 2, 2019
ec56c3a
geenralize function
matkoniecz Jul 2, 2019
a9746e7
drop hopefully unneded unification
matkoniecz Jul 2, 2019
74d3846
keep as one group
matkoniecz Jul 2, 2019
2279af5
finish decoupling
matkoniecz Jul 2, 2019
c9d8693
more readable comment
matkoniecz Jul 2, 2019
a0441be
unify geenric yellow prohibitory background
matkoniecz Jul 4, 2019
3f85020
exclude also exotic maxweight variants
matkoniecz Jul 4, 2019
233ed3b
tweak text, as advised by @goldfndr
matkoniecz Jul 5, 2019
2a2a732
move … to a correct place
matkoniecz Jul 5, 2019
2a82c66
English improvement by @goldfndr
matkoniecz Jul 5, 2019
5d96efa
make clear that exceptions are worth making note
matkoniecz Jul 5, 2019
5e47af8
reduce text length and save translator time
matkoniecz Jul 6, 2019
cdea534
rename traces of copy paste
matkoniecz Jul 6, 2019
c86886c
fix variable name
matkoniecz Jul 6, 2019
4de7c4d
fix georgia layout
matkoniecz Jul 7, 2019
cf4e953
phrasing covering wider range of exceptions
matkoniecz Jul 7, 2019
9205711
Remove blindly copied comment
matkoniecz Jul 7, 2019
15c34ba
refactor measure classes
matkoniecz Jul 7, 2019
af5dc82
drop unneded parameter
matkoniecz Jul 7, 2019
24931cc
exclude driveways
matkoniecz Jul 9, 2019
79cecdf
exclude maxunladenweight
matkoniecz Jul 9, 2019
d295390
Merge branch 'master' into maxweight
matkoniecz Jul 11, 2019
bb583ca
fix unit selector
matkoniecz Jul 11, 2019
8d7df2a
fix input for US signs
matkoniecz Jul 11, 2019
0bae25f
Merge branch 'master' into maxweight
matkoniecz Jul 16, 2019
8913d2a
move helper function
matkoniecz Jul 16, 2019
d79682f
shorten string
matkoniecz Jul 16, 2019
ac7a45d
some maxweightrating are expressed as hgv
matkoniecz Jul 21, 2019
af82c48
confirm tagging no sign
matkoniecz Jul 21, 2019
5d7d6cb
make more likely that translations are correct
matkoniecz Jul 21, 2019
aea41b8
Merge branch 'master' into maxweight
matkoniecz Jul 22, 2019
36a6b82
add metada file with weight units
matkoniecz Aug 18, 2019
c05e101
rename imperial to usa, use measurementSystemForWeightLimits
matkoniecz Aug 19, 2019
bdaade8
ton is metrc based, not strictly metric
matkoniecz Aug 22, 2019
3b9fb30
check also length
matkoniecz Aug 22, 2019
dd5f24f
use proper comparison
matkoniecz Aug 22, 2019
ed3a212
unify layout of layouts code
matkoniecz Aug 26, 2019
3bbaf34
stop hardcoding USA, use metadata file
matkoniecz Aug 26, 2019
9aa28ea
drop no longer needed hack
matkoniecz Aug 27, 2019
d9fedc2
use proper metada in one more place + add docs
matkoniecz Aug 27, 2019
39621b0
there is single version of short tons
matkoniecz Aug 27, 2019
78ae56c
add explicit isPound check
matkoniecz Aug 27, 2019
427a3fe
make metadata units more consistent
matkoniecz Aug 27, 2019
77f2cf9
better variable name
matkoniecz Aug 27, 2019
50d6d42
rename variable to more clear names
matkoniecz Aug 27, 2019
f82bf4e
drop unneded code, use proper switch
matkoniecz Aug 28, 2019
7f4449f
use better variable name
matkoniecz Aug 28, 2019
9bf0f78
proofread comment
matkoniecz Aug 28, 2019
5895436
restore setting primary unit
matkoniecz Aug 28, 2019
3cc374c
measurementSystemForWeightLimits -> unitsOfWeightLimits
matkoniecz Aug 29, 2019
159faf4
Merge branch 'master' into maxweight
westnordost Oct 31, 2019
41dae02
rename measure data classes and simplify
westnordost Oct 31, 2019
994e8f2
make AddMaxWeight.kt a little bit easier to read
westnordost Oct 31, 2019
a775454
add test
westnordost Oct 31, 2019
e57570e
nullsafe dialogs
westnordost Oct 31, 2019
999fdd2
Put workaround for Android bug in extension function
westnordost Oct 31, 2019
56a3e45
fix generic pounds input layout
westnordost Oct 31, 2019
c77f69e
fix us pounds input layout
westnordost Oct 31, 2019
5ac945b
split up measurementSystem into speedUnits and lengthUnits
westnordost Oct 31, 2019
cf7b191
update research about usage of lengthUnits and speedUnits
westnordost Oct 31, 2019
8ea4bbb
use enum instead of string for unit selection adapter data
westnordost Oct 31, 2019
f412a55
prettify layout
westnordost Oct 31, 2019
7207bb1
fix display of layout in US
westnordost Oct 31, 2019
5876ceb
markers at ends and splittable
westnordost Oct 31, 2019
8b761f3
change wording
westnordost Oct 31, 2019
550f44e
not split way enabled after all
westnordost Oct 31, 2019
f4d81fe
add assets for maybe-later-support for other types of maxweight signs
westnordost Oct 31, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -24,12 +24,24 @@ private void checkFirstDayOfWorkweekIsValid(CountryInfo info)
assertTrue(Weekdays.Companion.getWeekdayIndex(info.getFirstDayOfWorkweek()) > -1);
}

private void checkMeasurementUnitIsEitherMetricOrImperial(CountryInfo info)
private void checkLengthUnitIsEitherMeterOrFootAndInch(CountryInfo info)
{
assertNotNull(info.getMeasurementSystem());
assertTrue(info.getMeasurementSystem().contains("metric") || info.getMeasurementSystem().contains("imperial"));
assertNotNull(info.getLengthUnits());
assertTrue(info.getLengthUnits().contains("meter") || info.getLengthUnits().contains("foot and inch"));
}

private void checkSpeedUnitIsEitherMphOrKmh(CountryInfo info)
{
assertNotNull(info.getSpeedUnits());
assertTrue(info.getSpeedUnits().contains("kilometers per hour") || info.getSpeedUnits().contains("miles per hour"));
}


private void checkWeightLimitUnitIsEitherTonOrShortTonOrPound(CountryInfo info)
{
assertNotNull(info.getWeightLimitUnits());
assertTrue(info.getWeightLimitUnits().contains("ton") || info.getWeightLimitUnits().contains("short ton") || info.getWeightLimitUnits().contains("pound"));
}
private void checkAdditionalValidHousenumberRegexes(Map<String, CountryInfo> infos)
{
assertTrue("99 bis".matches(infos.get("FR").getAdditionalValidHousenumberRegex()));
Expand All @@ -52,7 +64,9 @@ private void checkStartOfWorkweekValid(CountryInfo info)
private void checkForEach(CountryInfo info)
{
checkFirstDayOfWorkweekIsValid(info);
checkMeasurementUnitIsEitherMetricOrImperial(info);
checkLengthUnitIsEitherMeterOrFootAndInch(info);
checkSpeedUnitIsEitherMphOrKmh(info);
checkWeightLimitUnitIsEitherTonOrShortTonOrPound(info);
checkRegularShoppingDaysIsBetween0And7(info);
checkStartOfWorkweekValid(info);
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/AG.yml
@@ -1,7 +1,8 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
mobileCountryCode: 344
officialLanguages: [en]
orchardProduces: [guava, mango, mangosteen, tomato, pineapple, lemon, lime, banana, chilli_pepper,
sweet_pepper]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/AI.yml
@@ -1,4 +1,5 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [meter, foot and inch]
officialLanguages: [en]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/AS.yml
@@ -1,4 +1,5 @@
# Do not edit. Source files are in /res/country_metadata
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
officialLanguages: [en, sm]
orchardProduces: [coconut, banana, pineapple, tomato, cacao]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/BM.yml
@@ -1,5 +1,6 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [meter, foot and inch]
officialLanguages: [en]
orchardProduces: [banana, tomato]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/BS.yml
@@ -1,8 +1,9 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
mobileCountryCode: 364
officialLanguages: [en]
orchardProduces: [grapefruit, banana, tomato, orange, coconut, guava, mango, mangosteen, lemon, lime,
avocado, papaya]
popularSports: [tennis, basketball, baseball]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/BZ.yml
@@ -1,6 +1,7 @@
# Do not edit. Source files are in /res/country_metadata
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
mobileCountryCode: 702
officialLanguages: [en, bzj]
orchardProduces: [orange, banana, grapefruit, tomato, chilli_pepper, sweet_pepper, pineapple, papaya,
coconut, cacao, coffee, guava, mango, mangosteen]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/DM.yml
@@ -1,7 +1,8 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
mobileCountryCode: 366
officialLanguages: [en]
orchardProduces: [banana, grapefruit, coconut, orange, guava, mango, mangosteen, lemon, lime, avocado,
tomato, cacao, coffee, pineapple, papaya, nutmeg]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/FK.yml
@@ -1,4 +1,5 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [meter, foot and inch]
officialLanguages: [en]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/FM.yml
@@ -1,5 +1,6 @@
# Do not edit. Source files are in /res/country_metadata
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
mobileCountryCode: 550
officialLanguages: [en, chk, pon]
orchardProduces: [coconut, banana, cacao]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/GB.yml
Expand Up @@ -4,10 +4,11 @@ isAdvisorySpeedLimitKnown: true
isLeftHandTraffic: true
isLivingStreetKnown: true
isSlowZoneKnown: true
measurementSystem: [imperial, metric]
lengthUnits: [meter, foot and inch]
mobileCountryCode: 234
officialLanguages: [en]
orchardProduces: [apple, strawberry, tomato, pear, chilli_pepper, sweet_pepper, raspberry, plum, cherry,
hop, grape]
popularReligions: [christian, muslim, jewish, hindu, sikh]
popularSports: [soccer, tennis, bowls, cricket, golf, basketball, rugby]
speedUnits: [miles per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/GD.yml
@@ -1,8 +1,9 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
mobileCountryCode: 352
officialLanguages: [en]
orchardProduces: [coconut, banana, nutmeg, grapefruit, guava, mango, mangosteen, avocado, plum, orange,
cacao, apple, tomato, lemon, lime, chilli_pepper, sweet_pepper, pineapple]
popularSports: [cricket]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/GG.yml
@@ -1,4 +1,5 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [meter, foot and inch]
officialLanguages: [en]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/GI.yml
@@ -1,3 +1,4 @@
# Do not edit. Source files are in /res/country_metadata
measurementSystem: [imperial, metric]
lengthUnits: [meter, foot and inch]
officialLanguages: [en]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/GS.yml
@@ -1,4 +1,5 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [meter, foot and inch]
officialLanguages: [en]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/GU.yml
@@ -1,4 +1,5 @@
# Do not edit. Source files are in /res/country_metadata
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
officialLanguages: [en, ch]
orchardProduces: [coconut, banana, tomato, guava, mango, mangosteen, orange]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/GY.yml
@@ -1,9 +1,10 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [metric, imperial]
lengthUnits: [meter, foot and inch]
mobileCountryCode: 738
officialLanguages: [en, gyn]
orchardProduces: [coconut, papaya, chilli_pepper, sweet_pepper, tomato, pineapple, banana, guava, mango,
mangosteen, orange, lemon, lime, cherry, grapefruit, avocado, cacao, coffee, pepper]
popularReligions: [christian, hindu, muslim]
popularSports: [cricket]
speedUnits: [kilometers per hour, miles per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/IM.yml
@@ -1,4 +1,5 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [meter, foot and inch]
officialLanguages: [gv, en]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/JE.yml
@@ -1,4 +1,5 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [meter, foot and inch]
officialLanguages: [en]
speedUnits: [miles per hour, kilometers per hour]
2 changes: 2 additions & 0 deletions app/src/main/assets/country_metadata/KN.yml
@@ -1,5 +1,7 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
lengthUnits: [meter, foot and inch]
mobileCountryCode: 356
officialLanguages: [en]
orchardProduces: [coconut, tomato, chilli_pepper, sweet_pepper, pineapple]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/KY.yml
@@ -1,5 +1,6 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
officialLanguages: [en]
orchardProduces: [banana, guava, mango, mangosteen, avocado, coconut, tomato]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/LC.yml
@@ -1,7 +1,8 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
mobileCountryCode: 358
officialLanguages: [en]
orchardProduces: [coconut, banana, grapefruit, orange, tomato, lemon, lime, guava, mango, mangosteen,
avocado, pepper, cacao, pineapple, nutmeg]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/LR.yml
@@ -1,5 +1,6 @@
# Do not edit. Source files are in /res/country_metadata
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
mobileCountryCode: 618
officialLanguages: [en]
orchardProduces: [banana, rubber, pineapple, orange, cacao, coconut, tomato, coffee]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/MH.yml
@@ -1,5 +1,6 @@
# Do not edit. Source files are in /res/country_metadata
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
mobileCountryCode: 551
officialLanguages: [mh, en]
orchardProduces: [coconut]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/MM.yml
@@ -1,9 +1,10 @@
# Do not edit. Source files are in /res/country_metadata
additionalStreetsignLanguages: [en]
measurementSystem: [imperial, metric]
lengthUnits: [meter, foot and inch]
mobileCountryCode: 414
officialLanguages: [my]
orchardProduces: [coconut, rubber, areca_nut, chilli_pepper, sweet_pepper, tea, coffee, cashew_nut,
guava, mango, mangosteen]
popularReligions: [buddhist, christian, muslim, hindu]
popularSports: [soccer, tennis, sepak_takraw]
speedUnits: [kilometers per hour, miles per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/MP.yml
@@ -1,3 +1,4 @@
# Do not edit. Source files are in /res/country_metadata
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
officialLanguages: [ch]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/MS.yml
@@ -1,5 +1,6 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [meter, foot and inch]
officialLanguages: [en]
orchardProduces: [tomato, banana, guava, mango, mangosteen, lemon, lime, chilli_pepper, sweet_pepper]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/PR.yml
@@ -1,6 +1,7 @@
# Do not edit. Source files are in /res/country_metadata
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
officialLanguages: [en]
orchardProduces: [banana, guava, mango, mangosteen, tomato, orange, papaya, pineapple, coffee, chilli_pepper,
sweet_pepper, coconut, grapefruit, avocado, lemon, lime]
popularSports: [basketball, tennis, baseball]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/PW.yml
@@ -1,4 +1,5 @@
# Do not edit. Source files are in /res/country_metadata
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
mobileCountryCode: 552
officialLanguages: [en, pau]
speedUnits: [miles per hour, kilometers per hour]
1 change: 1 addition & 0 deletions app/src/main/assets/country_metadata/SH.yml
@@ -1,3 +1,4 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
officialLanguages: [en]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/TC.yml
@@ -1,4 +1,5 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [meter, foot and inch]
officialLanguages: [en]
speedUnits: [miles per hour, kilometers per hour]
4 changes: 3 additions & 1 deletion app/src/main/assets/country_metadata/US.yml
@@ -1,10 +1,12 @@
# Do not edit. Source files are in /res/country_metadata
isAdvisorySpeedLimitKnown: true
isSlowZoneKnown: false
measurementSystem: [imperial]
lengthUnits: [foot and inch]
mobileCountryCode: 310
officialLanguages: [en]
orchardProduces: [tomato, grape, apple, orange, strawberry, almond, peach, lemon, lime, grapefruit,
pear, walnut, cranberry, plum, pistachio, blueberry]
popularReligions: [christian, jewish]
popularSports: [baseball, tennis, basketball, soccer, golf, american_football]
speedUnits: [miles per hour]
weightLimitUnits: [short ton, pound]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/VC.yml
@@ -1,7 +1,8 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
mobileCountryCode: 360
officialLanguages: [en]
orchardProduces: [banana, coconut, guava, mango, mangosteen, apple, lemon, lime, orange, pear, chilli_pepper,
sweet_pepper, grapefruit, cacao, nutmeg, coffee]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/VG.yml
@@ -1,5 +1,6 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
officialLanguages: [en]
orchardProduces: [banana, coconut]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/VI.yml
@@ -1,4 +1,5 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
officialLanguages: [en]
speedUnits: [miles per hour, kilometers per hour]
3 changes: 2 additions & 1 deletion app/src/main/assets/country_metadata/WS.yml
@@ -1,6 +1,7 @@
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
measurementSystem: [imperial, metric]
lengthUnits: [foot and inch, meter]
mobileCountryCode: 549
officialLanguages: [sm, en]
popularSports: [cricket]
speedUnits: [miles per hour, kilometers per hour]
4 changes: 3 additions & 1 deletion app/src/main/assets/country_metadata/default.yml
Expand Up @@ -4,9 +4,11 @@ isAdvisorySpeedLimitKnown: false
isLeftHandTraffic: false
isLivingStreetKnown: false
isSlowZoneKnown: false
measurementSystem: [metric]
lengthUnits: [meter]
officialLanguages: [en]
orchardProduces: []
popularReligions: []
popularSports: []
regularShoppingDays: 6
speedUnits: [kilometers per hour]
weightLimitUnits: [ton]
Expand Up @@ -14,7 +14,9 @@ public class CountryInfo implements Serializable, Cloneable
// i.e. US for US-TX.yml
String countryCode;

List<String> measurementSystem;
List<String> lengthUnits;
List<String> speedUnits;
List<String> weightLimitUnits;
List<String> popularSports;
List<String> popularReligions;
String firstDayOfWorkweek;
Expand All @@ -29,9 +31,19 @@ public class CountryInfo implements Serializable, Cloneable
Boolean isLeftHandTraffic;
Integer mobileCountryCode;

public List<String> getMeasurementSystem()
public List<String> getLengthUnits()
{
return measurementSystem;
return lengthUnits;
}

public List<String> getSpeedUnits()
{
return speedUnits;
}

public List<String> getWeightLimitUnits()
{
return weightLimitUnits;
}

public List<String> getPopularSports()
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/de/westnordost/streetcomplete/ktx/Double.kt
@@ -0,0 +1,3 @@
package de.westnordost.streetcomplete.ktx

fun Double.toShortString() = if (this % 1 == 0.0) toInt().toString() else toString()