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
/* | |
* Copyright 2014 Chris Banes | |
* | |
* 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 |
#!/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 ) |
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
// your code | |
apply from: "build-plugins/idea-gradle-sources.gradle" |
/** | |
* Show the activity over the lockscreen and wake up the device. If you launched the app manually | |
* both of these conditions are already true. If you deployed from the IDE, however, this will | |
* save you from hundreds of power button presses and pattern swiping per day! | |
*/ | |
public static void riseAndShine(Activity activity) { | |
activity.getWindow().addFlags(FLAG_SHOW_WHEN_LOCKED); | |
PowerManager power = (PowerManager) activity.getSystemService(POWER_SERVICE); | |
PowerManager.WakeLock lock = |
import org.gradle.internal.os.OperatingSystem; | |
String getJavaHome(String version) { | |
def stdout = new ByteArrayOutputStream() | |
exec { | |
commandLine "/usr/libexec/java_home", "-v", version | |
standardOutput = stdout; | |
} | |
return stdout.toString().trim() | |
} |
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Copyright 2016 Google 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 |
= Resources = | |
* zsh - http://www.zsh.org/ | |
* ZSH-LOVERS - http://grml.org/zsh/zsh-lovers.html | |
* manual - http://zsh.sourceforge.net/Doc/Release/index.html | |
* oh-my-zsh - https://github.com/robbyrussell/oh-my-zsh | |
* prezo - https://github.com/sorin-ionescu/prezto | |
* zsh-users - https://github.com/zsh-users | |
= Functions = |
// A reminder to myself on how to quickly create a throw away gui app on OSX (i.e. a single file, | |
// w/o relying on XCode project templates | |
//Notes: In general it is hard to know how to create a Cocoa based gui without using XCode. | |
//This issue has existed for both Objective-C and now Swift | |
//Furthermore, Swift<-->Cocoa syntax has changed dramatically over various Swift versions, | |
//making stackoverflow posts unreliable | |
//This file provides a template for creating a throw away gui app |