【发布时间】:2017-10-21 15:02:54
【问题描述】:
我想在外部库(Android 中的 AppCompat)中记录一个变量值。
有可能吗?我知道我可以打断点并检查一个值,但我想检查许多很难用这种方式调试的触摸事件回调
例如,代码是:
int setHeaderTopBottomOffset(CoordinatorLayout parent, V header, int newOffset,
int minOffset, int maxOffset) {
final int curOffset = getTopAndBottomOffset();
int consumed = 0;
if (minOffset != 0 && curOffset >= minOffset && curOffset <= maxOffset) {
// If we have some scrolling range, and we're currently within the min and max
// offsets, calculate a new offset
newOffset = MathUtils.constrain(newOffset, minOffset, maxOffset);
if (curOffset != newOffset) {
setTopAndBottomOffset(newOffset);
// Update how much dy we have consumed
consumed = curOffset - newOffset;
}
}
return consumed;
}
我想在curOffset != newOffset 和注销curOffset 和newOffset 时记录案例
【问题讨论】:
-
请提供具体细节。
标签: java android debugging logging libraries