From 21183368155af4e6cc66da713e3fc28fdbf00b4a Mon Sep 17 00:00:00 2001 From: RemoMeijer Date: Mon, 4 Jan 2021 11:40:06 +0100 Subject: [PATCH] Switching fragment from statistics to coupon works --- .../java/com/a1/nextlocation/fragments/CouponFragment.java | 2 +- .../com/a1/nextlocation/fragments/StatisticFragment.java | 7 ++++--- app/src/main/res/layout/fragment_coupon.xml | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) 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 b31f5f2..675709e 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/CouponFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/CouponFragment.java @@ -34,7 +34,7 @@ public class CouponFragment extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_coupon, container, false); - this.couponRecyclerView = view.findViewById(R.id.routeRecyclerView); + this.couponRecyclerView = view.findViewById(R.id.couponRecyclerView); this.couponRecyclerView.setHasFixedSize(true); this.layoutManager = new LinearLayoutManager(this.getContext()); diff --git a/app/src/main/java/com/a1/nextlocation/fragments/StatisticFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/StatisticFragment.java index ab14bff..a6f5bae 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/StatisticFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/StatisticFragment.java @@ -5,6 +5,7 @@ import android.os.Bundle; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; +import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; @@ -18,13 +19,13 @@ public class StatisticFragment extends Fragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - } @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_statistic, container, false); + + ConstraintLayout constraintLayout = view.findViewById(R.id.Box4); constraintLayout.setOnClickListener(v -> { CouponFragment couponFragment = new CouponFragment(); diff --git a/app/src/main/res/layout/fragment_coupon.xml b/app/src/main/res/layout/fragment_coupon.xml index 2a73bb5..bdbbc67 100644 --- a/app/src/main/res/layout/fragment_coupon.xml +++ b/app/src/main/res/layout/fragment_coupon.xml @@ -12,7 +12,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="9dp" - android:text="Locations" + android:text="Statistics" android:textSize="20sp" app:layout_constraintStart_toEndOf="@id/couponBackButton" app:layout_constraintTop_toTopOf="parent" /> @@ -31,7 +31,7 @@