예제 #1
0
 private static boolean matchTypedValue(
     final TypedArray a, final int index, final int intValue, final String strValue) {
   // If <case> does not have "index" attribute, that means this <case> is wild-card for
   // the attribute.
   final TypedValue v = a.peekValue(index);
   if (v == null) {
     return true;
   }
   if (ResourceUtils.isIntegerValue(v)) {
     return intValue == a.getInt(index, 0);
   }
   if (ResourceUtils.isStringValue(v)) {
     return StringUtils.containsInArray(strValue, a.getString(index).split("\\|"));
   }
   return false;
 }
예제 #2
0
 private static boolean matchString(final TypedArray a, final int index, final String value) {
   // If <case> does not have "index" attribute, that means this <case> is wild-card for
   // the attribute.
   return !a.hasValue(index)
       || StringUtils.containsInArray(value, a.getString(index).split("\\|"));
 }