if (super.isLayout(tag)) { return true;
/** * Returns true if the given child view is the same class or a sub class of * the given parent view class * * @param parentViewFqcn the fully qualified class name of the parent view * @param childViewFqcn the fully qualified class name of the child view * @return true if the child view is a sub view of (or the same class as) * the parent view */ public boolean isSubViewOf(@NonNull String parentViewFqcn, @NonNull String childViewFqcn) { while (!childViewFqcn.equals("android.view.View")) { if (parentViewFqcn.equals(childViewFqcn)) { return true; } String parent = getParentViewClass(childViewFqcn); if (parent == null) { // Unknown view - err on the side of caution return true; } childViewFqcn = parent; } return false; }
/** * 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; } }
if (layoutType != null) { if (!layoutType.equals(castType) && !context.getSdkInfo().isSubViewOf(castType, layoutType)) { compatible = false; for (String type : layoutTypes) { if (type.equals(castType) || context.getSdkInfo().isSubViewOf(castType, type)) { compatible = true; break;
if (layoutType != null) { if (!layoutType.equals(castType) && !context.getSdkInfo().isSubViewOf(castType, layoutType)) { compatible = false; for (String type : layoutTypes) { if (type.equals(castType) || context.getSdkInfo().isSubViewOf(castType, type)) { compatible = true; break;
for (Element child : children) { String tagName = child.getTagName(); if (!(sdkInfo.isLayout(tagName)
/** * 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; } }
String parent = sdkInfo.getParentViewClass(className); if (parent == null) { if (internalName == null) {
for (Element child : children) { String tagName = child.getTagName(); if (!(sdkInfo.isLayout(tagName)