-
Notifications
You must be signed in to change notification settings - Fork 0
/
EventFrag.java
139 lines (107 loc) · 4.17 KB
/
EventFrag.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
package com.example.elvin.projectapp1;
import android.app.Fragment;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.CardView;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* Created by Elvin on 11/30/2016.
*/
public class EventFrag extends Fragment{
public static CardView cvFilter;
public static EditText searchG;
public static CheckBox chkAcaG;
public static CheckBox chkFestG;
public static CheckBox chkSportG;
public static CheckBox chkOtherG;
public static CardView cv1G;
public static CardView cv2G;
public static CardView cv3G;
public static CardView cv4G;
public static CardView cv5G;
@RequiresApi(api = Build.VERSION_CODES.M)
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// RecyclerView rv = (RecyclerView) getView().findViewById(R.id.rv);
// LinearLayoutManager llm = new LinearLayoutManager(getContext());
//rv.setLayoutManager(llm);
return inflater.inflate(R.layout.eventfraglayout, container, false);
}
/////
class Event {
String title;
String location;
String time;
int photoId;
Event(int photoID, String title, String location, String time) {
this.photoId = photoID;
this.title = title;
this.location = location;
this.time = time;
}
}
private List<Event> events;
private void initializeData(){
events = new ArrayList<>();
events.add(new Event(R.drawable.muinfoheader, "Symposium", "Hendricks", "April 3rd, 2016"));
}
public class RVAdapter extends RecyclerView.Adapter<RVAdapter.PersonViewHolder>{
@Override
public PersonViewHolder onCreateViewHolder(ViewGroup container, int viewType) {
View v = LayoutInflater.from(container.getContext()).inflate(R.layout.eventfraglayout, container, false);
PersonViewHolder pvh = new PersonViewHolder(v);
return pvh;
}
@Override
public void onBindViewHolder(PersonViewHolder holder, int position) {
personViewHolder.personName.setText(events.get(i).name);
personViewHolder.personAge.setText(events.get(i).age);
personViewHolder.personPhoto.setImageResource(events.get(i).photoId);
}
@Override
public int getItemCount() {
return events.size();
}
public static class PersonViewHolder extends RecyclerView.ViewHolder {
CardView cv;
ImageView eventPhoto;
TextView eventTitle;
TextView eventLocation;
TextView eventTime;
PersonViewHolder(View itemView) {
super(itemView);
cv = (CardView)itemView.findViewById(R.id.cv);
eventPhoto = (ImageView)itemView.findViewById(R.id.event_photo);
eventTitle = (TextView)itemView.findViewById(R.id.event_title);
eventLocation = (TextView)itemView.findViewById(R.id.event_location);
eventTime = (TextView)itemView.findViewById(R.id.event_time);
}
}
List<Event> events;
RVAdapter(List<Event> events){
this.events = events;
}
@Override
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
super.onAttachedToRecyclerView(recyclerView);
}
}
*/
}