Make Utils.getDeviceOverrideValue aware of device orientation
Bug: 6277225 Change-Id: If41fe5cbee0985b9a4740dcd5d1c6ba73b94b377main
parent
423b30d59c
commit
11a40a047f
|
@ -466,11 +466,12 @@ public class Utils {
|
|||
}
|
||||
|
||||
private static final String HARDWARE_PREFIX = Build.HARDWARE + ",";
|
||||
private static final HashMap<Integer, String> sDeviceOverrideValueMap =
|
||||
new HashMap<Integer, String>();
|
||||
private static final HashMap<String, String> sDeviceOverrideValueMap =
|
||||
new HashMap<String, String>();
|
||||
|
||||
public static String getDeviceOverrideValue(Resources res, int overrideResId, String defValue) {
|
||||
final Integer key = overrideResId;
|
||||
final int orientation = res.getConfiguration().orientation;
|
||||
final String key = overrideResId + "-" + orientation;
|
||||
if (!sDeviceOverrideValueMap.containsKey(key)) {
|
||||
String overrideValue = defValue;
|
||||
for (final String element : res.getStringArray(overrideResId)) {
|
||||
|
|
Loading…
Reference in New Issue