From 96e7a1945835b8e8fe68900f2a28596c3b8df370 Mon Sep 17 00:00:00 2001
From: Fabio Heyming <fabio.heyming@web.de>
Date: Fri, 9 Jun 2023 21:08:29 +0200
Subject: [PATCH] Design verbessert

---
 .../ui/Classes/Recyclerviewadapter_Shop.java           | 10 +++++++++-
 .../res/layout/recyclerview_deliverer_orderrow.xml     |  3 ++-
 app/src/main/res/layout/recyclerview_edititemrow.xml   |  2 +-
 app/src/main/res/layout/recyclerview_ordersrow.xml     |  3 ++-
 .../main/res/layout/recyclerview_shoppingcartrow.xml   |  2 +-
 app/src/main/res/layout/recyclerview_shoprow.xml       |  1 +
 .../main/res/layout/recyclerview_supplierordersrow.xml |  3 ++-
 app/src/main/res/values-de-rDE/strings.xml             |  1 +
 app/src/main/res/values-night/themes.xml               |  1 +
 app/src/main/res/values/attrs.xml                      |  4 ++++
 app/src/main/res/values/colors.xml                     |  3 +++
 app/src/main/res/values/strings.xml                    |  1 +
 app/src/main/res/values/themes.xml                     |  1 +
 13 files changed, 29 insertions(+), 6 deletions(-)
 create mode 100644 app/src/main/res/values/attrs.xml

diff --git a/app/src/main/java/com/example/mampfmobil/ui/Classes/Recyclerviewadapter_Shop.java b/app/src/main/java/com/example/mampfmobil/ui/Classes/Recyclerviewadapter_Shop.java
index 3f0dadf..6fbf14c 100644
--- a/app/src/main/java/com/example/mampfmobil/ui/Classes/Recyclerviewadapter_Shop.java
+++ b/app/src/main/java/com/example/mampfmobil/ui/Classes/Recyclerviewadapter_Shop.java
@@ -26,6 +26,8 @@ public class Recyclerviewadapter_Shop extends RecyclerView.Adapter<Recyclerviewa
     Context context;
     ArrayList<ShopItem> shopItemList;
 
+
+
     public Recyclerviewadapter_Shop(Context context, ArrayList<ShopItem> shopItemList){
         this.context = context;
         this.shopItemList = shopItemList;
@@ -100,9 +102,11 @@ public class Recyclerviewadapter_Shop extends RecyclerView.Adapter<Recyclerviewa
         TextView tvName, tvSupName, tvAmountNr,tvPrice;
 
         ShopItem sI;
+        private Toast toast;
 
         public MyViewHolder(@NonNull View itemView) {
             super(itemView);
+
             tvName = itemView.findViewById(R.id.textViewName);
             tvSupName = itemView.findViewById(R.id.textViewSupplierName);
             tvAmountNr = itemView.findViewById(R.id.textViewAmountNumber);
@@ -114,7 +118,11 @@ public class Recyclerviewadapter_Shop extends RecyclerView.Adapter<Recyclerviewa
                 @Override
                 public void onClick(View v) {
 
-
+                    if (toast != null) {
+                        toast.cancel(); // Vorhandene Toast-Nachricht abbrechen
+                    }
+                    toast = Toast.makeText(v.getContext(), R.string.added_to_shopping_cart, Toast.LENGTH_SHORT);
+                    toast.show();
                     MampfMobil.currentCustomer.addToShoppingCart(new BestellungsTeil(sI.item,Integer.parseInt(inputAmount.getText().toString())));
                 }
             });
diff --git a/app/src/main/res/layout/recyclerview_deliverer_orderrow.xml b/app/src/main/res/layout/recyclerview_deliverer_orderrow.xml
index b80f297..36b652a 100644
--- a/app/src/main/res/layout/recyclerview_deliverer_orderrow.xml
+++ b/app/src/main/res/layout/recyclerview_deliverer_orderrow.xml
@@ -12,7 +12,7 @@
         android:layout_marginTop="5dp"
         android:layout_marginStart="5dp"
         android:layout_marginEnd="5dp"
-
+        app:cardBackgroundColor="?attr/boxColor"
         app:cardCornerRadius="20dp"
         app:cardElevation="5dp"
         app:layout_constraintBottom_toBottomOf="parent"
@@ -49,6 +49,7 @@
                 android:layout_height="wrap_content"
                 android:layout_marginStart="8dp"
                 android:text="Der aktuelle Status oder so"
+                android:textStyle="bold"
                 app:layout_constraintStart_toEndOf="@+id/textView7"
                 app:layout_constraintTop_toBottomOf="@+id/buttonReady" />
 
diff --git a/app/src/main/res/layout/recyclerview_edititemrow.xml b/app/src/main/res/layout/recyclerview_edititemrow.xml
index 88737e1..12a8112 100644
--- a/app/src/main/res/layout/recyclerview_edititemrow.xml
+++ b/app/src/main/res/layout/recyclerview_edititemrow.xml
@@ -12,7 +12,7 @@
         android:layout_marginTop="5dp"
         android:layout_marginStart="5dp"
         android:layout_marginEnd="5dp"
-
+        app:cardBackgroundColor="?attr/boxColor"
         app:cardCornerRadius="20dp"
         app:cardElevation="5dp"
         app:layout_constraintBottom_toBottomOf="parent"
diff --git a/app/src/main/res/layout/recyclerview_ordersrow.xml b/app/src/main/res/layout/recyclerview_ordersrow.xml
index 2c86107..6c4a6ca 100644
--- a/app/src/main/res/layout/recyclerview_ordersrow.xml
+++ b/app/src/main/res/layout/recyclerview_ordersrow.xml
@@ -12,7 +12,7 @@
         android:layout_marginTop="5dp"
         android:layout_marginStart="5dp"
         android:layout_marginEnd="5dp"
