Fixes issue where actions were not displayed

split
Laurent 5 years ago
parent 24724ce64b
commit b3694c737b
  1. 13
      app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/views/KeyboardActionView.kt
  2. 6
      app/src/main/res/layout/view_hand_keyboard_action.xml

@ -26,15 +26,18 @@ class KeyboardActionView(context: Context) : AbstractKeyboardView(context),
private var availableActions: Set<Action.Type> = setOf() private var availableActions: Set<Action.Type> = setOf()
private var recyclerView: RecyclerView private var actionRecyclerView: RecyclerView
private var positionRecyclerView: RecyclerView
private var closeButton: ImageButton private var closeButton: ImageButton
init { init {
val view = LayoutInflater.from(context) val view = LayoutInflater.from(context)
.inflate(R.layout.view_hand_keyboard_action, this, true) .inflate(R.layout.view_hand_keyboard_action, this, true)
this.recyclerView = view.findViewById<RecyclerView>(R.id.recyclerView) this.actionRecyclerView = view.findViewById(R.id.action_recycler)
this.closeButton = view.findViewById<ImageButton>(R.id.closeButton) this.positionRecyclerView = view.findViewById(R.id.position_recycler)
this.closeButton = view.findViewById(R.id.closeButton)
// Action recycler // Action recycler
val spanCount = 3 val spanCount = 3
@ -44,7 +47,7 @@ class KeyboardActionView(context: Context) : AbstractKeyboardView(context),
val spacing = 2.px val spacing = 2.px
val includeEdge = false val includeEdge = false
recyclerView.apply { actionRecyclerView.apply {
setHasFixedSize(true) setHasFixedSize(true)
layoutManager = viewManager layoutManager = viewManager
adapter = dataAdapter adapter = dataAdapter
@ -65,7 +68,7 @@ class KeyboardActionView(context: Context) : AbstractKeyboardView(context),
this.positionAdapter = PositionAdapter(it) this.positionAdapter = PositionAdapter(it)
} ?: throw PAIllegalStateException("keyboard listener not set") } ?: throw PAIllegalStateException("keyboard listener not set")
recyclerView.apply { this.positionRecyclerView.apply {
setHasFixedSize(true) setHasFixedSize(true)
layoutManager = positionViewManager layoutManager = positionViewManager
adapter = positionAdapter adapter = positionAdapter

@ -33,7 +33,7 @@
</LinearLayout> </LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler" android:id="@+id/position_recycler"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="44dp" android:layout_height="44dp"
android:layout_weight="1" android:layout_weight="1"
@ -43,10 +43,10 @@
/> />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView" android:id="@+id/action_recycler"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/recycler" app:layout_constraintTop_toBottomOf="@id/position_recycler"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"

Loading…
Cancel
Save