From 7e19e42014b7351fea583317b15bc1c3e2434347 Mon Sep 17 00:00:00 2001 From: Laurent Date: Tue, 23 Jun 2020 15:36:41 +0200 Subject: [PATCH] Cleanup --- .../modules/handhistory/HandHistoryAdapter.kt | 7 +------ .../handhistory/HandHistoryFragment.kt | 21 +++++++------------ 2 files changed, 9 insertions(+), 19 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 a281f030..de9ea1df 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 @@ -39,7 +39,6 @@ import net.pokeranalytics.android.ui.view.RowRepresentable import net.pokeranalytics.android.ui.view.holder.RowViewHolder import net.pokeranalytics.android.ui.view.rowrepresentable.ViewIdentifier import net.pokeranalytics.android.util.extensions.formatted -import timber.log.Timber enum class HandRowType(var layoutRes: Int) : ViewIdentifier, RowRepresentable { @@ -174,10 +173,6 @@ class HandHistoryAdapter( delegate?.onRowSelected(this.currentPosition, row, tag) -// val text = dataSource.charSequenceForRow(row, itemView.context, tag) -// editText.hint = text -// editText.text = null - setEditTextBackground(editText = editText, isEnabled = true, isFocused = true) } @@ -471,7 +466,7 @@ class HandHistoryAdapter( amountEditText.setOnTouchListener { _, event -> - Timber.d("=== event.action = ${event.action}") +// Timber.d("=== event.action = ${event.action}") if (event.action == MotionEvent.ACTION_UP) { // Both are required, otherwise requestFocus() fails amountEditText.isFocusable = true diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryFragment.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryFragment.kt index 82344ac4..a25482f9 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryFragment.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/HandHistoryFragment.kt @@ -220,7 +220,7 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL } this.replayerItem = menu.findItem(R.id.replayer) this.replayerItem?.isEnabled = this.model.handHistory.isManaged - Timber.d("this.replayerItem = ${this.replayerItem}") +// Timber.d("this.replayerItem = ${this.replayerItem}") } } @@ -644,19 +644,14 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDelegate, KeyboardL // set interpolator and updateListener to get the animated value valueAnimator.addUpdateListener { - this.kbTopGuideline?.let { topGuideline -> + val lp = this.kbTopGuideline.layoutParams as ConstraintLayout.LayoutParams + // get the float value + lp.guideEnd = (it.animatedValue as Float).toInt() + // update layout params + this.kbTopGuideline.layoutParams = lp - val lp = this.kbTopGuideline.layoutParams as ConstraintLayout.LayoutParams - // get the float value - lp.guideEnd = (it.animatedValue as Float).toInt() - // update layout params - this.kbTopGuideline.layoutParams = lp - - if (lp.guideEnd == end.toInt()) { - endHandler?.invoke() - } - } ?: run { - Timber.w("WARNING >>> kbTopGuideline is null") + if (lp.guideEnd == end.toInt()) { + endHandler?.invoke() } }