I'm using a custom view, com.deadballapp.deadball.ui.pitch.PitchLiveView, but my binding class is unable to access this view. The binding class is able to access cl_pitch_live
PitchLiveView isn't inflated, it's a class that extends View which I'm using to draw to the Canvas so any solution to binding to a custom view I've seen here, here and here don't seem to apply
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/cl_pitch_live"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/pitch_green">
<view
android:id="@+id/view_pitch_live"
class="com.deadballapp.deadball.ui.pitch.PitchLiveView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/nav_header_vertical_spacing"
android:layout_marginBottom="@dimen/btm_sheet_peek_height" />
<include layout="@layout/bottom_sheet_pitch_live"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
Any ideas?
This is the alternate method to define custom view in layout xml.
<com.deadballapp.deadball.ui.pitch.PitchLiveView
android:id="@+id/view_pitch_live"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/nav_header_vertical_spacing"
android:layout_marginBottom="@dimen/btm_sheet_peek_height" />
You can bind this as other views, either by using View Binding or findViewById