diff --git a/app/src/main/java/com/a1/nextlocation/fragments/CouponFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/CouponFragment.java index 984e38c..c822134 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/CouponFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/CouponFragment.java @@ -41,18 +41,18 @@ public class CouponFragment extends Fragment { this.couponRecyclerView.setHasFixedSize(true); this.layoutManager = new LinearLayoutManager(this.getContext()); - this.imageButton = view.findViewById(R.id.coupon_back_button); - this.imageButton.setOnClickListener(v -> { - StatisticFragment statisticFragment = new StatisticFragment(); - ((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, statisticFragment).addToBackStack(null).commit(); - }); - CouponListManager.INSTANCE.setContext(this.getContext()); CouponListManager.INSTANCE.load(); this.couponList = CouponListManager.INSTANCE.getCouponList(); this.couponAdapter = new CouponAdapter(this.getContext(), this.couponList, clickedPosition -> showPopup(this.couponList.get(clickedPosition))); + this.imageButton = view.findViewById(R.id.coupon_back_button); + this.imageButton.setOnClickListener(v -> { + StatisticFragment statisticFragment = new StatisticFragment(); + ((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, statisticFragment).addToBackStack(null).commit(); + }); + this.couponRecyclerView.setLayoutManager(this.layoutManager); this.couponRecyclerView.setAdapter(this.couponAdapter); return view; diff --git a/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java index 106c93a..9c656e2 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java @@ -43,7 +43,7 @@ public class SettingsFragment extends Fragment { // Inflate the layout for this fragment Spinner dropdown = view.findViewById(R.id.dropdown_menu_Settings); - this.imageButton = view.findViewById(R.id.route_detail_back_button); + this.imageButton = view.findViewById(R.id.settings_back_button); this.imageButton.setOnClickListener(v -> { HomeFragment homeFragment = new HomeFragment(); ((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit(); diff --git a/app/src/main/res/layout/location_item.xml b/app/src/main/res/layout/location_item.xml index d33b5f0..d164865 100644 --- a/app/src/main/res/layout/location_item.xml +++ b/app/src/main/res/layout/location_item.xml @@ -1,5 +1,6 @@ + app:layout_constraintEnd_toStartOf="@id/location_name" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="1.0" />