Skip to content

Instantly share code, notes, and snippets.

View robbypond's full-sized avatar

Robby Pond robbypond

View GitHub Profile
afterEvaluate { project ->
android.applicationVariants.each { variant ->
variant.javaCompile.dependsOn stripPlayServices
}
}
task stripPlayServices << {
def playServiceRootFolder = new File(rootProject.buildDir, "intermediates/exploded-aar/com.google.android.gms/play-services/")
playServiceRootFolder.list().each { versionName ->
def versionFolder = new File(playServiceRootFolder, versionName)
@robbypond
robbypond / StyleSearchView
Created December 12, 2013 01:16
Shows how to apply custom style/drawables to the Android SearchView widget.
final MenuItem searchItem = menu.findItem(R.id.action_search);
SearchView searchView = (SearchView) searchItem.getActionView();
if (searchView != null) {
//These are the internal resource names so we must find the id
int searchPlateId = getResources().getIdentifier("android:id/search_plate", null, null);
int submitAreaId = getResources().getIdentifier("android:id/submit_area", null, null);
//These are not guaranteed to exist and could be different based on device software
if(searchPlateId != 0 && submitAreaId != 0) {