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

bugfixes in navigation

parent b9f87813
No related branches found
No related tags found
1 merge request!1Mal aufn Master megren
......@@ -25,7 +25,7 @@ private ActivityCustomerBinding binding;
binding = ActivityCustomerBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
Log.d("myTag", "This is my Deliverer");
Log.d("myTag", "This is my Costumer");
// Fragment "fragment_decide" wird angezeigt
......
......@@ -48,33 +48,34 @@ public class DecideFragment extends Fragment {
}
});
Button button2 = rootView.findViewById(R.id.DelivererButton);
Button button2 = rootView.findViewById(R.id.SupplierButton);
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentManager fragmentManager = requireActivity().getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.container, new DelivererLogonFragment());
fragmentTransaction.replace(R.id.container, new SupplierLogonFragment());
fragmentTransaction.addToBackStack(null); // Fügt den Fragment-Wechsel zur Back-Stack hinzu
fragmentTransaction.commit();
}
});
Button button3 = rootView.findViewById(R.id.SupplierButton);
Button button3 = rootView.findViewById(R.id.DelivererButton);
button3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FragmentManager fragmentManager = requireActivity().getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.container, new SupplierLogonFragment());
fragmentTransaction.replace(R.id.container, new DelivererLogonFragment());
fragmentTransaction.addToBackStack(null); // Fügt den Fragment-Wechsel zur Back-Stack hinzu
fragmentTransaction.commit();
}
});
return rootView;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
......
......@@ -19,6 +19,7 @@ import android.widget.Button;
import com.example.mampfmobil.R;
import com.example.mampfmobil.ui.CustomerActivity;
import com.example.mampfmobil.ui.SupplierActivity;
import com.example.mampfmobil.ui.deliverer.DelivererLogonFragment;
public class SupplierLogonFragment extends Fragment {
......@@ -35,13 +36,12 @@ public class SupplierLogonFragment extends Fragment {
View rootView = inflater.inflate(R.layout.fragment_supplier_logon, container, false);
Button button = rootView.findViewById(R.id.buttonRegister);
Log.d("myTag", "This is my Click2"+button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Wechsel zum anderen Fragment
Log.d("myTag", "This is my Click");
Intent intent = new Intent(getActivity(), CustomerActivity.class);
Intent intent = new Intent(getActivity(), SupplierActivity.class);
startActivity(intent);
}
});
......
......@@ -13,7 +13,7 @@
<string name="shop">Laden</string>
<string name="statistics">Statistiken</string>
<string name="add_Item">Hinzufügen"</string>
<string name="edit_Item">Bearbeiten"</string>
<string name="edit_Item">Übersicht/Bearbeiten"</string>
<string name="open_orders">offene Bestellungen</string>
<string name="active_orders">aktive Bestellungen</string>
<string name="closed_orders">Geschlossene Bestellungen</string>
......
......@@ -12,7 +12,7 @@
<string name="shop">Shop</string>
<string name="statistics">Statistics</string>
<string name="add_Item">Add Item</string>
<string name="edit_Item">Edit Item</string>
<string name="edit_Item">Overview/Edit</string>
<string name="open_orders">Open Orders</string>
<string name="active_orders">Active Orders</string>
<string name="closed_orders">Closed Orders</string>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment