This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Replace the location of the nexus repository with your specific location. | |
| // To enable this: gradlew build -I init.gradle | |
| // This will now have gradle use the mirrors first and jcenter and other repositories second if it can't find the artifacts. | |
| // Make sure your mirror Jcenter in your nexus repository. | |
| allprojects{ | |
| buildscript{ | |
| repositories{ | |
| maven{ url 'http://localhost:8081/nexus/content/groups/public' } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.ByteArrayOutputStream; | |
| import java.io.PrintStream; | |
| import org.junit.rules.ExternalResource; | |
| import org.robolectric.shadows.ShadowLog; | |
| public class RobolectricLoggingRule extends ExternalResource { | |
| PrintStream loggingStream; | |
| ByteArrayOutputStream loggingOutputStream; | |
| PrintStream defaultStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.support.design.widget.TextInputLayout; | |
| import org.robolectric.annotation.Implements; | |
| import org.robolectric.annotation.RealObject; | |
| import org.robolectric.shadows.ShadowViewGroup; | |
| @Implements(TextInputLayout.class) | |
| public class ShadowTextInputLayout extends ShadowViewGroup { | |
| @RealObject private TextInputLayout realTextInputLayout; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.Intent; | |
| import android.os.Bundle; | |
| import android.support.v4.app.Fragment; | |
| import java.util.ArrayList; | |
| import java.util.HashMap; | |
| import java.util.List; | |
| import java.util.Map; | |
| import org.robolectric.annotation.Implementation; | |
| import org.robolectric.annotation.Implements; | |
| import org.robolectric.shadows.ShadowApplication; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private Activity getActivity() { | |
| Context context = getContext(); | |
| while (context instanceof ContextWrapper) { | |
| if (context instanceof Activity) { | |
| return (Activity)context; | |
| } | |
| context = ((ContextWrapper)context).getBaseContext(); | |
| } | |
| return null; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <ripple xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:color="@color/loyalty_button_reward_ripple"> | |
| <item android:id="@android:id/mask" android:drawable="@drawable/button_shopping_bag_loyalty_normal"/> | |
| <item> | |
| <selector> | |
| <item android:state_enabled="true" android:drawable="@drawable/button_shopping_bag_loyalty_normal"/> | |
| <item android:state_enabled="false" android:drawable="@drawable/button_shopping_bag_loyalty_rewards"/> | |
| </selector> | |
| </item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SelfReturningAnswer implements Answer<Object> { | |
| public Object answer(InvocationOnMock invocation) throws Throwable { | |
| Object mock = invocation.getMock(); | |
| if( invocation.getMethod().getReturnType().isInstance( mock )){ | |
| return mock; | |
| } | |
| else{ | |
| return RETURNS_DEFAULTS.get().answer(invocation); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright (C) 2013 Square, Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package retrofit; | |
| import com.squareup.okhttp.RequestBody; | |
| import com.squareup.okhttp.ResponseBody; | |
| import org.codehaus.jackson.map.ObjectMapper; | |
| import org.codehaus.jackson.map.ObjectReader; | |
| import org.codehaus.jackson.map.ObjectWriter; | |
| import org.codehaus.jackson.type.JavaType; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public abstract class AbstractNLSSupportTest { | |
| @Rule | |
| public TestName name = new TestName(); | |
| protected String propertiesFilename; | |
| protected String brandId; | |
| protected String language; | |
| protected String country; |