This test rule is now in the 'test-rules' support repository. Use that one!
https://developer.android.com/reference/android/support/test/rule/ActivityTestRule.html
| var active = false; | |
| function changeRefer(details) { | |
| if (!active) return; | |
| for (var i = 0; i < details.requestHeaders.length; ++i) { | |
| if (details.requestHeaders[i].name === 'Referer') { | |
| details.requestHeaders[i].value = 'http://www.google.com/'; | |
| break; | |
| } | 
| def installAll = tasks.create('installAll') | |
| installAll.description = 'Install all applications.' | |
| android.applicationVariants.all { variant -> | |
| installAll.dependsOn(variant.install) | |
| // Ensure we end up in the same group as the other install tasks. | |
| installAll.group = variant.install.group | |
| } | 
| import android.graphics.Rect; | |
| import android.view.TouchDelegate; | |
| import android.view.View; | |
| import com.google.common.base.Optional; | |
| import com.google.common.base.Preconditions; | |
| /** | |
| * Utility used to extend the touchable area around a view in a viewgroup | |
| * Usage: TouchAreaExtender.Builder.with(mReJamCaptionInput) | 
| import android.app.Activity; | |
| import android.content.Context; | |
| import android.content.ContextWrapper; | |
| import android.support.test.espresso.UiController; | |
| import android.support.test.espresso.ViewAction; | |
| import android.view.View; | |
| import com.squareup.spoon.Spoon; | |
| import org.hamcrest.Matcher; | |
| import org.hamcrest.Matchers; | 
| // Here's a trick to get XML injected into the APK. | |
| // Be careful not to merge-conflict with existing parameters, as this occurs after the mergeResources step, and the behavior is likely undefined. | |
| // was added to app/build.gradle after applying android plugin. | |
| android.applicationVariants.all { variant -> | |
| // Supports both 0.12.+ and 1.+ of Android gradle plugin by getting all processResourceTasks: | |
| def tasks = [] | |
| // Multidex has multiple process resource tasks | |
| if (variant.hasProperty('outputs')) { | |
| for (output in variant.outputs) { | 
| // your code | |
| apply from: "build-plugins/idea-gradle-sources.gradle" | 
This test rule is now in the 'test-rules' support repository. Use that one!
https://developer.android.com/reference/android/support/test/rule/ActivityTestRule.html
| #!/bin/bash | |
| # License for any modification to the original (linked below): | |
| # ---------------------------------------------------------------------------- | |
| # "THE BEER-WARE LICENSE" (Revision 42): | |
| # Sebastiano Poggi wrote this file. As long as you retain this notice you | |
| # can do whatever you want with this stuff. If we meet some day, and you think | |
| # this stuff is worth it, you can buy me a beer in return. | |
| # ---------------------------------------------------------------------------- | |
| prefix=${1-"drawable"} | |
| buckets=( mdpi hdpi xhdpi xxhdpi xxxhdpi ) | 
| allprojects { | |
| afterEvaluate { project -> | |
| project.configurations.all { | |
| resolutionStrategy.eachDependency { DependencyResolveDetails details -> | |
| def requested = details.requested | |
| if (requested.version.contains('+')) { | |
| throw new GradleException("Wildcard dependency forbidden: ${requested.group}:${requested.name}:${requested.version}") | |
| } | |
| } | |
| } | 
| import android.graphics.PointF; | |
| import android.view.animation.Interpolator; | |
| /** | |
| * From https://github.com/codesoup/android-cubic-bezier-interpolator | |
| * Derived from: https://github.com/rdallasgray/bez | |
| */ | |
| public class CubicBezierInterpolator implements Interpolator { |