-
+        app:cardBackgroundColor="?attr/boxColor"
         app:cardCornerRadius="20dp"
         app:cardElevation="5dp"
         app:layout_constraintBottom_toBottomOf="parent"
@@ -81,6 +81,7 @@
                 android:layout_height="wrap_content"
                 android:layout_marginStart="8dp"
                 android:text="Der aktuelle Status oder so"
+                android:textStyle="bold"
                 app:layout_constraintStart_toEndOf="@+id/textView7"
                 app:layout_constraintTop_toBottomOf="@+id/textViewID" />
 
diff --git a/app/src/main/res/layout/recyclerview_shoppingcartrow.xml b/app/src/main/res/layout/recyclerview_shoppingcartrow.xml
index 9a7adf0..8db9227 100644
--- a/app/src/main/res/layout/recyclerview_shoppingcartrow.xml
+++ b/app/src/main/res/layout/recyclerview_shoppingcartrow.xml
@@ -12,7 +12,7 @@
         android:layout_marginTop="5dp"
         android:layout_marginStart="5dp"
         android:layout_marginEnd="5dp"
-
+        app:cardBackgroundColor="?attr/boxColor"
         app:cardCornerRadius="20dp"
         app:cardElevation="5dp"
         app:layout_constraintBottom_toBottomOf="parent"
diff --git a/app/src/main/res/layout/recyclerview_shoprow.xml b/app/src/main/res/layout/recyclerview_shoprow.xml
index 46a0353..4af2d54 100644
--- a/app/src/main/res/layout/recyclerview_shoprow.xml
+++ b/app/src/main/res/layout/recyclerview_shoprow.xml
@@ -12,6 +12,7 @@
         android:layout_marginTop="5dp"
         android:layout_marginStart="5dp"
         android:layout_marginEnd="5dp"
+        app:cardBackgroundColor="?attr/boxColor"
         app:cardCornerRadius="20dp"
         app:cardElevation="5dp"
         app:layout_constraintBottom_toBottomOf="parent"
diff --git a/app/src/main/res/layout/recyclerview_supplierordersrow.xml b/app/src/main/res/layout/recyclerview_supplierordersrow.xml
index bf5b5e7..f5d077e 100644
--- a/app/src/main/res/layout/recyclerview_supplierordersrow.xml
+++ b/app/src/main/res/layout/recyclerview_supplierordersrow.xml
@@ -12,7 +12,7 @@
         android:layout_marginTop="5dp"
         android:layout_marginStart="5dp"
         android:layout_marginEnd="5dp"
-
+        app:cardBackgroundColor="?attr/boxColor"
         app:cardCornerRadius="20dp"
         app:cardElevation="5dp"
         app:layout_constraintBottom_toBottomOf="parent"
@@ -63,6 +63,7 @@
                 android:layout_height="wrap_content"
                 android:layout_marginStart="8dp"
                 android:text="Der aktuelle Status oder so"
+                android:textStyle="bold"
                 app:layout_constraintStart_toEndOf="@+id/textView7"
                 app:layout_constraintTop_toBottomOf="@+id/textViewID" />
 
diff --git a/app/src/main/res/values-de-rDE/strings.xml b/app/src/main/res/values-de-rDE/strings.xml
index aebafb7..15325c0 100644
--- a/app/src/main/res/values-de-rDE/strings.xml
+++ b/app/src/main/res/values-de-rDE/strings.xml
@@ -63,4 +63,5 @@
     <string name="sold_units_dp">Verkaufte Items:</string>
     <string name="noemptyinput">Keine leere eingaben</string>
     <string name="item_already_exists">Item existiert bereits</string>
+    <string name="added_to_shopping_cart">Zum Einkaufswagen hinzugefügt</string>
 </resources>
\ No newline at end of file
diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml
index 8abf818..1553a5c 100644
--- a/app/src/main/res/values-night/themes.xml
+++ b/app/src/main/res/values-night/themes.xml
@@ -12,5 +12,6 @@
         <!-- Status bar color. -->
         <item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
         <!-- Customize your theme here. -->
+        <item name="boxColor">@color/dark_purple</item>
     </style>
 </resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml
new file mode 100644
index 0000000..ad204f8
--- /dev/null
+++ b/app/src/main/res/values/attrs.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <attr name="boxColor" format="color" />
+</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index b136129..546bdcd 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -8,4 +8,7 @@
     <color name="black">#FF000000</color>
     <color name="white">#FFFFFFFF</color>
     <color name="dark_grey">#5A5A5A</color>
+    <color name="light_grey">#D3D3D3</color>
+    <color name="light_purple">#D8BFD8</color>
+    <color name="dark_purple">#301934</color>
 </resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index b9c186e..554da62 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -62,5 +62,6 @@
     <string name="ordered">ordered</string>
     <string name="noemptyinput">noEmptyInput</string>
     <string name="item_already_exists">Item already exists</string>
+    <string name="added_to_shopping_cart">Added to Shopping Cart</string>
 
 </resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
index b05bf7a..5cc402a 100644
--- a/app/src/main/res/values/themes.xml
+++ b/app/src/main/res/values/themes.xml
@@ -13,6 +13,7 @@
         <!-- Status bar color. -->
         <item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
         <!-- Customize your theme here. -->
+        <item name="boxColor">@color/light_grey</item>
 
     </style>
 </resources>
\ No newline at end of file
-- 
GitLab