title: Set layout_margin using databinding
body: <p>I use data building in my application and I'm new to this.
  I can't change the layout_marginLeft code.
  I have seen many examples but they do not work for me.
  Here is my code in the model.</p>
  <pre><code>@BindingAdapter(&quot;android:layout_marginLeft&quot;)
  public static void setLayoutMarginLeft(View view, float marginLeft) {
      if (view.getLayoutParams() instanceof ViewGroup.MarginLayoutParams) {
          ViewGroup.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
          p.setMargins((int) marginLeft, p.topMargin, p.rightMargin, p.bottomMargin);
          view.requestLayout();
      }
  }
  </code></pre>
  <p>xml file</p>
  <pre><code>&lt;data&gt;
      &lt;import type=&quot;android.view.View&quot; /&gt;
      &lt;variable
          name=&quot;viewModel&quot;
          type=&quot;com.aofled.test.window.activity.sleep.SleepActivityViewModel&quot; /&gt;
  &lt;/data&gt;
  
  &lt;TextView
              android:id=&quot;@+id/tv_sleep&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:text=&quot;Tap to screen.....&quot;
              android:textColor=&quot;@color/selector_inactive&quot;
              android:textSize=&quot;48sp&quot;
              android:layout_marginLeft=&quot;@{viewModel.layout_marginLeft}&quot;
              /&gt;
  </code></pre>
  <p>I cannot build the project. I wrote:</p>
  <pre><code>****/ data binding error ****msg:Could not find accessor com.aofled.test.window.activity.sleep.SleepActivityViewModel.layout_marginLeft file:C:\!work\kohote_ch_android 4\kohotehc_android\client\src\main\res\layout\activity_sleep.xml loc:26:45 - 26:71 ****\ data binding error ****
  </code></pre>
  <p>What should I change to make it work?</p>