/** * Checks whether the given layout parameter name is valid for the given * parent tag assuming it has the given current parent tag */ private static boolean isValidParamForParent(Context context, String name, String parent, String parentTag) { if (parentTag.indexOf('.') != -1 || parentTag.equals(VIEW_TAG)) { // Custom tag: We don't know whether it extends one of the builtin // types where the layout param is valid, so don't complain return true; } SdkInfo sdk = context.getSdkInfo(); if (!parentTag.equals(parent)) { String tag = sdk.getParentViewName(parentTag); while (tag != null) { if (tag.equals(parent)) { return true; } tag = sdk.getParentViewName(tag); } return false; } return true; } }
/** * Checks whether the given layout parameter name is valid for the given * parent tag assuming it has the given current parent tag */ private static boolean isValidParamForParent(Context context, String name, String parent, String parentTag) { if (parentTag.indexOf('.') != -1 || parentTag.equals(VIEW_TAG)) { // Custom tag: We don't know whether it extends one of the builtin // types where the layout param is valid, so don't complain return true; } SdkInfo sdk = context.getSdkInfo(); if (!parentTag.equals(parent)) { String tag = sdk.getParentViewName(parentTag); while (tag != null) { if (tag.equals(parent)) { return true; } tag = sdk.getParentViewName(tag); } return false; } return true; } }