use of com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator in project MaterialViewPager by florent37.
the class RecyclerViewFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ButterKnife.bind(this, view);
final List<Object> items = new ArrayList<>();
for (int i = 0; i < ITEM_COUNT; ++i) {
items.add(new Object());
}
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 TestRecyclerViewAdapter(items));
}
use of com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator in project easy by MehdiBenmesa.
the class RecyclerViewFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ButterKnife.bind(this, view);
final List<Object> items = new ArrayList<>();
for (int i = 0; i < ITEM_COUNT; ++i) {
items.add(new Object());
}
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 TestRecyclerViewAdapter(items));
}
use of com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator in project easy by MehdiBenmesa.
the class RendezVousFragment method getRendeVousByManager.
private void getRendeVousByManager() {
CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_RDV_BY_TEACHER, null, new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
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());
//recyclerViewRendeVous.setAdapter(new TeachersAdapter(response,(TeachersAdapter.AdapterInterface) RendezVousActivity.this));
}
}, 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 ModuleFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ButterKnife.bind(this, view);
mReceiver = new DataReceiver(new Handler());
mReceiver.setReceiver(this);
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("Teacher")) {
ModuleService.getModulesByTeacher(getContext(), mReceiver);
} else if (user.getString("_type").equals("Manager")) {
ModuleService.getTeachers(getContext(), mReceiver);
} else if (user.getString("_type").equals("Student")) {
ModuleService.getModulesByStudent(getContext(), mReceiver);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
use of com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator in project easy by MehdiBenmesa.
the class AbsenceFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ButterKnife.bind(this, view);
mReceiver = new DataReceiver(new Handler());
mReceiver.setReceiver(this);
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());
AbsenceService.getAbsenceByStudentByModule(getContext(), mReceiver, moduleID);
}
Aggregations