Skip to content

Commit cc52684

Browse files
Merge pull request #8 from pavankuppa1/master
Erased conflicts with package and added dependencies
2 parents 9db8451 + 1328642 commit cc52684

24 files changed

+712
-10
lines changed

app/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
apply plugin: 'com.android.application'
23

34
android {
@@ -25,4 +26,8 @@ dependencies {
2526
testImplementation 'junit:junit:4.12'
2627
androidTestImplementation 'com.android.support.test:runner:0.5'
2728
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
29+
implementation 'com.android.support:cardview-v7:26.1.0'
30+
implementation 'com.android.support:design:26.1.0'
31+
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
32+
implementation 'com.android.support:recyclerview-v7:26.1.0'
2833
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.example.dhananjay.dailygoals;
2+
3+
/**
4+
* Created by kmurali on 13-04-2018.
5+
*/
6+
7+
public class Items {
8+
private String text;
9+
public Items(String text)
10+
{
11+
this.text=text;
12+
}
13+
public String getText() {
14+
return text;
15+
}
16+
17+
public void setText(String text) {
18+
this.text = text;
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.example.dhananjay.dailygoals;
2+
3+
/**
4+
* Created by kmurali on 13-04-2018.
5+
*/
6+
7+
public class Items1 {
8+
private String text;
9+
public Items1(String text)
10+
{
11+
this.text=text;
12+
}
13+
public String getText() {
14+
return text;
15+
}
16+
17+
public void setText(String text) {
18+
this.text = text;
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.example.dhananjay.dailygoals;
2+
3+
/**
4+
* Created by kmurali on 13-04-2018.
5+
*/
6+
7+
public class Items2 {
8+
private int image2;
9+
public Items2(int image2)
10+
{
11+
this.image2=image2;
12+
}
13+
public int getImage() {
14+
return image2;
15+
}
16+
17+
public void setImage(int image2) {
18+
this.image2 = image2;
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.example.dhananjay.dailygoals;
2+
3+
/**
4+
* Created by kmurali on 13-04-2018.
5+
*/
6+
7+
public class Items3 {
8+
private int image3;
9+
public Items3(int image3)
10+
{
11+
this.image3=image3;
12+
}
13+
public int getImage() {
14+
return image3;
15+
}
16+
17+
public void setImage(int image3) {
18+
this.image3 = image3;
19+
}
20+
}

app/src/main/java/com/example/dhananjay/dailygoals/MainActivity.java

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,65 @@
22

33
import android.support.v7.app.AppCompatActivity;
44
import android.os.Bundle;
5+
import android.support.v7.widget.LinearLayoutManager;
6+
import android.support.v7.widget.RecyclerView;
7+
8+
import java.util.ArrayList;
59

610
public class MainActivity extends AppCompatActivity {
711

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+
821
@Override
922
protected void onCreate(Bundle savedInstanceState) {
1023
super.onCreate(savedInstanceState);
1124
setContentView(R.layout.activity_main);
25+
recyclerView=(RecyclerView)findViewById(R.id.recyclerView);
26+
recyclerView1=(RecyclerView)findViewById(R.id.recyclerView1);
27+
recyclerView2=(RecyclerView)findViewById(R.id.recyclerView2);
28+
recyclerView3=(RecyclerView)findViewById(R.id.recyclerView3);
29+
itemList=new ArrayList<>();
30+
item1List=new ArrayList<>();
31+
item2List=new ArrayList<>();
32+
item3List=new ArrayList<>();
33+
itemList.add(new Items("TODAY"));
34+
itemList.add(new Items("TOMORROW"));
35+
itemList.add(new Items("NEXT DAY"));
36+
item1List.add(new Items1("BREAKFAST"+"\n"+"8:00"));
37+
item1List.add(new Items1("STUDY"+"\n"+"9:00"));
38+
item1List.add(new Items1("LUNCH"+"\n"+"12:00"));
39+
item1List.add(new Items1("STUDY"+"\n"+"3:00"));
40+
item1List.add(new Items1("GAMES"+"\n"+"6:00"));
41+
item1List.add(new Items1("DINNER"+"\n"+"9:00"));
42+
item2List.add(new Items2(R.drawable.tick));
43+
item2List.add(new Items2(R.drawable.wrong));
44+
item3List.add(new Items3(R.drawable.achievements));
45+
LinearLayoutManager layoutmanager=new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false);
46+
RecyclerView.LayoutManager rvlayoutmanager=layoutmanager;
47+
recyclerView.setLayoutManager(rvlayoutmanager);
48+
TextAdapter adapter=new TextAdapter(this,itemList);
49+
recyclerView.setAdapter(adapter);
50+
LinearLayoutManager layoutmanager1=new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false);
51+
RecyclerView.LayoutManager rvlayoutmanager1=layoutmanager1;
52+
recyclerView1.setLayoutManager(rvlayoutmanager1);
53+
TextAdapter1 adapter1=new TextAdapter1(this,item1List);
54+
recyclerView1.setAdapter(adapter1);
55+
LinearLayoutManager layoutmanager2=new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false);
56+
RecyclerView.LayoutManager rvlayoutmanager2=layoutmanager2;
57+
recyclerView2.setLayoutManager(rvlayoutmanager2);
58+
TextAdapter2 adapter2=new TextAdapter2(this,item2List);
59+
recyclerView2.setAdapter(adapter2);
60+
LinearLayoutManager layoutmanager3=new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false);
61+
RecyclerView.LayoutManager rvlayoutmanager3=layoutmanager3;
62+
recyclerView3.setLayoutManager(rvlayoutmanager3);
63+
TextAdapter3 adapter3=new TextAdapter3(this,item3List);
64+
recyclerView3.setAdapter(adapter3);
1265
}
1366
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
package com.example.dhananjay.dailygoals;
2+
3+
/**
4+
* Created by kmurali on 13-04-2018.
5+
*/
6+
7+
import android.content.Context;
8+
import android.support.v7.widget.RecyclerView;
9+
import android.view.LayoutInflater;
10+
import android.view.View;
11+
import android.view.ViewGroup;
12+
import android.widget.ImageView;
13+
import android.widget.TextView;
14+
15+
import java.util.ArrayList;
16+
17+
/**
18+
* Created by kmurali on 11-04-2018.
19+
*/
20+
21+
public class TextAdapter extends RecyclerView.Adapter<TextAdapter.ViewHolder> {
22+
23+
private Context mcontext;
24+
private ArrayList<Items> itemList;
25+
26+
27+
TextAdapter(Context context,ArrayList<Items> list){
28+
mcontext=context;
29+
itemList=list;
30+
31+
}
32+
@Override
33+
public ViewHolder onCreateViewHolder(ViewGroup parent,int ViewType){
34+
35+
LayoutInflater layoutInflater=LayoutInflater.from(mcontext);
36+
View view=layoutInflater.inflate(R.layout.items,parent,false);
37+
ViewHolder viewHolder=new ViewHolder(view);
38+
return viewHolder;
39+
40+
}
41+
42+
@Override
43+
public void onBindViewHolder(ViewHolder holder, int position) {
44+
45+
Items item=itemList.get(position);
46+
TextView text=holder.text;
47+
text.setText(item.getText());
48+
49+
50+
51+
}
52+
53+
54+
55+
@Override
56+
public int getItemCount() {
57+
return itemList.size();
58+
}
59+
public class ViewHolder extends RecyclerView.ViewHolder{
60+
61+
TextView text;
62+
63+
public ViewHolder(View itemView){
64+
super(itemView);
65+
text=itemView.findViewById(R.id.text);
66+
67+
68+
}
69+
}
70+
}
71+
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
package com.example.dhananjay.dailygoals;
2+
3+
/**
4+
* Created by kmurali on 13-04-2018.
5+
*/
6+
7+
import android.content.Context;
8+
import android.support.v7.widget.RecyclerView;
9+
import android.view.LayoutInflater;
10+
import android.view.View;
11+
import android.view.ViewGroup;
12+
import android.widget.ImageView;
13+
import android.widget.TextView;
14+
15+
import java.util.ArrayList;
16+
17+
/**
18+
* Created by kmurali on 11-04-2018.
19+
*/
20+
21+
public class TextAdapter1 extends RecyclerView.Adapter<TextAdapter1.ViewHolder> {
22+
23+
private Context mcontext;
24+
private ArrayList<Items1> item1List;
25+
26+
27+
TextAdapter1(Context context,ArrayList<Items1> list){
28+
mcontext=context;
29+
item1List=list;
30+
31+
}
32+
@Override
33+
public ViewHolder onCreateViewHolder(ViewGroup parent,int ViewType){
34+
35+
LayoutInflater layoutInflater=LayoutInflater.from(mcontext);
36+
View view=layoutInflater.inflate(R.layout.items1,parent,false);
37+
ViewHolder viewHolder=new ViewHolder(view);
38+
return viewHolder;
39+
40+
}
41+
42+
@Override
43+
public void onBindViewHolder(ViewHolder holder, int position) {
44+
45+
Items1 item=item1List.get(position);
46+
TextView text=holder.text1;
47+
text.setText(item.getText());
48+
49+
50+
51+
}
52+
53+
54+
55+
@Override
56+
public int getItemCount() {
57+
return item1List.size();
58+
}
59+
public class ViewHolder extends RecyclerView.ViewHolder{
60+
61+
TextView text1;
62+
63+
public ViewHolder(View itemView){
64+
super(itemView);
65+
text1=itemView.findViewById(R.id.text1);
66+
67+
68+
}
69+
}
70+
}
71+
72+
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package com.example.dhananjay.dailygoals;
2+
3+
/**
4+
* Created by kmurali on 13-04-2018.
5+
*/
6+
7+
import android.support.v7.widget.RecyclerView;
8+
import android.widget.TextView;
9+
10+
import android.content.Context;
11+
import android.support.v7.widget.RecyclerView;
12+
import android.view.LayoutInflater;
13+
import android.view.View;
14+
import android.view.ViewGroup;
15+
import android.widget.ImageView;
16+
import android.widget.TextView;
17+
18+
import java.util.ArrayList;
19+
20+
/**
21+
* Created by kmurali on 11-04-2018.
22+
*/
23+
24+
public class TextAdapter2 extends RecyclerView.Adapter<TextAdapter2.ViewHolder> {
25+
26+
private Context mcontext;
27+
private ArrayList<Items2> item2List;
28+
29+
30+
TextAdapter2(Context context,ArrayList<Items2> list){
31+
mcontext=context;
32+
item2List=list;
33+
34+
}
35+
@Override
36+
public ViewHolder onCreateViewHolder(ViewGroup parent,int ViewType){
37+
38+
LayoutInflater layoutInflater=LayoutInflater.from(mcontext);
39+
View view=layoutInflater.inflate(R.layout.items2,parent,false);
40+
ViewHolder viewHolder=new ViewHolder(view);
41+
return viewHolder;
42+
43+
}
44+
45+
@Override
46+
public void onBindViewHolder(ViewHolder holder, int position) {
47+
48+
Items2 item=item2List.get(position);
49+
ImageView image2=holder.image2;
50+
image2.setImageResource(item.getImage());
51+
52+
53+
54+
}
55+
56+
57+
58+
@Override
59+
public int getItemCount() {
60+
return item2List.size();
61+
}
62+
public class ViewHolder extends RecyclerView.ViewHolder{
63+
64+
ImageView image2;
65+
66+
public ViewHolder(View itemView){
67+
super(itemView);
68+
image2=itemView.findViewById(R.id.image2);
69+
70+
71+
}
72+
}
73+
}
74+
75+
76+

0 commit comments

Comments
 (0)