use of com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator in project easy by MehdiBenmesa.
the class RendezVousStatesFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ButterKnife.bind(this, view);
if (GRID_LAYOUT) {
mRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 2));
} else {
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
}
mRecyclerView.setHasFixedSize(true);
//Use this now
mRecyclerView.addItemDecoration(new MaterialViewPagerHeaderDecorator());
try {
if (user.getString("_type").equals("Student")) {
mRecyclerView.setAdapter(new RendezVousStatesAdapter(user, (RendezVousStatesAdapter.AdapterInterface) this));
} else {
mRecyclerView.setAdapter(new RendezVousStatesAdapter(user, (RendezVousStatesAdapter.AdapterInterface) this));
}
} catch (JSONException e) {
e.printStackTrace();
}
}
use of com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator in project easy by MehdiBenmesa.
the class TimeTableFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ButterKnife.bind(this, view);
if (GRID_LAYOUT) {
mRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 2));
} else {
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
}
mRecyclerView.setHasFixedSize(true);
//Use this now
mRecyclerView.addItemDecoration(new MaterialViewPagerHeaderDecorator());
try {
if (user.getString("_type").equals("Student")) {
mRecyclerView.setAdapter(new TimeTableStudentAdapter(user));
} else if (user.getString("_type").equals("Manager")) {
mRecyclerView.setAdapter(new TimeTableManagerAdapter(user));
} else {
mRecyclerView.setAdapter(new TimeTableTeacherAdapter(user));
}
} catch (JSONException e) {
e.printStackTrace();
}
}
use of com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator in project easy by MehdiBenmesa.
the class RendeVousFragment method getTeachersSearcheed.
private void getTeachersSearcheed(final String newTextS) {
CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_TEACHERS, null, new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
JSONArray teachers = response;
if (GRID_LAYOUT) {
lstView.setLayoutManager(new GridLayoutManager(getActivity(), 2));
} else {
lstView.setLayoutManager(new LinearLayoutManager(getActivity()));
}
lstView.setHasFixedSize(true);
//Use this now
lstView.addItemDecoration(new MaterialViewPagerHeaderDecorator());
//Search action
JSONArray lstFound = new JSONArray();
JSONObject item = null;
for (int i = 0; i < teachers.length(); i++) {
try {
item = teachers.getJSONObject(i);
} catch (JSONException e) {
e.printStackTrace();
}
try {
if (item.getString("name").contains(newTextS) || item.getString("lastname").contains(newTextS)) {
lstFound.put(item);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
/*ArrayAdapter adapter = new ArrayAdapter(RendeVous.this, android.R.layout.simple_list_item_1, lstFound);
lstView.setAdapter(adapter);*/
//lstView.setAdapter(new TeachersAdapter(lstFound));
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
App.getInstance().addToRequestQueue(jsonReq);
}
use of com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator in project easy by MehdiBenmesa.
the class RendezVousFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mReceiver = new DataReceiver(new Handler());
mReceiver.setReceiver(this);
ButterKnife.bind(this, view);
if (GRID_LAYOUT) {
recyclerViewRendeVous.setLayoutManager(new GridLayoutManager(getActivity(), 2));
} else {
recyclerViewRendeVous.setLayoutManager(new LinearLayoutManager(getActivity()));
}
recyclerViewRendeVous.setHasFixedSize(true);
//Use this now
recyclerViewRendeVous.addItemDecoration(new MaterialViewPagerHeaderDecorator());
try {
if (user.getString("_type").equals("Teacher")) {
//Toast.makeText(getContext() , "Hi Teacher" , Toast.LENGTH_LONG).show();
RendezVousService.getRendezVousByTeacher(getContext(), mReceiver, rdvState);
} else if (user.getString("_type").equals("Manager")) {
//Toast.makeText(getContext() , "Hi Manager" , Toast.LENGTH_LONG).show();
RendezVousService.getRendezvousByManager(getContext(), mReceiver);
} else if (user.getString("_type").equals("Student")) {
//Toast.makeText(getContext() , "Hi Student" , Toast.LENGTH_LONG).show();
RendezVousService.getRendeVousByStudent(getContext(), mReceiver, rdvState);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
use of com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator in project easy by MehdiBenmesa.
the class NoteFragment method getNoteByStudent.
public void getNoteByStudent() {
try {
System.out.println("AVANT ABSENCE 2 ");
CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_NOTE_BY_MODULES + "/" + user.getString("_id") + "/" + moduleID, null, new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
if (GRID_LAYOUT) {
mRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 2));
} else {
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
}
mRecyclerView.setHasFixedSize(true);
//Use this now
mRecyclerView.addItemDecoration(new MaterialViewPagerHeaderDecorator());
mRecyclerView.setAdapter(new NoteAdapter(response));
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
App.getInstance().addToRequestQueue(jsonReq);
} catch (JSONException e) {
e.printStackTrace();
}
}
Aggregations