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

keine Ahnung was

parent 4b1d5ca1
Branches
No related tags found
1 merge request!1Mal aufn Master megren
Showing
with 58 additions and 11 deletions
......@@ -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);
}
......
......
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;
}
......
......
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;
}
......
......
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;
}
......
......
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);
}
......
......
......@@ -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"
......
......
......@@ -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" />
......
......
......@@ -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"
......
......
......@@ -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"
......
......
......@@ -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"
......
......
......@@ -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
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment