button.setScaleType(ScaleType.FIT_CENTER);
result = button;
}
- result.setLayoutParams(new LinearLayout.LayoutParams(languageButtonPixels, LinearLayout.LayoutParams.MATCH_PARENT));
+ result.setLayoutParams(new LinearLayout.LayoutParams(languageButtonPixels, languageButtonPixels * 2 / 3));
return result;
}
for (final String uncompressedFilename : oldDictionaryConfig.dictionaryFilesOrdered) {
final File dictFile = getPath(uncompressedFilename);
final DictionaryInfo dictionaryInfo = Dictionary.getDictionaryInfo(dictFile);
- if (dictionaryInfo != null) {
+ if (dictionaryInfo.isValid()) {
newDictionaryConfig.dictionaryFilesOrdered.add(uncompressedFilename);
newDictionaryConfig.uncompressedFilenameToDictionaryInfo.put(
uncompressedFilename, dictionaryInfo);
continue;
}
final DictionaryInfo dictionaryInfo = Dictionary.getDictionaryInfo(file);
- if (dictionaryInfo == null) {
+ if (!dictionaryInfo.isValid()) {
Log.e(LOG, "Unable to parse dictionary: " + file.getPath());
- continue;
}
toAddSorted.add(file.getName());