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
/* | |
Example: | |
task tapPowerButton() { | |
group = 'device' | |
description = 'Tap the power button on all devices/emulators' | |
doLast { | |
def action = { serial -> | |
def adb = android.getAdbExe().toString() | |
exec { | |
commandLine "$adb -s $serial shell input keyevent 26".split(' ') |
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.graphics.Color; | |
import android.graphics.drawable.Drawable; | |
import android.os.Build; | |
import android.support.test.espresso.UiController; | |
import android.support.test.espresso.ViewAction; | |
import android.view.View; | |
import org.hamcrest.Matcher; | |
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; |
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.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.ColorFilter; | |
import android.graphics.Paint; | |
import android.graphics.Rect; | |
import android.graphics.RectF; | |
import android.graphics.drawable.Drawable; | |
import android.support.annotation.ColorInt; | |
import android.support.annotation.NonNull; |
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.res.Resources; | |
import android.support.annotation.NonNull; | |
import android.util.DisplayMetrics; | |
import android.util.TypedValue; | |
/** | |
* Convert between DP and pixels, like {@link java.util.concurrent.TimeUnit} does. | |
* For example: | |
* Dimens.DP.toPX(context.getResources(), 16); // 16dp to pixels | |
* Dimens.PX.toDP(context.getResources(), 16); // 16px to dips |
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.Context; | |
import android.graphics.Rect; | |
import android.support.annotation.NonNull; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.DisplayMetrics; | |
import android.util.TypedValue; | |
import android.view.View; | |
/** | |
* Adds 8dp padding to the top of the first and the bottom of the last item in the list, |