-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added locale distance formatter (#668)
* Refactored formatting method name * Added DistanceUtilsTest * Added tests to DistanceUtilsTest * Set spanEnabled to true in only place that it was set to false. This way, the special handling for returning the unspanned string can be removed * Changed SpannableStringBuilder to SpannableString * Removed decimalFormat and spanEnabled and added locale to DistanceUtils * Did refactoring and simlified code, and added tests for locale * Updated all usages of DistanceUtils to use locale * Fixed checkstyle issues * Moved toString so that SummaryModel.getDistanceRemaining returns a string * Made fields final * Removed whitespace * Rearranged fields * Made fields final * Removed whitespace * Formatted tests * Added unit abbreviations to strings.xml for future localization. Also made DistanceUtils instantiable so that the user doesn't have to pass in fields every time * Added context to all calls to DistanceUtils * Used only context as parameter of DistanceUtils * Added special handling for locale and unit types and added tests for special cases * Fixed checkstyle issues * Removed unused locales * Added LocaleUtils * Fixed typo * Added special handling for deprecated locale * Updated test for use of LocaleList for sdk>=N * Removed directionsLanguage from NavigationViewOptions * Added setLocale helper method to LocaleUtils * Stopped storing context in InstructionListAdapter to prevent memory leaks
- Loading branch information
Devota Aabel
authored
Feb 7, 2018
1 parent
ebf66b4
commit 33ff396
Showing
19 changed files
with
420 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
...java/com/mapbox/services/android/navigation/ui/v5/instruction/BannerInstructionModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.