Created
December 27, 2016 17:19
-
-
Save budioktaviyan/6c0f7d34ad4150b8ea0aeb6334d8253d to your computer and use it in GitHub Desktop.
Home Fragment Class (Cont'd)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HomeFragment extends Fragment { | |
@Override | |
public void onActivityCreated(@Nullable final Bundle savedInstanceState) { | |
super.onActivityCreated(savedInstanceState); | |
final RecyclerView recyclerView = (RecyclerView) getActivity().findViewById(R.id.rv_home); | |
final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext()); | |
final HomeAdapter homeAdapter = new HomeAdapter(items); | |
recyclerView.setLayoutManager(linearLayoutManager); | |
recyclerView.smoothScrollToPosition(recyclerView.getBottom()); | |
recyclerView.setAdapter(homeAdapter); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment