Skip to content

Commit 4750c61

Browse files
finalizing
1 parent b07ae98 commit 4750c61

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

core/app/src/main/java/com/itsaky/androidide/adapters/MainActionsListAdapter.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,21 @@ constructor(val actions: List<MainScreenAction> = emptyList()) :
4040

4141
fun getAction(index: Int) = actions[index]
4242

43-
override fun onBindViewHolder(holder: VH, position: Int) {
43+
override fun onBindViewHolder(holder: VH, position: Int) {
4444
val action = getAction(index = position)
4545
val binding = holder.binding
4646

47-
binding.root.apply {
48-
setText(action.text)
49-
setIconResource(action.icon)
50-
setOnClickListener {
51-
action.onClick?.invoke(action, it)
52-
}
53-
action.onLongClick?.let { onLongClick ->
54-
setOnLongClickListener {
55-
onLongClick(action, it)
47+
binding.actionButton.apply {
48+
setText(action.text)
49+
setIconResource(action.icon)
50+
setOnClickListener {
51+
action.onClick?.invoke(action, it)
52+
}
53+
action.onLongClick?.let { onLongClick ->
54+
setOnLongClickListener {
55+
onLongClick(action, it)
56+
}
5657
}
57-
}
5858
}
59-
}
59+
}
6060
}

core/app/src/main/res/layout/layout_main_action_item.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
android:layout_height="56dp"
3535
android:elevation="0dp"
3636
android:ellipsize="end"
37+
android:id="@+id/actionButton"
3738
android:singleLine="true"
3839
android:textAlignment="textStart"
3940
android:textColor="?attr/colorOnBackground"

0 commit comments

Comments
 (0)