Search in sources :

Example 1 with SiteInfoClient

use of org.wikipedia.settings.SiteInfoClient in project apps-android-wikipedia by wikimedia.

the class WikipediaApp method getWikiSite.

/**
 * Default wiki for the app
 * You should use PageTitle.getWikiSite() to get the article wiki
 */
@NonNull
public WikiSite getWikiSite() {
    // TODO: why don't we ensure that the app language hasn't changed here instead of the client?
    if (wiki == null) {
        String lang = Prefs.getMediaWikiBaseUriSupportsLangCode() ? getAppOrSystemLanguageCode() : "";
        wiki = WikiSite.forLanguageCode(lang);
        // Kick off a task to retrieve the site info for the current wiki
        new SiteInfoClient().request(wiki, null);
    }
    return wiki;
}
Also used : StringUtils.defaultString(org.apache.commons.lang3.StringUtils.defaultString) SiteInfoClient(org.wikipedia.settings.SiteInfoClient) NonNull(android.support.annotation.NonNull)

Aggregations

NonNull (android.support.annotation.NonNull)1 StringUtils.defaultString (org.apache.commons.lang3.StringUtils.defaultString)1 SiteInfoClient (org.wikipedia.settings.SiteInfoClient)1