When attempting to use Kotlin Extensions within a RecyclerView.Adapter to refer to Views in an XML layout file, Intellij cannot recognize the Views by their IDs, even with seemingly correct imports. The odd thing about this is that it will work inside of an Activity or Fragment. Is there additional context needed for this to work in a RecyclerView.Adapter?
Intellisense not picking up Views in a RecyclerView.Adapter implementation:
View was found with practically the same imports
And here is my XML, just in case
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
>
<LinearLayout
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/tv_list_repo_name"
android:text="@string/repo_name"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tv_item_repo_description"
android:text="@string/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center_vertical">
<TextView
android:id="@+id/tv_item_forks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/ic_fork"
android:text="10"
android:gravity="end"/>
<TextView
android:id="@+id/tv_item_stars"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/ic_star"
android:gravity="end"
android:text="14,000"
/>
</LinearLayout>
</LinearLayout>