use of org.wikipedia.dataclient.restbase.page.RbPageClient in project apps-android-wikipedia by wikimedia.
the class WiktionaryDialog method loadDefinitions.
private void loadDefinitions() {
if (selectedText.trim().isEmpty()) {
displayNoDefinitionsFound();
return;
}
// TODO: centralize the Wiktionary domain better. Maybe a SharedPreference that defaults to
// https://wiktionary.org.
PageClient pageClient = PageClientFactory.create(new WikiSite(pageTitle.getWikiSite().subdomain() + WIKTIONARY_DOMAIN), Namespace.MAIN);
if (pageClient instanceof RbPageClient) {
((RbPageClient) pageClient).define(addUnderscores(selectedText), definitionOnLoadCallback);
} else {
L.i("Wiktionary definitions require mobile content service loading!");
displayNoDefinitionsFound();
}
}
Aggregations