Created
October 13, 2015 14:19
-
-
Save patrykpoborca/0458ec43fdcbff11270d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MockedResources extends Resources{ | |
private Map<Integer, String> stringMap; | |
public MockedResources(){ | |
this(null, null, null); | |
} | |
public MockedResources(AssetManager assets, DisplayMetrics metrics, Configuration config) { | |
super(assets, metrics, config); | |
stringMap = new HashMap<>(1); | |
} | |
public void addString(int id, String value){ | |
stringMap.put(id, value); | |
} | |
@NonNull | |
@Override | |
public String getString(int id) throws NotFoundException { | |
return stringMap.get(id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment