Make ResourceDrawableIdHelper work with resource id
Reviewed By: fkgozali Differential Revision: D5636657 fbshipit-source-id: 251b8b495655abf83618922b86f710fa38b08317
This commit is contained in:
parent
9c2a5cdbc3
commit
dc61f10e8b
|
@ -55,6 +55,13 @@ public class ResourceDrawableIdHelper {
|
|||
}
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue