|
|
|
|
@ -14,8 +14,10 @@ import com.google.android.material.chip.Chip |
|
|
|
|
import kotlinx.android.synthetic.main.row_hand_action.view.* |
|
|
|
|
import kotlinx.android.synthetic.main.row_hhsettings_blinds.view.* |
|
|
|
|
import kotlinx.android.synthetic.main.row_hhsettings_player_setup.view.* |
|
|
|
|
import kotlinx.android.synthetic.main.row_hhsettings_straddle.view.* |
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
import net.pokeranalytics.android.exceptions.PAIllegalStateException |
|
|
|
|
import net.pokeranalytics.android.model.handhistory.Position |
|
|
|
|
import net.pokeranalytics.android.model.handhistory.Street |
|
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.HandHistory |
|
|
|
|
import net.pokeranalytics.android.model.realm.handhistory.formatted |
|
|
|
|
@ -25,15 +27,15 @@ import net.pokeranalytics.android.ui.adapter.RowRepresentableDataSource |
|
|
|
|
import net.pokeranalytics.android.ui.adapter.RowRepresentableDelegate |
|
|
|
|
import net.pokeranalytics.android.ui.extensions.px |
|
|
|
|
import net.pokeranalytics.android.ui.fragment.components.bottomsheet.BottomSheetType |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.model.ComputedAction |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.model.HHKeyboard |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.model.HandHistoryRow |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.model.StraddleRowRepresentable |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.model.* |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.views.PlayerCardsRow |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.views.PositionAdapter |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.views.PositionSelectionListener |
|
|
|
|
import net.pokeranalytics.android.ui.modules.handhistory.views.StreetCardsRow |
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -518,15 +520,46 @@ class HandHistoryAdapter( |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inner class RowHandPlayerSetup(itemView: View) : RowHandHolder(itemView) { |
|
|
|
|
inner class RowHandPlayerSetup(itemView: View) : RowHandHolder(itemView), PositionSelectionListener { |
|
|
|
|
|
|
|
|
|
private var positionAdapter: PositionAdapter = PositionAdapter(this) |
|
|
|
|
|
|
|
|
|
init { |
|
|
|
|
|
|
|
|
|
// TODO configure recycler view |
|
|
|
|
|
|
|
|
|
// itemView.positionRecyclerView |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun onBind(position: Int, row: RowRepresentable, adapter: RecyclerAdapter) { |
|
|
|
|
super.onBind(position, row, adapter) |
|
|
|
|
|
|
|
|
|
// itemView.positionsChipGroup |
|
|
|
|
val setup = row as PlayerSetupRowRepresentable |
|
|
|
|
val state = setup.state |
|
|
|
|
|
|
|
|
|
itemView.title.text = setup.title(itemView.context) |
|
|
|
|
|
|
|
|
|
val visibility = if (state == PlayerSetupRowRepresentable.State.SHOW_POSITION) View.VISIBLE else View.GONE |
|
|
|
|
itemView.positionRecyclerView.visibility = visibility |
|
|
|
|
|
|
|
|
|
itemView.posButton.text = setup.position?.value |
|
|
|
|
|
|
|
|
|
itemView.settings_container.visibility = if (state == PlayerSetupRowRepresentable.State.POSITION_ONLY) View.GONE else View.VISIBLE |
|
|
|
|
|
|
|
|
|
itemView.handEditText.setText(setup.playerSetup?.cards?.formatted(itemView.context)) |
|
|
|
|
itemView.stackEditText.setText(setup.playerSetup?.stack?.formatted()) |
|
|
|
|
|
|
|
|
|
this.positionAdapter.positions = listOf() // TODO |
|
|
|
|
|
|
|
|
|
// itemView.handEditText.setText(adapter.dataSource.stringForRow(row, itemView.context, 0)) |
|
|
|
|
// itemView.stackEditText.setText(adapter.dataSource.stringForRow(row, itemView.context, 1)) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun positionSelected(position: Position) { |
|
|
|
|
|
|
|
|
|
itemView.handEditText.setText(adapter.dataSource.stringForRow(row, itemView.context, 0)) |
|
|
|
|
itemView.stackEditText.setText(adapter.dataSource.stringForRow(row, itemView.context, 1)) |
|
|
|
|
// TODO sets position for PlayerSetup |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|