Skip to content

Instantly share code, notes, and snippets.

View christopherperry's full-sized avatar

Christopher Perry christopherperry

View GitHub Profile
@christopherperry
christopherperry / robolectric-library-resource-loading.java
Created August 30, 2012 21:32 — forked from pplante/robolectric-library-resource-loading.java
Robolectric does not support loading resources from an Android Library project such as ActionBarSherlock of FlyInMenu, so this patch allows you to specify a library project to load resources in tests.
// In ResourceLoader.java I added the following method:
//
public void loadLibraryProjectResources(File libraryProjectRoot) throws Exception {
File systemResourceDir = getSystemResourceDir(getPathToAndroidResources());
File localValueResourceDir = getValueResourceDir(libraryProjectRoot);
File systemValueResourceDir = getValueResourceDir(systemResourceDir);
loadStringResources(localValueResourceDir, systemValueResourceDir);
loadPluralsResources(localValueResourceDir, systemValueResourceDir);
loadValueResources(localValueResourceDir, systemValueResourceDir);
^(.*(ClassNameOne|ClassNameTwo|ClassNameThree)).*$
/**
* ArcUtils.java
*
* Copyright (c) 2014 BioWink GmbH.
*
* 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