Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void switchIcon(MenuItem item) {
- layoutManager = recyclerView.getLayoutManager();
- if (gitHubListAdapter.isSwitchView) {
- recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
- gitHubListAdapter.isSwitchView = true;
- item.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_span_1, null));
- } else {
- recyclerView.setLayoutManager(new GridLayoutManager(getContext(), 2));
- gitHubListAdapter.isSwitchView = false;
- item.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_span_3, null));
- }
- gitHubListAdapter.notifyDataSetChanged();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement