protected override void Dispose(DisposeTypes type) { if (disposed) { return; } if (type == DisposeTypes.Explicit) { if (mLayout != null) { mLayout.StopScroll(false); mLayout.ClearRecyclerView(); mLayout = null; } if (mAdapter != null) { mAdapter.ItemEvent -= OnItemEvent; } if (mPanGestureDetector != null) { mPanGestureDetector.Detected -= OnPanGestureDetected; mPanGestureDetector.Dispose(); mPanGestureDetector = null; } if (mScrollBarShowTimer != null) { mScrollBarShowTimer.Tick -= OnShowTimerTick; mScrollBarShowTimer.Stop(); mScrollBarShowTimer.Dispose(); mScrollBarShowTimer = null; } if (mRecyclerPool != null) { mRecyclerPool.Clear(); mRecyclerPool = null; } if (mChildHelper != null) { mChildHelper.Clear(); mChildHelper.Dispose(); mChildHelper = null; } } base.Dispose(type); }
protected override void Dispose(DisposeTypes type) { if (disposed) { return; } if (type == DisposeTypes.Explicit) { if (layout != null) { layout.StopScroll(false); layout.ClearRecyclerView(); layout = null; } if (adapter != null) { adapter.ItemEvent -= OnItemEvent; } if (panGestureDetector != null) { panGestureDetector.Detected -= OnPanGestureDetected; panGestureDetector.Dispose(); panGestureDetector = null; } if (scrollBarShowTimer != null) { scrollBarShowTimer.Tick -= OnShowTimerTick; scrollBarShowTimer.Stop(); scrollBarShowTimer.Dispose(); scrollBarShowTimer = null; } if (recyclerPool != null) { recyclerPool.Clear(); recyclerPool = null; } if (childHelper != null) { childHelper.Clear(); childHelper.Dispose(); childHelper = null; } } base.Dispose(type); }
public FlexibleView() { mRecyclerPool = new RecycledViewPool(this); mRecycler = new FlexibleViewRecycler(this); mRecycler.SetRecycledViewPool(mRecyclerPool); mChildHelper = new ChildHelper(this); mPanGestureDetector = new PanGestureDetector(); mPanGestureDetector.Attach(this); mPanGestureDetector.Detected += OnPanGestureDetected; mAdapteHelper = new AdapterHelper(this); ClippingMode = ClippingModeType.ClipToBoundingBox; }