Skip to content

Commit 4e6e84c

Browse files
committed
修复在RecyclerView中滑动缓存导致的显示问题
1 parent f313ef3 commit 4e6e84c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/src/main/java/com/github/wangyiqian/stockchart/childchart/base/BaseChildChart.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ abstract class BaseChildChart<C : BaseChildChartConfig> @JvmOverloads constructo
3636
OnKEntitiesChangedListener {
3737

3838
// 管理matrix
39-
private var childChartMatrixHelper: ChildChartMatrixHelper<C>? = null
39+
private var childChartMatrixHelper =
40+
ChildChartMatrixHelper(
41+
stockChart,
42+
this
43+
)
4044

4145
// 显示区域
4246
private val chartDisplayArea = RectF()
@@ -73,11 +77,6 @@ abstract class BaseChildChart<C : BaseChildChartConfig> @JvmOverloads constructo
7377
override fun onAttachedToWindow() {
7478
super.onAttachedToWindow()
7579
stockChart.addOnKEntitiesChangedListener(this)
76-
childChartMatrixHelper =
77-
ChildChartMatrixHelper(
78-
stockChart,
79-
this
80-
)
8180
}
8281

8382
override fun onDetachedFromWindow() {

0 commit comments

Comments
 (0)