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
// USAGE | |
// Data set | |
final ArrayList<ViewModel> viewModelArrayList = new ArrayList<>(); | |
for (int i = 0; i < 100; i++) { | |
viewModelArrayList.add(new Order(i, "VM Name " + i)); | |
} | |
// Recyclerview | |
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv); |
ImageView imgview = (ImageView)findViewById(R.id.imageView_grayscale); | |
imgview.setImageBitmap(bitmap); | |
// Apply grayscale filter | |
ColorMatrix matrix = new ColorMatrix(); | |
matrix.setSaturation(0); | |
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix); | |
imgview.setColorFilter(filter); |
<?xml version="1.0" encoding="utf-8"?> | |
<!-- Add this as a debug manifest so the permissions won't be required by your production app --> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | |
<uses-permission android:name="android.permission.WAKE_LOCK" /> | |
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> | |
</manifest> |
android { | |
compileSdkVersion 23 | |
buildToolsVersion "23.0.2" | |
defaultConfig { | |
applicationId "com.company.packagename" | |
minSdkVersion 7 | |
targetSdkVersion 23 | |
versionCode 1 | |
versionName "1.0.0" |
echo "y" | android update sdk --no-ui; echo "yes" | apm upgrade; softwareupdate -i -a; brew update; brew upgrade; brew cleanup; brew cask cleanup; npm update npm -g; npm update -g; gem update |
private static long back_pressed; | |
@Override | |
public void onBackPressed(){ | |
if (back_pressed + 2000 > System.currentTimeMillis()) super.onBackPressed(); | |
else Toast.makeText(getBaseContext(), "Press once again to exit!", Toast.LENGTH_SHORT).show(); | |
back_pressed = System.currentTimeMillis(); | |
} |
public class WifiTester extends Activity { | |
TextView mainText; | |
WifiManager mainWifi; | |
WifiReceiver receiverWifi; | |
List<ScanResult> wifiList; | |
StringBuilder sb = new StringBuilder(); | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); |
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
^(?!(NotificationManager|Timeline|SensorManager|Configs|libc-netbsd|art|stetho|Choreographer|CliptrayUtils|BubblePopupHelper|ViewRootImpl|libEGL|System.out|PhoneWindow)) |
# Goes in your .git/config file | |
[alias] | |
# Temporarily stop tracking a file in git. | |
# usage: git unwatch path/to/file | |
unwatch = update-index --assume-unchanged | |
# Resume tracking a file in git. | |
# usage: git watch path/to/file | |
watch = update-index --no-assume-unchanged |