0
我想在外部庫(Android中的AppCompat)中記錄一個變量值。如何在java中記錄庫變量?
有沒有可能?我知道我可以打一個斷點,檢查值,但我想查多觸摸事件的回調,這都很難有這樣
例如調試,代碼爲:
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
請提供具體的細節。 –