From cb055bcaa3865583f97f2d33a7e557251f639eaa Mon Sep 17 00:00:00 2001 From: Laurent Date: Thu, 6 Feb 2020 12:46:31 +0100 Subject: [PATCH] Cleanup --- .../modules/handhistory/HandHistoryAdapter.kt | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt index 4c8b0568..105377db 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryAdapter.kt @@ -80,7 +80,7 @@ class HandHistoryAdapter( } } - abstract inner class RowHandHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { + abstract inner class RowHandHolder(itemView: View) : RecyclerView.ViewHolder(itemView), BindableHolder { var currentPosition = 0 @@ -100,13 +100,16 @@ class HandHistoryAdapter( } } + override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { + this.currentPosition = position + } + } /** * Display a hand action */ - inner class RowHandAction(itemView: View) : RowHandHolder(itemView), - BindableHolder { + inner class RowHandAction(itemView: View) : RowHandHolder(itemView) { init { // Action @@ -144,10 +147,7 @@ class HandHistoryAdapter( } override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { - - Timber.d("onbind @position = $position") - - this.currentPosition = position + super.onBind(position, row, adapter) val computedAction = row as ComputedAction @@ -204,7 +204,7 @@ class HandHistoryAdapter( /** * Display a hand street */ - inner class RowHandStreet(itemView: View) : RowHandHolder(itemView), BindableHolder { + inner class RowHandStreet(itemView: View) : RowHandHolder(itemView) { init { @@ -232,7 +232,7 @@ class HandHistoryAdapter( override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { - this.currentPosition = position + super.onBind(position, row, adapter) val streetCardView = row as StreetCardsRow val street = streetCardView.street @@ -289,8 +289,7 @@ class HandHistoryAdapter( /** * Display a hand action */ - inner class RowHandPlayerSummary(itemView: View) : RowHandHolder(itemView), - BindableHolder { + inner class RowHandPlayerSummary(itemView: View) : RowHandHolder(itemView) { init { @@ -318,9 +317,7 @@ class HandHistoryAdapter( override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { - Timber.d("onbind @position = $position") - - this.currentPosition = position + super.onBind(position, row, adapter) val playerCardView = row as PlayerCardsRow @@ -349,11 +346,8 @@ class HandHistoryAdapter( } else { cardsEditText.clearFocus() } - } - } - } } \ No newline at end of file