Skip to content

Commit 709601d

Browse files
committed
Added context reference to DSL viewholders
1 parent cd50aef commit 709601d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

kotlin-dsl-layoutcontainer/src/main/java/com/hannesdorfmann/adapterdelegates4/dsl/LayoutContainerListAdapterDelegateDsl.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ class AdapterDelegateLayoutContainerViewHolder<T>(
135135
_item as T
136136
}
137137

138+
/**
139+
* Get the context.
140+
*/
141+
val context = containerView.context
142+
138143
/**
139144
* This should never be called directly.
140145
* Use [bind] instead which internally sets this field.

kotlin-dsl/src/main/java/com/hannesdorfmann/adapterdelegates4/dsl/ListAdapterDelegateDsl.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ class AdapterDelegateViewHolder<T>(view: View) : RecyclerView.ViewHolder(view) {
131131
_item as T
132132
}
133133

134+
/**
135+
* Get the context.
136+
*/
137+
val context = view.context
138+
134139
/**
135140
* This should never be called directly.
136141
* Use [bind] instead which internally sets this field.

0 commit comments

Comments
 (0)