Skip to content

Instantly share code, notes, and snippets.

@aucd29
Last active May 9, 2018 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aucd29/06f28df979cde7fdff3f9db2f32f43bd to your computer and use it in GitHub Desktop.
Save aucd29/06f28df979cde7fdff3f9db2f32f43bd to your computer and use it in GitHub Desktop.
Example BindingAdapter
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<data>
<variable
name="model"
type="net.sarangnamu.test.viewmodel.TestViewModel" />
<variable
name="list"
type="java.util.ArrayList&lt;java.lang.String&gt;"/>
</data>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="250dp"
android:orientation="horizontal"
app:bindList="@{list}"
/>
</layout>
public class TestViewModel extends ViewModel {
@BindingAdapter("bindList")
public static void bindList(LinearLayout layout, ArrayList<String> list) {
// TODO
}
}
@aucd29
Copy link
Author

aucd29 commented May 9, 2018

어노테이션에서 app:bindList 를 쓰면 워닝 발생함

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment