Skip to content
This repository has been archived by the owner on Oct 25, 2020. It is now read-only.

Commit

Permalink
Arriving Bedingung hinzugefügt
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasRogalsky committed Jul 13, 2020
1 parent 953147a commit e304604
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions BoxBase/app/src/main/java/com/example/boxbase/MainMenuActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,32 +218,39 @@ public void updateIncomingDeliveryList(List<IncomingSubSubscription.Pakete> pake
int drawable;
String delivery_status;
String destination;
if (paket.zustellbasis_id() != null) {
if (paket.fach_nummer() != null) {
delivery_status = "ready for pick up";
drawable = R.drawable.icon_delivery_status_boxbase;
if (paket.arriving()) {
if (paket.zustellbasis_id() != null) {
if (paket.fach_nummer() != null) {
delivery_status = "ready for pick up";
drawable = R.drawable.icon_delivery_status_boxbase;
} else {
delivery_status = "pick up is being prepared";
drawable = R.drawable.icon_delivery_status_truck;
}
destination = "mobile delivery base " + paket.zustellbasis_id();
} else {
delivery_status = "pick up is being prepared";
if (paket.wunschort_id() != null) {
delivery_status = "redirection in progress";
destination = "closest mobile delivery base";
} else {
delivery_status = "delivery is pending";
destination = paket.empfaenger().ort().adresse();
}

drawable = R.drawable.icon_delivery_status_truck;

}
destination = "mobile delivery base " + paket.zustellbasis_id();
} else {
if(paket.wunschort_id() != null) {
delivery_status = "redirection in progress";
destination = "closest mobile delivery base";
}
else {
delivery_status = "delivery is pending";
destination = paket.empfaenger().ort().adresse();
if (paket.zugestellt()) {
delivery_status = "delivered";
drawable = R.drawable.icon_delivery_status_home;
}

} else {
delivery_status = "delivery was created";
destination = paket.empfaenger().ort().adresse();
drawable = R.drawable.icon_delivery_status_truck;

}
if(paket.zugestellt()) {
delivery_status = "delivered";
drawable = R.drawable.icon_delivery_status_home;
}

incoming_deliveriesList.add(
new incoming_deliveries(
paket.id(),
Expand All @@ -254,6 +261,7 @@ public void updateIncomingDeliveryList(List<IncomingSubSubscription.Pakete> pake
paket.updated_at().toString()
)
);

}
incoming_deliveriesList.sort(Comparator.comparing(incoming_deliveries::getLast_updated).reversed());
ListView incoming_deliveries_ListView = findViewById(R.id.incoming_deliveries_ListView);
Expand Down

0 comments on commit e304604

Please sign in to comment.