Fix preview crash on local files during upload (#1696)

* Try to get the localized version of the wikipedia article before defaulting to the English version.

Tested with Spanish on physical Android device.

Other notes:
Difficulties building with gradle due to dexcount plugin: https://github.com/KeepSafe/dexcount-gradle-plugin/issues/234. In testing, disabled the plugin.

* Update article fetch to not include unnecessary SERVICE line

* Add checks for local file, check for string length
This commit is contained in:
albendz 2018-07-22 07:43:33 -07:00 committed by neslihanturan
parent 369fe3183c
commit 7b5b9169db
4 changed files with 23 additions and 5 deletions

View file

@ -28,4 +28,8 @@ class UtilsTest {
@Test fun `capitalize - pass Japanase characters`() {
Assert.assertThat(Utils.capitalize("こんにちは"), _is("こんにちは"))
}
@Test fun `capitalize does not fail on empty string`() {
Assert.assertThat(Utils.capitalize(""), _is(""))
}
}