|
1 |
| -package com.example.android.dailygoals; |
| 1 | +package com.example.dhananjay.dailygoals; |
2 | 2 |
|
3 | 3 | import android.support.v7.app.AppCompatActivity;
|
4 | 4 | import android.os.Bundle;
|
5 |
| -import android.support.v7.widget.LinearLayoutManager; |
6 |
| -import android.support.v7.widget.RecyclerView; |
7 |
| - |
8 |
| -import java.util.ArrayList; |
9 | 5 |
|
10 | 6 | public class MainActivity extends AppCompatActivity {
|
11 | 7 |
|
12 |
| - RecyclerView recyclerView; |
13 |
| - RecyclerView recyclerView1; |
14 |
| - RecyclerView recyclerView2; |
15 |
| - RecyclerView recyclerView3; |
16 |
| - ArrayList<Items> itemList; |
17 |
| - ArrayList<Items1> item1List; |
18 |
| - ArrayList<Items2> item2List; |
19 |
| - ArrayList<Items3> item3List; |
20 |
| - |
21 |
| - |
22 |
| - |
23 | 8 | @Override
|
24 | 9 | protected void onCreate(Bundle savedInstanceState) {
|
25 | 10 | super.onCreate(savedInstanceState);
|
26 | 11 | setContentView(R.layout.activity_main);
|
27 |
| - recyclerView=(RecyclerView)findViewById(R.id.recyclerView); |
28 |
| - recyclerView1=(RecyclerView)findViewById(R.id.recyclerView1); |
29 |
| - recyclerView2=(RecyclerView)findViewById(R.id.recyclerView2); |
30 |
| - recyclerView3=(RecyclerView)findViewById(R.id.recyclerView3); |
31 |
| - itemList=new ArrayList<>(); |
32 |
| - item1List=new ArrayList<>(); |
33 |
| - item2List=new ArrayList<>(); |
34 |
| - item3List=new ArrayList<>(); |
35 |
| - itemList.add(new Items("TODAY")); |
36 |
| - itemList.add(new Items("TOMORROW")); |
37 |
| - itemList.add(new Items("NEXT DAY")); |
38 |
| - item1List.add(new Items1("BREAKFAST"+"\n"+"8:00")); |
39 |
| - item1List.add(new Items1("STUDY"+"\n"+"9:00")); |
40 |
| - item1List.add(new Items1("LUNCH"+"\n"+"12:00")); |
41 |
| - item1List.add(new Items1("STUDY"+"\n"+"3:00")); |
42 |
| - item1List.add(new Items1("GAMES"+"\n"+"6:00")); |
43 |
| - item1List.add(new Items1("DINNER"+"\n"+"9:00")); |
44 |
| - item2List.add(new Items2(R.drawable.tick)); |
45 |
| - item2List.add(new Items2(R.drawable.wrong)); |
46 |
| - item3List.add(new Items3(R.drawable.achievements)); |
47 |
| - LinearLayoutManager layoutmanager=new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false); |
48 |
| - RecyclerView.LayoutManager rvlayoutmanager=layoutmanager; |
49 |
| - recyclerView.setLayoutManager(rvlayoutmanager); |
50 |
| - TextAdapter adapter=new TextAdapter(this,itemList); |
51 |
| - recyclerView.setAdapter(adapter); |
52 |
| - LinearLayoutManager layoutmanager1=new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false); |
53 |
| - RecyclerView.LayoutManager rvlayoutmanager1=layoutmanager1; |
54 |
| - recyclerView1.setLayoutManager(rvlayoutmanager1); |
55 |
| - TextAdapter1 adapter1=new TextAdapter1(this,item1List); |
56 |
| - recyclerView1.setAdapter(adapter1); |
57 |
| - LinearLayoutManager layoutmanager2=new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false); |
58 |
| - RecyclerView.LayoutManager rvlayoutmanager2=layoutmanager2; |
59 |
| - recyclerView2.setLayoutManager(rvlayoutmanager2); |
60 |
| - TextAdapter2 adapter2=new TextAdapter2(this,item2List); |
61 |
| - recyclerView2.setAdapter(adapter2); |
62 |
| - LinearLayoutManager layoutmanager3=new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false); |
63 |
| - RecyclerView.LayoutManager rvlayoutmanager3=layoutmanager3; |
64 |
| - recyclerView3.setLayoutManager(rvlayoutmanager3); |
65 |
| - TextAdapter3 adapter3=new TextAdapter3(this,item3List); |
66 |
| - recyclerView3.setAdapter(adapter3); |
67 | 12 | }
|
68 | 13 | }
|
0 commit comments