Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RecyclerView topList = (RecyclerView) findViewById(R.id.TopList);
- RecyclerView midList = (RecyclerView) findViewById(R.id.MidList);
- RecyclerView botList = (RecyclerView) findViewById(R.id.BotList);
- LinearLayoutManager topManager = new LinearLayoutManager(this);
- LinearLayoutManager midManager = new LinearLayoutManager(this);
- LinearLayoutManager botManager = new LinearLayoutManager(this);
- ImageAdapter topAdapter = new ImageAdapter(createList(1));
- topList.setAdapter(topAdapter);
- ImageAdapter midAdapter = new ImageAdapter(createList(1));
- midList.setAdapter(midAdapter);
- ImageAdapter botAdapter = new ImageAdapter(createList(1));
- botList.setAdapter(botAdapter);
- topManager.setOrientation(LinearLayoutManager.HORIZONTAL);
- midManager.setOrientation(LinearLayoutManager.HORIZONTAL);
- botManager.setOrientation(LinearLayoutManager.HORIZONTAL);
- topList.setHasFixedSize(true);
- midList.setHasFixedSize(true);
- botList.setHasFixedSize(true);
- topList.setLayoutManager(topManager);
- midList.setLayoutManager(midManager);
- botList.setLayoutManager(botManager);
- }
- private List createList(int size) {
- List result = new ArrayList();
- int num = getResources().getIdentifier("tshirt.png" , "drawable", getPackageName());
- ImageClass img = new ImageClass(num);
- result.add(img);
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement