docs: public static int getResourceId(Resources.Theme theme, TypedArray a, TypedValue[] values, int index, int def) {
          if (values != null && theme != null) {
              TypedValue v = values[index];
              if (v.type == TypedValue.TYPE_ATTRIBUTE) {
                  TEMP_ARRAY[0] = v.data;
                  TypedArray tmp = theme.obtainStyledAttributes(null, TEMP_ARRAY, 0, 0);
                  try {
                      return tmp.getResourceId(0, def);
                  } finally {
                      tmp.recycle();
                  }
              }
          }
  
          if (a != null) {
              return a.getResourceId(index, def);
          }
  
          return def;
      }