From b3694c737b6c420c122969914ccb681fa389f976 Mon Sep 17 00:00:00 2001 From: Laurent Date: Fri, 11 Dec 2020 16:42:55 +0100 Subject: [PATCH] Fixes issue where actions were not displayed --- .../modules/handhistory/views/KeyboardActionView.kt | 13 ++++++++----- .../main/res/layout/view_hand_keyboard_action.xml | 6 +++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/views/KeyboardActionView.kt b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/views/KeyboardActionView.kt index 19107c67..6ea9db84 100644 --- a/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/views/KeyboardActionView.kt +++ b/app/src/main/java/net/pokeranalytics/android/ui/modules/handhistory/views/KeyboardActionView.kt @@ -26,15 +26,18 @@ class KeyboardActionView(context: Context) : AbstractKeyboardView(context), private var availableActions: Set = setOf() - private var recyclerView: RecyclerView + private var actionRecyclerView: RecyclerView + private var positionRecyclerView: RecyclerView + private var closeButton: ImageButton init { val view = LayoutInflater.from(context) .inflate(R.layout.view_hand_keyboard_action, this, true) - this.recyclerView = view.findViewById(R.id.recyclerView) - this.closeButton = view.findViewById(R.id.closeButton) + this.actionRecyclerView = view.findViewById(R.id.action_recycler) + this.positionRecyclerView = view.findViewById(R.id.position_recycler) + this.closeButton = view.findViewById(R.id.closeButton) // Action recycler val spanCount = 3 @@ -44,7 +47,7 @@ class KeyboardActionView(context: Context) : AbstractKeyboardView(context), val spacing = 2.px val includeEdge = false - recyclerView.apply { + actionRecyclerView.apply { setHasFixedSize(true) layoutManager = viewManager adapter = dataAdapter @@ -65,7 +68,7 @@ class KeyboardActionView(context: Context) : AbstractKeyboardView(context), this.positionAdapter = PositionAdapter(it) } ?: throw PAIllegalStateException("keyboard listener not set") - recyclerView.apply { + this.positionRecyclerView.apply { setHasFixedSize(true) layoutManager = positionViewManager adapter = positionAdapter diff --git a/app/src/main/res/layout/view_hand_keyboard_action.xml b/app/src/main/res/layout/view_hand_keyboard_action.xml index d0aae17d..d3fd841e 100644 --- a/app/src/main/res/layout/view_hand_keyboard_action.xml +++ b/app/src/main/res/layout/view_hand_keyboard_action.xml @@ -33,7 +33,7 @@