|
|
|
|
@ -26,15 +26,18 @@ class KeyboardActionView(context: Context) : AbstractKeyboardView(context), |
|
|
|
|
|
|
|
|
|
private var availableActions: Set<Action.Type> = 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<RecyclerView>(R.id.recyclerView) |
|
|
|
|
this.closeButton = view.findViewById<ImageButton>(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 |
|
|
|
|
|