remove debug
This commit is contained in:
parent
b6dacac94d
commit
a5c64c2d49
@ -427,11 +427,6 @@ namespace AlicizaX.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public Action<int> OnIndexChanged;
|
public Action<int> OnIndexChanged;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 当滚动位置发生变化时触发。
|
|
||||||
/// </summary>
|
|
||||||
public Action OnScrollValueChanged;
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Unity Lifecycle
|
#region Unity Lifecycle
|
||||||
@ -968,10 +963,6 @@ namespace AlicizaX.UI
|
|||||||
|
|
||||||
float targetPosition = CalculateScrollPositionWithAlignment(index, alignment, offset);
|
float targetPosition = CalculateScrollPositionWithAlignment(index, alignment, offset);
|
||||||
|
|
||||||
if (UGListExtensions.DebugScrollTo)
|
|
||||||
{
|
|
||||||
Debug.Log($"[RecyclerView] ScrollToWithAlignment: index={index}, alignment={alignment}, offset={offset}, targetPosition={targetPosition}, maxPosition={scroller.MaxPosition}");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (duration > 0 && smooth)
|
if (duration > 0 && smooth)
|
||||||
{
|
{
|
||||||
@ -1022,11 +1013,6 @@ namespace AlicizaX.UI
|
|||||||
// 叠加调用方传入的额外偏移量。
|
// 叠加调用方传入的额外偏移量。
|
||||||
targetPosition += offset;
|
targetPosition += offset;
|
||||||
|
|
||||||
if (UGListExtensions.DebugScrollTo)
|
|
||||||
{
|
|
||||||
Debug.Log($"[RecyclerView] CalculateScrollPosition: index={index}, itemPosition={itemPosition}, itemSize={itemSize}, viewportLength={viewportLength}, contentLength={contentLength}, targetPosition={targetPosition}, maxPosition={scroller.MaxPosition}");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 将结果限制在可滚动范围内。
|
// 将结果限制在可滚动范围内。
|
||||||
return Mathf.Clamp(targetPosition, 0, scroller.MaxPosition);
|
return Mathf.Clamp(targetPosition, 0, scroller.MaxPosition);
|
||||||
}
|
}
|
||||||
@ -1074,7 +1060,6 @@ namespace AlicizaX.UI
|
|||||||
UpdateScrollbarValue(position);
|
UpdateScrollbarValue(position);
|
||||||
UpdateVisibleRange();
|
UpdateVisibleRange();
|
||||||
layoutManager.DoItemAnimation();
|
layoutManager.DoItemAnimation();
|
||||||
OnScrollValueChanged?.Invoke();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -8,10 +8,6 @@ namespace AlicizaX.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class UGListExtensions
|
public static class UGListExtensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 控制是否输出滚动定位调试日志。
|
|
||||||
/// </summary>
|
|
||||||
public static bool DebugScrollTo { get; set; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 将列表滚动到指定索引,并按给定对齐方式定位。
|
/// 将列表滚动到指定索引,并按给定对齐方式定位。
|
||||||
@ -40,11 +36,6 @@ namespace AlicizaX.UI
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DebugScrollTo)
|
|
||||||
{
|
|
||||||
Debug.Log($"[UGListExtensions] ScrollTo: index={index}, alignment={alignment}, offset={offset}, smooth={smooth}, duration={duration}");
|
|
||||||
}
|
|
||||||
|
|
||||||
ugList.RecyclerView.ScrollToWithAlignment(index, alignment, offset, smooth, duration);
|
ugList.RecyclerView.ScrollToWithAlignment(index, alignment, offset, smooth, duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user