position of ViewPager item with Data Binding

后端 未结 3 645
广开言路
广开言路 2021-01-13 11:56

I have implemented ViewPager with use of android Data Binding, it is working perfect with data and click events.

I have created interface f

3条回答
  •  臣服心动
    2021-01-13 12:29

    You can pass parameters in the lambda expression, like this:

    android:onClick="@{() -> handler.onItemClick(rootItemView.getTag().toString())}" 
    

    And of course you'll need to edit your interface method and its implementations:

    public void onItemClick(String data);
    

提交回复
热议问题