|
|
|
@ -19,11 +19,11 @@ import net.pokeranalytics.android.model.realm.handhistory.HandHistory |
|
|
|
import net.pokeranalytics.android.ui.adapter.RowRepresentableDataSource |
|
|
|
import net.pokeranalytics.android.ui.adapter.RowRepresentableDataSource |
|
|
|
import net.pokeranalytics.android.ui.adapter.RowRepresentableDelegate |
|
|
|
import net.pokeranalytics.android.ui.adapter.RowRepresentableDelegate |
|
|
|
import net.pokeranalytics.android.ui.fragment.components.RealmFragment |
|
|
|
import net.pokeranalytics.android.ui.fragment.components.RealmFragment |
|
|
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
|
|
|
|
|
|
|
import net.pokeranalytics.android.ui.view.SmoothScrollLinearLayoutManager |
|
|
|
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.views.KeyboardListener |
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.views.KeyboardListener |
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.views.NumericKey |
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.views.NumericKey |
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.views.StreetCardHeader |
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.views.StreetCardHeader |
|
|
|
|
|
|
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
|
|
|
|
|
|
|
import net.pokeranalytics.android.ui.view.SmoothScrollLinearLayoutManager |
|
|
|
import net.pokeranalytics.android.util.extensions.findById |
|
|
|
import net.pokeranalytics.android.util.extensions.findById |
|
|
|
import timber.log.Timber |
|
|
|
import timber.log.Timber |
|
|
|
|
|
|
|
|
|
|
|
@ -113,8 +113,21 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDataSource, RowRepr |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.model.currentSelection.observeForever { selection -> |
|
|
|
this.model.currentSelection.observeForever { selection -> |
|
|
|
Timber.d("Current selection is ${selection.index} / ${selection.keyboard}") |
|
|
|
selection?.let { |
|
|
|
retrieveEditTextInputConnection(selection.index) |
|
|
|
Timber.d("Current selection is ${selection.index} / ${selection.keyboard}") |
|
|
|
|
|
|
|
retrieveEditTextInputConnection(selection.index) |
|
|
|
|
|
|
|
} ?: run { |
|
|
|
|
|
|
|
this.inputConnection = null |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// At first, the selection is defined before the holder is bound, |
|
|
|
|
|
|
|
// so we retrieve the editText inputConnection once the recycler view has been rendered |
|
|
|
|
|
|
|
this.recyclerView.viewTreeObserver.addOnGlobalLayoutListener { |
|
|
|
|
|
|
|
this.model.currentSelection.value?.index?.let { |
|
|
|
|
|
|
|
retrieveEditTextInputConnection(it) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.keyboard.keyboardListener = this |
|
|
|
this.keyboard.keyboardListener = this |
|
|
|
@ -127,6 +140,7 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDataSource, RowRepr |
|
|
|
holder?.let { |
|
|
|
holder?.let { |
|
|
|
this.inputConnection = it.itemView.findViewById<EditText>(R.id.amountEditText) |
|
|
|
this.inputConnection = it.itemView.findViewById<EditText>(R.id.amountEditText) |
|
|
|
.onCreateInputConnection(EditorInfo()) |
|
|
|
.onCreateInputConnection(EditorInfo()) |
|
|
|
|
|
|
|
Timber.d("***** inputConnection = $inputConnection") |
|
|
|
} ?: run { |
|
|
|
} ?: run { |
|
|
|
Timber.d("no holder, or not RowHandAction") |
|
|
|
Timber.d("no holder, or not RowHandAction") |
|
|
|
} |
|
|
|
} |
|
|
|
@ -284,7 +298,6 @@ class HandHistoryFragment : RealmFragment(), RowRepresentableDataSource, RowRepr |
|
|
|
} |
|
|
|
} |
|
|
|
else -> { it.commitText(key.value, 1) } |
|
|
|
else -> { it.commitText(key.value, 1) } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|