diff --git a/app/src/main/java/com/example/mampfmobil/ui/CustomerActivity.java b/app/src/main/java/com/example/mampfmobil/ui/CustomerActivity.java index 64e970e6d7193bfee16db716ac999546021cebd3..0e4e4614bbe3d69aa6301585f1ee3bd762f10e70 100644 --- a/app/src/main/java/com/example/mampfmobil/ui/CustomerActivity.java +++ b/app/src/main/java/com/example/mampfmobil/ui/CustomerActivity.java @@ -7,6 +7,7 @@ import android.util.Log; import com.example.mampfmobil.MainActivity; import com.example.mampfmobil.R; +import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; import androidx.navigation.NavController; import androidx.navigation.Navigation; @@ -36,9 +37,7 @@ private ActivityCustomerBinding binding; binding = ActivityCustomerBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); - - - + // Enable the back button in the ActionBar AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder( @@ -47,7 +46,11 @@ private ActivityCustomerBinding binding; NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_activity_customer); NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration); NavigationUI.setupWithNavController(binding.navView1, navController); - + // Enable the back button in the ActionBar + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + } @@ -106,4 +109,4 @@ private ActivityCustomerBinding binding; } -} +} \ No newline at end of file diff --git a/app/src/main/java/com/example/mampfmobil/ui/customer/CustomerOrdersFragment.java b/app/src/main/java/com/example/mampfmobil/ui/customer/CustomerOrdersFragment.java index ba6b3776f98cb1230f350eb7168bdf69c96b2682..6840c1a05e809afaeb2f17db5656c7845f2a7a36 100644 --- a/app/src/main/java/com/example/mampfmobil/ui/customer/CustomerOrdersFragment.java +++ b/app/src/main/java/com/example/mampfmobil/ui/customer/CustomerOrdersFragment.java @@ -1,5 +1,7 @@ package com.example.mampfmobil.ui.customer; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; import androidx.lifecycle.ViewModelProvider; import android.os.Bundle; @@ -47,6 +49,14 @@ public class CustomerOrdersFragment extends Fragment { adapter.notifyDataSetChanged(); + AppCompatActivity activity = (AppCompatActivity) requireActivity(); + // Enable the back button in the ActionBar + ActionBar actionBar = activity.getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + } + + return rootView; } diff --git a/app/src/main/java/com/example/mampfmobil/ui/customer/CustomerShopFragment.java b/app/src/main/java/com/example/mampfmobil/ui/customer/CustomerShopFragment.java index fd38a7eb9f67784b48d7da6b8a6e6c237e42d077..f411482df4f6adc605d466d7212801b0ebc093ee 100644 --- a/app/src/main/java/com/example/mampfmobil/ui/customer/CustomerShopFragment.java +++ b/app/src/main/java/com/example/mampfmobil/ui/customer/CustomerShopFragment.java @@ -1,5 +1,7 @@ package com.example.mampfmobil.ui.customer; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; import androidx.lifecycle.ViewModelProvider; import android.os.Bundle; @@ -59,6 +61,13 @@ public class CustomerShopFragment extends Fragment { } }); + AppCompatActivity activity = (AppCompatActivity) requireActivity(); + // Enable the back button in the ActionBar + ActionBar actionBar = activity.getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + } + // Return the inflated rootView return rootView; } diff --git a/app/src/main/java/com/example/mampfmobil/ui/customer/CustomerShoppingCartFragment.java b/app/src/main/java/com/example/mampfmobil/ui/customer/CustomerShoppingCartFragment.java index d55befa9d42210871675ca7ba107b49be91c55e8..3dd92a54a29c8eb69ee9aa5ec6a20113bf831fd5 100644 --- a/app/src/main/java/com/example/mampfmobil/ui/customer/CustomerShoppingCartFragment.java +++ b/app/src/main/java/com/example/mampfmobil/ui/customer/CustomerShoppingCartFragment.java @@ -1,5 +1,7 @@ package com.example.mampfmobil.ui.customer; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.ViewModelProvider; @@ -92,6 +94,14 @@ public class CustomerShoppingCartFragment extends Fragment { } }); + AppCompatActivity activity = (AppCompatActivity) requireActivity(); + // Enable the back button in the ActionBar + ActionBar actionBar = activity.getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + } + + return rootView; } diff --git a/app/src/main/java/com/example/mampfmobil/ui/supplier/SupplierOrdersFragment.java b/app/src/main/java/com/example/mampfmobil/ui/supplier/SupplierOrdersFragment.java index 75a5080c675a29db7484e8665bae2efbca63d94f..2cb391af8cb2b0b8c2aebb9e9d7c137e7249899d 100644 --- a/app/src/main/java/com/example/mampfmobil/ui/supplier/SupplierOrdersFragment.java +++ b/app/src/main/java/com/example/mampfmobil/ui/supplier/SupplierOrdersFragment.java @@ -1,5 +1,7 @@ package com.example.mampfmobil.ui.supplier; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; import androidx.lifecycle.ViewModelProvider; import android.os.Bundle; @@ -25,6 +27,15 @@ public class SupplierOrdersFragment extends Fragment { @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + + + AppCompatActivity activity = (AppCompatActivity) requireActivity(); + // Enable the back button in the ActionBar + ActionBar actionBar = activity.getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + } + return inflater.inflate(R.layout.fragment_supplier_orders, container, false); } diff --git a/app/src/main/res/layout/activity_supplier.xml b/app/src/main/res/layout/activity_supplier.xml index 39be74843e116eb8e10dc4e2799f263527450a7a..ddacef9369981acbc1cff117403b19839895d229 100644 --- a/app/src/main/res/layout/activity_supplier.xml +++ b/app/src/main/res/layout/activity_supplier.xml @@ -4,8 +4,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/container" android:layout_width="match_parent" - android:layout_height="match_parent" - android:paddingTop="?attr/actionBarSize" > + android:layout_height="match_parent"> <com.google.android.material.bottomnavigation.BottomNavigationView android:id="@+id/nav_view2" diff --git a/app/src/main/res/layout/recyclerview_ordersrow.xml b/app/src/main/res/layout/recyclerview_ordersrow.xml index c8147becc486449015d3f15d209c9b619432e680..d2fa40b24804bffb2d254c88f8ceff3ad5f93587 100644 --- a/app/src/main/res/layout/recyclerview_ordersrow.xml +++ b/app/src/main/res/layout/recyclerview_ordersrow.xml @@ -71,7 +71,7 @@ android:id="@+id/textView7" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="State: " + android:text="@string/state_dp" app:layout_constraintStart_toStartOf="@+id/textViewID" app:layout_constraintTop_toBottomOf="@+id/textViewID" /> diff --git a/app/src/main/res/navigation/mobile_navigation_cus.xml b/app/src/main/res/navigation/mobile_navigation_cus.xml index b987482b874d76c6d5d6137249bb8c50c068272a..51c3fe1707e21ea2218c102f1922f6f11e2b277b 100644 --- a/app/src/main/res/navigation/mobile_navigation_cus.xml +++ b/app/src/main/res/navigation/mobile_navigation_cus.xml @@ -3,7 +3,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/mobile_navigation_cus" - app:startDestination="@+id/navigation_shop"> + app:startDestination="@+id/navigation_shop" + app:defaultNavHost="true"> <fragment android:id="@+id/navigation_shop" diff --git a/app/src/main/res/navigation/mobile_navigation_del.xml b/app/src/main/res/navigation/mobile_navigation_del.xml index 5dcaf46914ff8e9654b8b377f91e97aaad7ace00..18692b6b965e2743742e3091b8ab7fe64e81cc20 100644 --- a/app/src/main/res/navigation/mobile_navigation_del.xml +++ b/app/src/main/res/navigation/mobile_navigation_del.xml @@ -3,7 +3,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/mobile_navigation_del" - app:startDestination="@+id/navigation_open_orders"> + app:startDestination="@+id/navigation_open_orders" + app:defaultNavHost="true"> <fragment android:id="@+id/navigation_open_orders" diff --git a/app/src/main/res/navigation/mobile_navigation_sup.xml b/app/src/main/res/navigation/mobile_navigation_sup.xml index 0cdaf29e3355daa53404c56af642e660d4fe294f..3a6698792c19552a35c6e59362b7c6f659fdc9da 100644 --- a/app/src/main/res/navigation/mobile_navigation_sup.xml +++ b/app/src/main/res/navigation/mobile_navigation_sup.xml @@ -3,7 +3,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/mobile_navigation_sup" - app:startDestination="@+id/navigation_edit_item"> + app:startDestination="@+id/navigation_edit_item" + app:defaultNavHost="true"> <fragment android:id="@+id/navigation_add_item" diff --git a/app/src/main/res/values-de-rDE/strings.xml b/app/src/main/res/values-de-rDE/strings.xml index 3fbde079ffa8cc1e3fc97891573198f7717e10c8..53da538314be0b5154437e758779eb8e94c13aea 100644 --- a/app/src/main/res/values-de-rDE/strings.xml +++ b/app/src/main/res/values-de-rDE/strings.xml @@ -33,4 +33,5 @@ <string name="supplier_dp">Lieferant: </string> <string name="buyamount_dp">Kaufmenge:</string> <string name="price_dp">Preis: </string> + <string name="state_dp">"Status: "</string> </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 7bd5dacb49f3552dbb5933ded59ba86c7dc83550..3ed5454901e1e9336fa155b39575c654fd451cd1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -32,4 +32,5 @@ <string name="supplier_dp">Supplier: </string> <string name="buyamount_dp">Buyamount:</string> <string name="price_dp">Price: </string> + <string name="state_dp">"State: "</string> </resources> \ No newline at end of file