Skip to content
Snippets Groups Projects
Commit 96e7a194 authored by Fabio Heyming's avatar Fabio Heyming
Browse files

Design verbessert

parent 357ca511
No related branches found
No related tags found
1 merge request!1Mal aufn Master megren
Showing
with 29 additions and 6 deletions
...@@ -26,6 +26,8 @@ public class Recyclerviewadapter_Shop extends RecyclerView.Adapter<Recyclerviewa ...@@ -26,6 +26,8 @@ public class Recyclerviewadapter_Shop extends RecyclerView.Adapter<Recyclerviewa
Context context; Context context;
ArrayList<ShopItem> shopItemList; ArrayList<ShopItem> shopItemList;
public Recyclerviewadapter_Shop(Context context, ArrayList<ShopItem> shopItemList){ public Recyclerviewadapter_Shop(Context context, ArrayList<ShopItem> shopItemList){
this.context = context; this.context = context;
this.shopItemList = shopItemList; this.shopItemList = shopItemList;
...@@ -100,9 +102,11 @@ public class Recyclerviewadapter_Shop extends RecyclerView.Adapter<Recyclerviewa ...@@ -100,9 +102,11 @@ public class Recyclerviewadapter_Shop extends RecyclerView.Adapter<Recyclerviewa
TextView tvName, tvSupName, tvAmountNr,tvPrice; TextView tvName, tvSupName, tvAmountNr,tvPrice;
ShopItem sI; ShopItem sI;
private Toast toast;
public MyViewHolder(@NonNull View itemView) { public MyViewHolder(@NonNull View itemView) {
super(itemView); super(itemView);
tvName = itemView.findViewById(R.id.textViewName); tvName = itemView.findViewById(R.id.textViewName);
tvSupName = itemView.findViewById(R.id.textViewSupplierName); tvSupName = itemView.findViewById(R.id.textViewSupplierName);
tvAmountNr = itemView.findViewById(R.id.textViewAmountNumber); tvAmountNr = itemView.findViewById(R.id.textViewAmountNumber);
...@@ -114,7 +118,11 @@ public class Recyclerviewadapter_Shop extends RecyclerView.Adapter<Recyclerviewa ...@@ -114,7 +118,11 @@ public class Recyclerviewadapter_Shop extends RecyclerView.Adapter<Recyclerviewa
@Override @Override
public void onClick(View v) { 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()))); MampfMobil.currentCustomer.addToShoppingCart(new BestellungsTeil(sI.item,Integer.parseInt(inputAmount.getText().toString())));
} }
}); });
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
app:cardBackgroundColor="?attr/boxColor"
app:cardCornerRadius="20dp" app:cardCornerRadius="20dp"
app:cardElevation="5dp" app:cardElevation="5dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:text="Der aktuelle Status oder so" android:text="Der aktuelle Status oder so"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@+id/textView7" app:layout_constraintStart_toEndOf="@+id/textView7"
app:layout_constraintTop_toBottomOf="@+id/buttonReady" /> app:layout_constraintTop_toBottomOf="@+id/buttonReady" />
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
app:cardBackgroundColor="?attr/boxColor"
app:cardCornerRadius="20dp" app:cardCornerRadius="20dp"
app:cardElevation="5dp" app:cardElevation="5dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
app:cardBackgroundColor="?attr/boxColor"
app:cardCornerRadius="20dp" app:cardCornerRadius="20dp"
app:cardElevation="5dp" app:cardElevation="5dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:text="Der aktuelle Status oder so" android:text="Der aktuelle Status oder so"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@+id/textView7" app:layout_constraintStart_toEndOf="@+id/textView7"
app:layout_constraintTop_toBottomOf="@+id/textViewID" /> app:layout_constraintTop_toBottomOf="@+id/textViewID" />
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
app:cardBackgroundColor="?attr/boxColor"
app:cardCornerRadius="20dp" app:cardCornerRadius="20dp"
app:cardElevation="5dp" app:cardElevation="5dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
app:cardBackgroundColor="?attr/boxColor"
app:cardCornerRadius="20dp" app:cardCornerRadius="20dp"
app:cardElevation="5dp" app:cardElevation="5dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
app:cardBackgroundColor="?attr/boxColor"
app:cardCornerRadius="20dp" app:cardCornerRadius="20dp"
app:cardElevation="5dp" app:cardElevation="5dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:text="Der aktuelle Status oder so" android:text="Der aktuelle Status oder so"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@+id/textView7" app:layout_constraintStart_toEndOf="@+id/textView7"
app:layout_constraintTop_toBottomOf="@+id/textViewID" /> app:layout_constraintTop_toBottomOf="@+id/textViewID" />
......
...@@ -63,4 +63,5 @@ ...@@ -63,4 +63,5 @@
<string name="sold_units_dp">Verkaufte Items:</string> <string name="sold_units_dp">Verkaufte Items:</string>
<string name="noemptyinput">Keine leere eingaben</string> <string name="noemptyinput">Keine leere eingaben</string>
<string name="item_already_exists">Item existiert bereits</string> <string name="item_already_exists">Item existiert bereits</string>
<string name="added_to_shopping_cart">Zum Einkaufswagen hinzugefügt</string>
</resources> </resources>
\ No newline at end of file
...@@ -12,5 +12,6 @@ ...@@ -12,5 +12,6 @@
<!-- Status bar color. --> <!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item> <item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="boxColor">@color/dark_purple</item>
</style> </style>
</resources> </resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr name="boxColor" format="color" />
</resources>
\ No newline at end of file
...@@ -8,4 +8,7 @@ ...@@ -8,4 +8,7 @@
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="dark_grey">#5A5A5A</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> </resources>
\ No newline at end of file
...@@ -62,5 +62,6 @@ ...@@ -62,5 +62,6 @@
<string name="ordered">ordered</string> <string name="ordered">ordered</string>
<string name="noemptyinput">noEmptyInput</string> <string name="noemptyinput">noEmptyInput</string>
<string name="item_already_exists">Item already exists</string> <string name="item_already_exists">Item already exists</string>
<string name="added_to_shopping_cart">Added to Shopping Cart</string>
</resources> </resources>
\ No newline at end of file
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<!-- Status bar color. --> <!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item> <item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="boxColor">@color/light_grey</item>
</style> </style>
</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