Update search ui core

This commit is contained in:
Victor Shcherb 2016-07-28 21:07:49 +02:00
parent 5b71806ab5
commit 5524676b97
2 changed files with 4 additions and 5 deletions

View file

@ -53,15 +53,13 @@ public class SearchUICore {
private Collator collator;
public SearchUICore(MapPoiTypes poiTypes, String locale, BinaryMapIndexReader[] searchIndexes) {
public SearchUICore(MapPoiTypes poiTypes, String locale) {
this.poiTypes = poiTypes;
List<BinaryMapIndexReader> searchIndexesList = Arrays.asList(searchIndexes);
taskQueue = new LinkedBlockingQueue<Runnable>();
searchSettings = new SearchSettings(searchIndexesList);
searchSettings = new SearchSettings(new ArrayList<BinaryMapIndexReader>());
searchSettings = searchSettings.setLang(locale);
phrase = new SearchPhrase(searchSettings);
singleThreadedExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, taskQueue);
init();
collator = OsmAndCollator.primaryCollator();
}

View file

@ -31,7 +31,7 @@ public class QuickSearchHelper {
public QuickSearchHelper(OsmandApplication app) {
this.app = app;
core = new SearchUICore(app.getPoiTypes(), app.getSettings().MAP_PREFERRED_LOCALE.get(), new BinaryMapIndexReader[]{});
core = new SearchUICore(app.getPoiTypes(), app.getSettings().MAP_PREFERRED_LOCALE.get());
}
public SearchUICore getCore() {
@ -40,6 +40,7 @@ public class QuickSearchHelper {
public void initSearchUICore() {
setRepositoriesForSearchUICore(app);
core.init();
// Register favorites search api
core.registerAPI(new SearchCoreFactory.SearchBaseAPI() {