use of dz.easy.androidclient.Services.DataReceiver in project easy by MehdiBenmesa.
the class NoteFragment 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());
getNoteByStudent();
}
use of dz.easy.androidclient.Services.DataReceiver 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 dz.easy.androidclient.Services.DataReceiver in project easy by MehdiBenmesa.
the class StudentsFragmentNote 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);
addItemsOnSpinner();
if (GRID_LAYOUT) {
mRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 2));
} else {
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
}
mRecyclerView.setHasFixedSize(true);
try {
studentsListNoteAdapter = new StudentsListNoteAdapter(students, module.getString("_id"), (StudentsListNoteAdapter.AdapterInterface) StudentsFragmentNote.this);
} catch (JSONException e1) {
e1.printStackTrace();
}
mRecyclerView.setAdapter(studentsListNoteAdapter);
/*
mRecyclerView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
System.out.println("VALIER /// 2 ");
StudentsListNoteAdapter.MyViewHolder child;
ArrayList<StudentsListNoteAdapter.MyViewHolder> myList = studentsListNoteAdapter.getMyList();
Toast.makeText(getContext() , "Hello From Module Fragment "+ myList.size() +" hihi " , Toast.LENGTH_LONG).show();
for (int i = 0; i < myList.size(); i++) {
child = myList.get(i);
Toast.makeText(getContext() , child.title.getText() , Toast.LENGTH_LONG).show();
}
}
});*/
valider = (Button) view.findViewById(R.id.valider);
valider.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
System.out.println("VALIER /// ");
try {
studentsListNoteAdapter.updateNotes(getActivity(), module.getString("_id"));
} catch (JSONException e) {
e.printStackTrace();
}
}
});
// mRecyclerView.
}
use of dz.easy.androidclient.Services.DataReceiver in project easy by MehdiBenmesa.
the class AbsenceDetailFragment method onCreate.
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
exam = (TextView) getActivity().findViewById(R.id.exam);
controle = (TextView) getActivity().findViewById(R.id.control);
intero = (TextView) getActivity().findViewById(R.id.intero);
tp = (TextView) getActivity().findViewById(R.id.tps);
mReceiver = new DataReceiver(new Handler());
mReceiver.setReceiver(this);
SessionManager sessionManager = new SessionManager(getContext());
userID = sessionManager.getIdUser();
// String Module = sessionManager
AbsenceService.getAbsenceByStudent(getContext(), mReceiver);
if (getArguments().containsKey(ARG_ITEM_ID)) {
// load dummy item by using the passed item ID.
// accident = AppContent.ITEM_MAP.get(getArguments().getString(ARG_ITEM_ID));
}
// Toast.makeText(getContext() , moduleID , Toast.LENGTH_LONG).show();
setHasOptionsMenu(true);
}
Aggregations