Example for anvil 0.4+ with RecyclerView
rubiktubik opened this issue · 2 comments
rubiktubik commented
I'am try to use the 0.4.0 version of the anvil library with the recycler view.
Which was promoted on link
And i have problems to get it to work properly. Because i get errors from Android Studio.
I created a class which represents my layout:
public class TimerLayout extends RenderableView
Then in the view method i use the anvil DSL.
public void view() {
linearLayout(() -> {
orientation(LinearLayout.VERTICAL);
textView(() -> {
size(MATCH, WRAP);
text("Hello");
});
...
Everythings works fine until i try to use the recyclerView:
recyclerView(() -> {
linearLayoutManager();
adapter(recycleAdapter);
});
Then i get the following error:
In gradle i imported the following dependencies:
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:cardview-v7:23.0.+'
compile 'com.android.support:recyclerview-v7:23.0.+'
compile 'com.github.trikita:jedux:-SNAPSHOT'
compile 'co.trikita:anvil-sdk15:0.4.0'
compile 'co.trikita:anvil-support-v4:0.4.0'
compile 'co.trikita:anvil-recyclerview-v7:0.4.0'
compile 'co.trikita:anvil-cardview-v7:0.4.0'
compile 'co.trikita:anvil-appcompat-v7:0.4.0'
compile 'co.trikita:anvil-design:0.4.0'
Do i do something wrong?
I could not find any tutorial or example for the 0.4.0 features
Thanks in advance!
amoikevin commented
use this:
import static trikita.anvil.recyclerview.v7.RecyclerViewv7DSL.linearLayoutManager;
rubiktubik commented
Thank you!