Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Yougourta committed Mar 12, 2019
1 parent e4319b3 commit 461335a
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ public class ApplicationsAdapter extends RecyclerView.Adapter<ApplicationsAdapte
private List<JobOffer> appliedOffers;
private Context context;

private JobOffer mRecentlyDeletedItem;
private int mRecentlyDeletedItemPosition;

public ApplicationsAdapter(List<JobOffer> appliedOffers, Context context){
this.appliedOffers = appliedOffers;
this.context = context;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ public class FavoritesAdapter extends RecyclerView.Adapter<FavoritesAdapter.Favo
private List<JobOffer> offers;
private Context context;

private JobOffer mRecentlyDeletedItem;
private int mRecentlyDeletedItemPosition;

public FavoritesAdapter(List<JobOffer> offers, Context context){
this.offers = offers;
this.context = context;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ public class OffersAdapter extends RecyclerView.Adapter<OffersAdapter.OffersView
private List<JobOffer> offers;
private Context context;

private JobOffer mRecentlyDeletedItem;
private int mRecentlyDeletedItemPosition;

public OffersAdapter(List<JobOffer> offers, Context context){
this.offers = offers;
this.context = context;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ public class MyAppointmentsAdapter extends RecyclerView.Adapter<MyAppointmentsAd

private List<RecAppointment> appointments;

private RecAppointment mRecentlyDeletedItem;
private int mRecentlyDeletedItemPosition;

public MyAppointmentsAdapter(List<RecAppointment> appointments){
this.appointments = appointments;
}
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ public class MyOffersAdapter extends RecyclerView.Adapter<MyOffersAdapter.MyOff
private List<JobOffer> myOffers;
private Context context;

private JobOffer listOffer;
private int mRecentlyDeletedItemPosition;

public MyOffersAdapter(List<JobOffer> offers, Context context){
this.myOffers = offers;
this.context = context;
Expand Down Expand Up @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
public class MyOffersFragment extends Fragment {

private RecyclerView offersRecycler;
private List<JobOffer> offers;
private MyOffersAdapter adapter;
private JobOffer myoffer;
public MyOffersFragment() { }
Expand Down Expand Up @@ -93,7 +92,7 @@ public void findViews(View view){

public void initAdapter(){
final Context context = getContext();
offers = MyOffersController.getMyOffersController().getApiMyOffers(context);
List<JobOffer> offers = MyOffersController.getMyOffersController().getApiMyOffers(context);
adapter = new MyOffersAdapter(offers, context);
offersRecycler.setAdapter(adapter);
offersRecycler.setHasFixedSize(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
public class MyScheduledAppointmentsFragment extends Fragment {
private RecyclerView appointmentsRecycler;
private MyScheduledAppointmentsAdapter appointmentsAdapter;
private List<RecAppointment> appointments;

public MyScheduledAppointmentsFragment() { }

Expand All @@ -43,7 +42,7 @@ public void findViews(View view){

public void initAdapter(){
final Context context = getContext();
appointments = MyScheduledAppointmentsController.getMyScheduledAppointmentsController().getRecruiterAppointments(context);
List<RecAppointment> appointments = MyScheduledAppointmentsController.getMyScheduledAppointmentsController().getRecruiterAppointments(context);
appointmentsAdapter = new MyScheduledAppointmentsAdapter(appointments);
appointmentsRecycler.setAdapter(appointmentsAdapter);
appointmentsRecycler.setHasFixedSize(true);
Expand Down

0 comments on commit 461335a

Please sign in to comment.