Skip to content
Snippets Groups Projects
Commit e06e0fd3 authored by fheyming's avatar fheyming
Browse files

Removed hc strings

parent 865bb7f4
No related branches found
No related tags found
1 merge request!1Mal aufn Master megren
package com.example.mampfmobil.ui.Classes; package com.example.mampfmobil.ui.Classes;
import android.content.Context;
import com.example.mampfmobil.R;
import java.util.Vector; import java.util.Vector;
public class Bestellung { public class Bestellung {
...@@ -15,10 +19,10 @@ public class Bestellung { ...@@ -15,10 +19,10 @@ public class Bestellung {
public int id; public int id;
public Bestellung(Supplier supplier,Boolean delivery){ public Bestellung(Supplier supplier, Boolean delivery, Context context){
bestellungsTeile = new Vector<>(); bestellungsTeile = new Vector<>();
this.supplier = supplier; this.supplier = supplier;
state = "ordered" ; state = context.getString(R.string.ordered) ;
this.delivery = delivery; this.delivery = delivery;
id = idCounter; id = idCounter;
idCounter++; idCounter++;
......
...@@ -26,14 +26,14 @@ public class Recyclerviewadapter_Supplier_Orders extends RecyclerView.Adapter<Re ...@@ -26,14 +26,14 @@ public class Recyclerviewadapter_Supplier_Orders extends RecyclerView.Adapter<Re
this.context =context; this.context =context;
for(Customer c:MampfMobil.customers){ for(Customer c:MampfMobil.customers){
for(Bestellung b:c.bestellungen){ for(Bestellung b:c.bestellungen){
if(b.supplier==MampfMobil.currentSupplier&&b.state.equals("ordered")){ if(b.supplier==MampfMobil.currentSupplier&&b.state.equals(context.getString(R.string.ordered))){
bestellungen.add(b); bestellungen.add(b);
} }
} }
} }
for(Customer c:MampfMobil.customers){ for(Customer c:MampfMobil.customers){
for(Bestellung b:c.bestellungen){ for(Bestellung b:c.bestellungen){
if(b.supplier==MampfMobil.currentSupplier&&b.state.equals("ready")){ if(b.supplier==MampfMobil.currentSupplier&&b.state.equals(context.getString(R.string.ready))){
bestellungen.add(b); bestellungen.add(b);
} }
} }
......
...@@ -67,16 +67,16 @@ public class CustomerShoppingCartFragment extends Fragment { ...@@ -67,16 +67,16 @@ public class CustomerShoppingCartFragment extends Fragment {
for(BestellungsTeil bT: MampfMobil.currentCustomer.shoppingCart){ for(BestellungsTeil bT: MampfMobil.currentCustomer.shoppingCart){
boolean exist = false; boolean exist = false;
for(Bestellung b:MampfMobil.currentCustomer.bestellungen){ for(Bestellung b:MampfMobil.currentCustomer.bestellungen){
if(b.supplier == bT.item.supplier && b.state.equals("ordered") && !switchDelivery.isChecked() == b.delivery){ if(b.supplier == bT.item.supplier && b.state.equals(v.getContext().getString(R.string.ordered)) && !switchDelivery.isChecked() == b.delivery){
b.addBestellungsteil(bT); b.addBestellungsteil(bT);
exist = true; exist = true;
Log.d("myTag", "Added "+ bT.item.name); Log.d("myTag", "Added "+ bT.item.name);
} }
} }
if(!exist){ if(!exist){
MampfMobil.currentCustomer.addBestellung(new Bestellung(bT.item.supplier,!switchDelivery.isChecked())); MampfMobil.currentCustomer.addBestellung(new Bestellung(bT.item.supplier,!switchDelivery.isChecked(), rootView.getContext()));
for(Bestellung b:MampfMobil.currentCustomer.bestellungen){ for(Bestellung b:MampfMobil.currentCustomer.bestellungen){
if(b.supplier == bT.item.supplier && b.state.equals("ordered")){ if(b.supplier == bT.item.supplier && b.state.equals(v.getContext().getString(R.string.ordered))){
b.addBestellungsteil(bT); b.addBestellungsteil(bT);
Log.d("myTag", "created "+ bT.item.name); Log.d("myTag", "created "+ bT.item.name);
......
...@@ -49,7 +49,7 @@ public class SupplierAddItemFragment extends Fragment { ...@@ -49,7 +49,7 @@ public class SupplierAddItemFragment extends Fragment {
if (toast != null) { if (toast != null) {
toast.cancel(); // Vorhandene Toast-Nachricht abbrechen toast.cancel(); // Vorhandene Toast-Nachricht abbrechen
} }
toast = Toast.makeText(rootView.getContext(), "noEmptyInput", Toast.LENGTH_SHORT); toast = Toast.makeText(rootView.getContext(), R.string.noemptyinput, Toast.LENGTH_SHORT);
toast.show(); toast.show();
return; return;
} }
...@@ -64,7 +64,7 @@ public class SupplierAddItemFragment extends Fragment { ...@@ -64,7 +64,7 @@ public class SupplierAddItemFragment extends Fragment {
if (toast != null) { if (toast != null) {
toast.cancel(); // Vorhandene Toast-Nachricht abbrechen toast.cancel(); // Vorhandene Toast-Nachricht abbrechen
} }
toast = Toast.makeText(rootView.getContext(), "Item already exists", Toast.LENGTH_SHORT); toast = Toast.makeText(rootView.getContext(), R.string.item_already_exists, Toast.LENGTH_SHORT);
toast.show(); toast.show();
} }
else{ else{
......
...@@ -61,4 +61,6 @@ ...@@ -61,4 +61,6 @@
<string name="edit">EDIT</string> <string name="edit">EDIT</string>
<string name="total">Total</string> <string name="total">Total</string>
<string name="sold_units_dp">Sold Units:</string> <string name="sold_units_dp">Sold Units:</string>
<string name="noemptyinput">noEmptyInput</string>
<string name="item_already_exists">Item already exists</string>
</resources> </resources>
\ No newline at end of file
...@@ -58,7 +58,9 @@ ...@@ -58,7 +58,9 @@
<string name="sum_dp">Sum:</string> <string name="sum_dp">Sum:</string>
<string name="total">Total</string> <string name="total">Total</string>
<string name="sold_units_dp">Sold Units:</string> <string name="sold_units_dp">Sold Units:</string>
<string name="reserve">reserve2</string> <string name="reserve">reserve</string>
<string name="ordered">ordered</string> <string name="ordered">ordered</string>
<string name="noemptyinput">noEmptyInput</string>
<string name="item_already_exists">Item already exists</string>
</resources> </resources>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment