use of dz.easy.androidclient.Services.DataReceiver in project easy by MehdiBenmesa.
the class ModuleDetailFragment method onCreate.
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReceiver = new DataReceiver(new Handler());
mReceiver.setReceiver(this);
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);
SessionManager sessionManager = new SessionManager(getContext());
userID = sessionManager.getIdUser();
// String Module = sessionManager
NoteService.getNoteByStudent(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);
}
use of dz.easy.androidclient.Services.DataReceiver in project easy by MehdiBenmesa.
the class StudentsFragmentAbsence method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_student_absence, container, false);
mReceiver = new DataReceiver(new Handler());
mReceiver.setReceiver(this);
return view;
}
use of dz.easy.androidclient.Services.DataReceiver 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);
}
use of dz.easy.androidclient.Services.DataReceiver in project easy by MehdiBenmesa.
the class GroupFragment 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);
System.out.println("OnCreate : ME FIRST ");
try {
module = new JSONObject(getArguments().getString("module"));
user = App.getInstance().getUser();
if (user.getString("_type").equals("Teacher")) {
GroupService.getGroupsByModuleByTeacher(getContext(), mReceiver, module.getString("_id"));
} else if (user.getString("_type").equals("Manager")) {
Toast.makeText(getContext(), "Hi Manager", Toast.LENGTH_LONG).show();
// getTeachers();
}
} catch (JSONException e) {
e.printStackTrace();
}
if (GRID_LAYOUT) {
mRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 2));
} else {
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
}
mRecyclerView.setHasFixedSize(true);
}
use of dz.easy.androidclient.Services.DataReceiver 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();
}
}
Aggregations