Making sure that the prefix is handled properly.
Change-Id: Ic50327b1ed4d6b54753b5b3887508a53cd7a3497
This commit is contained in:
@@ -4848,7 +4848,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
|
|||||||
* of ViewGroup that are responsible for arranging their children.
|
* of ViewGroup that are responsible for arranging their children.
|
||||||
* @return The LayoutParams associated with this view
|
* @return The LayoutParams associated with this view
|
||||||
*/
|
*/
|
||||||
@ViewDebug.ExportedProperty(deepExport = true, category = "layout")
|
@ViewDebug.ExportedProperty(deepExport = true, prefix = "layout_")
|
||||||
public ViewGroup.LayoutParams getLayoutParams() {
|
public ViewGroup.LayoutParams getLayoutParams() {
|
||||||
return mLayoutParams;
|
return mLayoutParams;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1377,9 +1377,8 @@ public class ViewDebug {
|
|||||||
Object methodValue = method.invoke(view, (Object[]) null);
|
Object methodValue = method.invoke(view, (Object[]) null);
|
||||||
final Class<?> returnType = method.getReturnType();
|
final Class<?> returnType = method.getReturnType();
|
||||||
final ExportedProperty property = sAnnotations.get(method);
|
final ExportedProperty property = sAnnotations.get(method);
|
||||||
String fullName = (property.category().length() == 0) ?
|
String categoryPrefix =
|
||||||
method.getName() :
|
property.category().length() != 0 ? property.category() + ":" : "";
|
||||||
(property.category() + ":" + method.getName());
|
|
||||||
|
|
||||||
if (returnType == int.class) {
|
if (returnType == int.class) {
|
||||||
|
|
||||||
@@ -1390,7 +1389,8 @@ public class ViewDebug {
|
|||||||
final FlagToString[] flagsMapping = property.flagMapping();
|
final FlagToString[] flagsMapping = property.flagMapping();
|
||||||
if (flagsMapping.length > 0) {
|
if (flagsMapping.length > 0) {
|
||||||
final int intValue = (Integer) methodValue;
|
final int intValue = (Integer) methodValue;
|
||||||
final String valuePrefix = prefix + fullName + '_';
|
final String valuePrefix =
|
||||||
|
categoryPrefix + prefix + method.getName() + '_';
|
||||||
exportUnrolledFlags(out, flagsMapping, intValue, valuePrefix);
|
exportUnrolledFlags(out, flagsMapping, intValue, valuePrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1415,7 +1415,7 @@ public class ViewDebug {
|
|||||||
}
|
}
|
||||||
} else if (returnType == int[].class) {
|
} else if (returnType == int[].class) {
|
||||||
final int[] array = (int[]) methodValue;
|
final int[] array = (int[]) methodValue;
|
||||||
final String valuePrefix = prefix + fullName + '_';
|
final String valuePrefix = categoryPrefix + prefix + method.getName() + '_';
|
||||||
final String suffix = "()";
|
final String suffix = "()";
|
||||||
|
|
||||||
exportUnrolledArray(context, out, property, array, valuePrefix, suffix);
|
exportUnrolledArray(context, out, property, array, valuePrefix, suffix);
|
||||||
@@ -1429,7 +1429,7 @@ public class ViewDebug {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
writeEntry(out, prefix, fullName, "()", methodValue);
|
writeEntry(out, categoryPrefix + prefix, method.getName(), "()", methodValue);
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
} catch (InvocationTargetException e) {
|
} catch (InvocationTargetException e) {
|
||||||
}
|
}
|
||||||
@@ -1450,9 +1450,8 @@ public class ViewDebug {
|
|||||||
Object fieldValue = null;
|
Object fieldValue = null;
|
||||||
final Class<?> type = field.getType();
|
final Class<?> type = field.getType();
|
||||||
final ExportedProperty property = sAnnotations.get(field);
|
final ExportedProperty property = sAnnotations.get(field);
|
||||||
String fullName = (property.category().length() == 0) ?
|
String categoryPrefix =
|
||||||
field.getName() :
|
property.category().length() != 0 ? property.category() + ":" : "";
|
||||||
(property.category() + ":" + field.getName());
|
|
||||||
|
|
||||||
if (type == int.class) {
|
if (type == int.class) {
|
||||||
|
|
||||||
@@ -1463,7 +1462,8 @@ public class ViewDebug {
|
|||||||
final FlagToString[] flagsMapping = property.flagMapping();
|
final FlagToString[] flagsMapping = property.flagMapping();
|
||||||
if (flagsMapping.length > 0) {
|
if (flagsMapping.length > 0) {
|
||||||
final int intValue = field.getInt(view);
|
final int intValue = field.getInt(view);
|
||||||
final String valuePrefix = prefix + fullName + '_';
|
final String valuePrefix =
|
||||||
|
categoryPrefix + prefix + field.getName() + '_';
|
||||||
exportUnrolledFlags(out, flagsMapping, intValue, valuePrefix);
|
exportUnrolledFlags(out, flagsMapping, intValue, valuePrefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1486,7 +1486,7 @@ public class ViewDebug {
|
|||||||
}
|
}
|
||||||
} else if (type == int[].class) {
|
} else if (type == int[].class) {
|
||||||
final int[] array = (int[]) field.get(view);
|
final int[] array = (int[]) field.get(view);
|
||||||
final String valuePrefix = prefix + fullName + '_';
|
final String valuePrefix = categoryPrefix + prefix + field.getName() + '_';
|
||||||
final String suffix = "";
|
final String suffix = "";
|
||||||
|
|
||||||
exportUnrolledArray(context, out, property, array, valuePrefix, suffix);
|
exportUnrolledArray(context, out, property, array, valuePrefix, suffix);
|
||||||
@@ -1495,8 +1495,8 @@ public class ViewDebug {
|
|||||||
return;
|
return;
|
||||||
} else if (!type.isPrimitive()) {
|
} else if (!type.isPrimitive()) {
|
||||||
if (property.deepExport()) {
|
if (property.deepExport()) {
|
||||||
dumpViewProperties(context, field.get(view), out,
|
dumpViewProperties(context, field.get(view), out, prefix
|
||||||
prefix + property.prefix());
|
+ property.prefix());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1505,7 +1505,7 @@ public class ViewDebug {
|
|||||||
fieldValue = field.get(view);
|
fieldValue = field.get(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
writeEntry(out, prefix, fullName, "", fieldValue);
|
writeEntry(out, categoryPrefix + prefix, field.getName(), "", fieldValue);
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user