mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
* Edited Project.xml to make indent size 4 * Changed files with 2 space indentation to use 4 space indentation * Edited Project.xml to make indent size 4 * changed files with 2 space indent to 4 space indent * fix :Back Pressed Event not work in Explore tab when user not login (#4404) * fix :Back Pressed Event not work in Explore tab * minor changes * fix :Upload count or number of contribution does not get updated when media is successful uploaded (#4399) * * fix:Number of Contributions not updated * Add javadocs * minor changes * made minor changes * String was nonsense and untranslatible, fixed (#4466) * Ability to show captions and descriptions in all entered languages (#4355) * implement Ability to show captions and descriptions in all entered languages *Add Javadoc * handle Back event of fragment(mediaDetailFragment) * fix minor bugs * add internationalization * revert previous changes * fix visibility bug * resolve conflict Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com> Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
71 lines
1.6 KiB
Java
71 lines
1.6 KiB
Java
package fr.free.nrw.commons;
|
|
|
|
import androidx.annotation.NonNull;
|
|
import okhttp3.OkHttpClient;
|
|
import org.wikipedia.AppAdapter;
|
|
import org.wikipedia.dataclient.Service;
|
|
import org.wikipedia.dataclient.SharedPreferenceCookieManager;
|
|
import org.wikipedia.dataclient.WikiSite;
|
|
import org.wikipedia.dataclient.okhttp.TestStubInterceptor;
|
|
import org.wikipedia.dataclient.okhttp.UnsuccessfulResponseInterceptor;
|
|
import org.wikipedia.login.LoginResult;
|
|
|
|
public class TestAppAdapter extends AppAdapter {
|
|
|
|
@Override
|
|
public String getMediaWikiBaseUrl() {
|
|
return Service.WIKIPEDIA_URL;
|
|
}
|
|
|
|
@Override
|
|
public String getRestbaseUriFormat() {
|
|
return "%1$s://%2$s/api/rest_v1/";
|
|
}
|
|
|
|
@Override
|
|
public OkHttpClient getOkHttpClient(@NonNull WikiSite wikiSite) {
|
|
return new OkHttpClient.Builder()
|
|
.addInterceptor(new UnsuccessfulResponseInterceptor())
|
|
.addInterceptor(new TestStubInterceptor())
|
|
.build();
|
|
}
|
|
|
|
@Override
|
|
public int getDesiredLeadImageDp() {
|
|
return 0;
|
|
}
|
|
|
|
@Override
|
|
public boolean isLoggedIn() {
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public String getUserName() {
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public String getPassword() {
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public void updateAccount(@NonNull LoginResult result) {
|
|
}
|
|
|
|
@Override
|
|
public SharedPreferenceCookieManager getCookies() {
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public void setCookies(@NonNull SharedPreferenceCookieManager cookies) {
|
|
}
|
|
|
|
@Override
|
|
public boolean logErrorsInsteadOfCrashing() {
|
|
return false;
|
|
}
|
|
}
|
|
|