Permalink
Browse files

Make ResourceDrawableIdHelper work with resource id

Reviewed By: fkgozali

Differential Revision: D5636657

fbshipit-source-id: 251b8b495655abf83618922b86f710fa38b08317
  • Loading branch information...
sriramramani authored and facebook-github-bot committed Aug 16, 2017
1 parent 9c2a5cd commit dc61f10e8b371a19257a2a333d31faf1feaca76c
@@ -55,6 +55,13 @@ public int getResourceDrawableId(Context context, @Nullable String name) {
}
name = name.toLowerCase().replace("-", "_");
// name could be a resource id.
try {
return Integer.parseInt(name);
} catch (NumberFormatException e) {
// Do nothing.
}
synchronized (this) {
if (mResourceDrawableIdMap.containsKey(name)) {
return mResourceDrawableIdMap.get(name);

0 comments on commit dc61f10

Please sign in to comment.