Skip to content

Instantly share code, notes, and snippets.

@nbarraille
nbarraille / OrientationChangeAction.java
Last active January 30, 2023 00:04
An Espresso ViewAction that changes the orientation of the screen
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 - Nathan Barraille
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@kozko2001
kozko2001 / build.gradle
Last active August 29, 2015 14:10
graddle script to launch robolectric from Android Studio
apply plugin: 'com.android.application'
apply plugin: 'robolectric'
apply from: 'https://gist.githubusercontent.com/kozko2001/edd6cde0ce1da1de70a3/raw/robolectricAndroidStudio.gradle'
@avbk
avbk / robo.md
Last active October 14, 2017 00:16
Testing with Robolectric within Android Studio

Testing with Robolectric within Android Studio

Prerequisites

0. Setup a project

Setup a new Android project with Android Studio. If you already have done this you can skip this step.

@dmarcato
dmarcato / strip_play_services.gradle
Last active December 21, 2022 10:10
Gradle task to strip unused packages on Google Play Services library
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')
@Cheesebaron
Cheesebaron / AndroidManifest.xml
Last active December 31, 2017 18:10
Quick and dirty list of WiFi AP's and connect to it. Only WPA/WPA2 tested.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" package="dk.ostebaronen.wifishizniz" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:targetSdkVersion="17" />
<application android:label="WiFiShizniz"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
</manifest>
@romannurik
romannurik / SwipeDismissListViewTouchListener.java
Last active May 1, 2021 10:16
**BETA** Android 4.0-style "Swipe to Dismiss" sample code
Moved to
https://github.com/romannurik/android-swipetodismiss