Last active
January 22, 2016 04:57
-
-
Save ColeMurray/5398b304dfa87b0c2ac0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 MainActivityFragment extends Fragment { | |
| private RecyclerView mRecyclerView; | |
| private ArrayList<String> mDataSet = new ArrayList<>(); | |
| public MainActivityFragment() { | |
| } | |
| @Override | |
| public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
| Bundle savedInstanceState) { | |
| View rootView = inflater.inflate(R.layout.fragment_main, container, false); | |
| mRecyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view); | |
| mDataSet = getMockData(); | |
| mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); | |
| mRecyclerView.setAdapter(new ImpressionAdapter(getActivity(), mDataSet)); | |
| return rootView; | |
| } | |
| private ArrayList<String> getMockData() { | |
| ArrayList<String> data = new ArrayList<>(); | |
| for (int i = 0; i < 10; i++) { | |
| String item = "Title " + i; | |
| data.add(item); | |
| } | |
| return data; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment