fastadapter

How to set two adapters to one RecyclerView?

喜你入骨 提交于 2019-12-03 07:34:52
问题 I am developing an android app in which I'm storing two different types of information on 'FirebaseDatabase`. Then in the MainActivity , I'm retrieving them and showing to users in a RecyclerView . Both information are meant to be shown in different layouts, i.e., the layouts for both of them are different and that's why I have two make two different Model class and now have 2 different adapters. I'm using FastAdapter by @MikePenz So, what I did is I set the adapter on recyclerview in the

How to place ads randomly in between of RecyclerView?

我与影子孤独终老i 提交于 2019-12-02 03:14:42
问题 I'm using FastAdapter in my app and I want to place ads randomly in between of RecyclerView . For ex - like an ad after 3 RecyclerView items then after 4, then after 2 and so on and so forth. This is how I'm using FastAdapter: FastItemAdapter<HRequest> fastItemAdapter = new FastItemAdapter<>(); fastItemAdapter.withSelectable(true); RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(linearLayoutManager)