Switching fragment from statistics to coupon works

This commit is contained in:
RemoMeijer
2021-01-04 11:40:06 +01:00
parent ff32eefab0
commit 2118336815
3 changed files with 7 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ public class CouponFragment extends Fragment {
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_coupon, container, false); 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.couponRecyclerView.setHasFixedSize(true);
this.layoutManager = new LinearLayoutManager(this.getContext()); this.layoutManager = new LinearLayoutManager(this.getContext());

View File

@@ -5,6 +5,7 @@ import android.os.Bundle;
import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@@ -18,13 +19,13 @@ public class StatisticFragment extends Fragment {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} }
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_statistic, container, false); View view = inflater.inflate(R.layout.fragment_statistic, container, false);
ConstraintLayout constraintLayout = view.findViewById(R.id.Box4); ConstraintLayout constraintLayout = view.findViewById(R.id.Box4);
constraintLayout.setOnClickListener(v -> { constraintLayout.setOnClickListener(v -> {
CouponFragment couponFragment = new CouponFragment(); CouponFragment couponFragment = new CouponFragment();

View File

@@ -12,7 +12,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="9dp" android:layout_margin="9dp"
android:text="Locations" android:text="Statistics"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintStart_toEndOf="@id/couponBackButton" app:layout_constraintStart_toEndOf="@id/couponBackButton"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@@ -31,7 +31,7 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:id="@+id/locationRecyclerView" android:id="@+id/couponRecyclerView"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"