apps-android-commons/app/src/test/kotlin/fr/free/nrw/commons/TestAppAdapter.java
Jamie Brown ca9f6f5e47
Fixes #4437 - Changed indentation on files with 2 spaces to 4 spaces (#4462)
* 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>
2021-06-21 12:33:11 +09:00

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;
}
}