From 461335ac04a041f2687610a8e09bf7fbc1354341 Mon Sep 17 00:00:00 2001 From: Yougourta Date: Tue, 12 Mar 2019 09:35:35 +0100 Subject: [PATCH] remove unused code --- .../controller/candidat/ApplicationsAdapter.java | 5 ----- .../controller/candidat/FavoritesAdapter.java | 5 ----- .../controller/candidat/OffersAdapter.java | 5 ----- .../controller/recruiter/MyAppointmentsAdapter.java | 5 ----- .../controller/recruiter/MyOffersAdapter.java | 11 ----------- .../view/activities/OfferDetailActivity.java | 4 +--- .../view/fragments/recruteur/MyOffersFragment.java | 3 +-- .../recruteur/MyScheduledAppointmentsFragment.java | 3 +-- 8 files changed, 3 insertions(+), 38 deletions(-) diff --git a/app/src/main/java/fr/smartrecruit/controller/candidat/ApplicationsAdapter.java b/app/src/main/java/fr/smartrecruit/controller/candidat/ApplicationsAdapter.java index 8fb0301..410c6ac 100644 --- a/app/src/main/java/fr/smartrecruit/controller/candidat/ApplicationsAdapter.java +++ b/app/src/main/java/fr/smartrecruit/controller/candidat/ApplicationsAdapter.java @@ -22,9 +22,6 @@ public class ApplicationsAdapter extends RecyclerView.Adapter appliedOffers; private Context context; - private JobOffer mRecentlyDeletedItem; - private int mRecentlyDeletedItemPosition; - public ApplicationsAdapter(List appliedOffers, Context context){ this.appliedOffers = appliedOffers; this.context = context; @@ -90,8 +87,6 @@ public void setView(JobOffer offer){ } public void removeItem(int position){ - mRecentlyDeletedItem = appliedOffers.get(position); - mRecentlyDeletedItemPosition = position; appliedOffers.remove(position); notifyItemRemoved(position); notifyDataSetChanged(); diff --git a/app/src/main/java/fr/smartrecruit/controller/candidat/FavoritesAdapter.java b/app/src/main/java/fr/smartrecruit/controller/candidat/FavoritesAdapter.java index fdb6d1d..a213755 100644 --- a/app/src/main/java/fr/smartrecruit/controller/candidat/FavoritesAdapter.java +++ b/app/src/main/java/fr/smartrecruit/controller/candidat/FavoritesAdapter.java @@ -22,9 +22,6 @@ public class FavoritesAdapter extends RecyclerView.Adapter offers; private Context context; - private JobOffer mRecentlyDeletedItem; - private int mRecentlyDeletedItemPosition; - public FavoritesAdapter(List offers, Context context){ this.offers = offers; this.context = context; @@ -91,8 +88,6 @@ public void setView(Context context, JobOffer offer){ } public void removeItem(int position){ - mRecentlyDeletedItem = offers.get(position); - mRecentlyDeletedItemPosition = position; offers.remove(position); notifyItemRemoved(position); notifyDataSetChanged(); diff --git a/app/src/main/java/fr/smartrecruit/controller/candidat/OffersAdapter.java b/app/src/main/java/fr/smartrecruit/controller/candidat/OffersAdapter.java index 491b024..f57b070 100644 --- a/app/src/main/java/fr/smartrecruit/controller/candidat/OffersAdapter.java +++ b/app/src/main/java/fr/smartrecruit/controller/candidat/OffersAdapter.java @@ -26,9 +26,6 @@ public class OffersAdapter extends RecyclerView.Adapter offers; private Context context; - private JobOffer mRecentlyDeletedItem; - private int mRecentlyDeletedItemPosition; - public OffersAdapter(List offers, Context context){ this.offers = offers; this.context = context; @@ -100,8 +97,6 @@ public void setView(Context context, JobOffer offer){ } public void removeItem(int position){ - mRecentlyDeletedItem = offers.get(position); - mRecentlyDeletedItemPosition = position; offers.remove(position); notifyItemRemoved(position); notifyDataSetChanged(); diff --git a/app/src/main/java/fr/smartrecruit/controller/recruiter/MyAppointmentsAdapter.java b/app/src/main/java/fr/smartrecruit/controller/recruiter/MyAppointmentsAdapter.java index b8bee21..24c23cd 100644 --- a/app/src/main/java/fr/smartrecruit/controller/recruiter/MyAppointmentsAdapter.java +++ b/app/src/main/java/fr/smartrecruit/controller/recruiter/MyAppointmentsAdapter.java @@ -16,9 +16,6 @@ public class MyAppointmentsAdapter extends RecyclerView.Adapter appointments; - private RecAppointment mRecentlyDeletedItem; - private int mRecentlyDeletedItemPosition; - public MyAppointmentsAdapter(List appointments){ this.appointments = appointments; } @@ -67,8 +64,6 @@ public void setView(RecAppointment appointment){ } public void removeItem(int position){ - mRecentlyDeletedItem = appointments.get(position); - mRecentlyDeletedItemPosition = position; appointments.remove(position); notifyItemRemoved(position); notifyDataSetChanged(); diff --git a/app/src/main/java/fr/smartrecruit/controller/recruiter/MyOffersAdapter.java b/app/src/main/java/fr/smartrecruit/controller/recruiter/MyOffersAdapter.java index bc6810a..e5d71f5 100644 --- a/app/src/main/java/fr/smartrecruit/controller/recruiter/MyOffersAdapter.java +++ b/app/src/main/java/fr/smartrecruit/controller/recruiter/MyOffersAdapter.java @@ -18,9 +18,6 @@ public class MyOffersAdapter extends RecyclerView.Adapter myOffers; private Context context; - private JobOffer listOffer; - private int mRecentlyDeletedItemPosition; - public MyOffersAdapter(List offers, Context context){ this.myOffers = offers; this.context = context; @@ -79,12 +76,4 @@ public void setView(Context context, JobOffer myOffer){ postedDate.setText(myOffer.getDatePosted()); } } - - public void removeItem(int position){ - listOffer = myOffers.get(position); - mRecentlyDeletedItemPosition = position; - myOffers.remove(position); - notifyItemRemoved(position); - notifyDataSetChanged(); - } } diff --git a/app/src/main/java/fr/smartrecruit/view/activities/OfferDetailActivity.java b/app/src/main/java/fr/smartrecruit/view/activities/OfferDetailActivity.java index 5e5e531..b91e4e9 100644 --- a/app/src/main/java/fr/smartrecruit/view/activities/OfferDetailActivity.java +++ b/app/src/main/java/fr/smartrecruit/view/activities/OfferDetailActivity.java @@ -12,14 +12,12 @@ public class OfferDetailActivity extends AppCompatActivity{ - private JobOffer offer; - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /** To refactor to match MVVM pattern */ - offer = (JobOffer) getIntent().getSerializableExtra("offer"); + JobOffer offer = (JobOffer) getIntent().getSerializableExtra("offer"); ActivityOfferDetailBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_offer_detail); binding.setOffer(offer); diff --git a/app/src/main/java/fr/smartrecruit/view/fragments/recruteur/MyOffersFragment.java b/app/src/main/java/fr/smartrecruit/view/fragments/recruteur/MyOffersFragment.java index c0cd3e8..9434fb3 100644 --- a/app/src/main/java/fr/smartrecruit/view/fragments/recruteur/MyOffersFragment.java +++ b/app/src/main/java/fr/smartrecruit/view/fragments/recruteur/MyOffersFragment.java @@ -32,7 +32,6 @@ public class MyOffersFragment extends Fragment { private RecyclerView offersRecycler; - private List offers; private MyOffersAdapter adapter; private JobOffer myoffer; public MyOffersFragment() { } @@ -93,7 +92,7 @@ public void findViews(View view){ public void initAdapter(){ final Context context = getContext(); - offers = MyOffersController.getMyOffersController().getApiMyOffers(context); + List offers = MyOffersController.getMyOffersController().getApiMyOffers(context); adapter = new MyOffersAdapter(offers, context); offersRecycler.setAdapter(adapter); offersRecycler.setHasFixedSize(true); diff --git a/app/src/main/java/fr/smartrecruit/view/fragments/recruteur/MyScheduledAppointmentsFragment.java b/app/src/main/java/fr/smartrecruit/view/fragments/recruteur/MyScheduledAppointmentsFragment.java index ef9c463..2fff33b 100644 --- a/app/src/main/java/fr/smartrecruit/view/fragments/recruteur/MyScheduledAppointmentsFragment.java +++ b/app/src/main/java/fr/smartrecruit/view/fragments/recruteur/MyScheduledAppointmentsFragment.java @@ -22,7 +22,6 @@ public class MyScheduledAppointmentsFragment extends Fragment { private RecyclerView appointmentsRecycler; private MyScheduledAppointmentsAdapter appointmentsAdapter; - private List appointments; public MyScheduledAppointmentsFragment() { } @@ -43,7 +42,7 @@ public void findViews(View view){ public void initAdapter(){ final Context context = getContext(); - appointments = MyScheduledAppointmentsController.getMyScheduledAppointmentsController().getRecruiterAppointments(context); + List appointments = MyScheduledAppointmentsController.getMyScheduledAppointmentsController().getRecruiterAppointments(context); appointmentsAdapter = new MyScheduledAppointmentsAdapter(appointments); appointmentsRecycler.setAdapter(appointmentsAdapter); appointmentsRecycler.setHasFixedSize(true);