Merge remote-tracking branch 'origin/RecyclerView' into Tests
This commit is contained in:
@@ -3,10 +3,12 @@ package com.a1.nextlocation.fragments;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
@@ -16,6 +18,7 @@ public class RouteDetailFragment extends Fragment {
|
||||
|
||||
private Route route;
|
||||
private TextView routeDetailText;
|
||||
private ImageButton imageButton;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -33,6 +36,12 @@ public class RouteDetailFragment extends Fragment {
|
||||
this.routeDetailText = view.findViewById(R.id.routeDetailText);
|
||||
this.routeDetailText.setText(this.route.getName());
|
||||
|
||||
this.imageButton = view.findViewById(R.id.route_detail_back_button);
|
||||
this.imageButton.setOnClickListener(v -> {
|
||||
RouteFragment routeFragment = new RouteFragment();
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Route;
|
||||
@@ -33,6 +34,7 @@ public class RouteFragment extends Fragment {
|
||||
private RecyclerView.LayoutManager layoutManager;
|
||||
private List<Route> routeList;
|
||||
private RouteAdapter routeAdapter;
|
||||
private ImageButton imageButton;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -61,6 +63,12 @@ public class RouteFragment extends Fragment {
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeDetailFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
this.imageButton = view.findViewById(R.id.route_back_button);
|
||||
this.imageButton.setOnClickListener(v -> {
|
||||
HomeFragment homeFragment = new HomeFragment();
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
this.routeRecyclerView.setLayoutManager(this.layoutManager);
|
||||
this.routeRecyclerView.setAdapter(this.routeAdapter);
|
||||
return view;
|
||||
|
||||
@@ -5,11 +5,13 @@ import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import com.a1.nextlocation.MainActivity;
|
||||
@@ -17,6 +19,8 @@ import com.a1.nextlocation.R;
|
||||
|
||||
public class SettingsFragment extends Fragment {
|
||||
|
||||
private ImageView imageButton;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -36,6 +40,12 @@ 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.setOnClickListener(v -> {
|
||||
HomeFragment homeFragment = new HomeFragment();
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
String[] items = new String[]{"Nederlands", "Engels", "Chinees"};
|
||||
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, items);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Locatie detail"
|
||||
android:text="@string/locatie_detail"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -35,7 +35,7 @@
|
||||
android:layout_height="283dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:background="@color/secondaryColour"
|
||||
android:text="Detail tekst"
|
||||
android:text="@string/locatie_detail_tekst"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/detail_location_name" />
|
||||
|
||||
@@ -7,6 +7,19 @@
|
||||
android:background="@color/primaryColour"
|
||||
tools:context=".fragments.RouteDetailFragment">
|
||||
|
||||
<Button
|
||||
android:id="@+id/start_route_button2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/secondaryColour"
|
||||
android:text="@string/start_route"
|
||||
android:textColor="@color/buttonColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/routeDetailText"
|
||||
app:layout_constraintStart_toStartOf="@+id/routeDetailText"
|
||||
app:layout_constraintTop_toBottomOf="@+id/routeDetailText"
|
||||
app:layout_constraintVertical_bias="0.873" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/routeDetailBackButton"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -54,30 +67,4 @@
|
||||
app:layout_constraintStart_toEndOf="@id/routeDetailImage"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/startRouteButton"
|
||||
android:src="@drawable/ic_baseline_play_arrow_24"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
android:scaleX="5"
|
||||
android:scaleY="5"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginStart="350dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/startRouteText"
|
||||
app:layout_constraintEnd_toStartOf="@id/startRouteText"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/startRouteText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/startRouteText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:text="@string/start_route"
|
||||
android:textSize="50sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/startRouteButton"
|
||||
app:layout_constraintTop_toBottomOf="@id/routeDetailImage" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -59,7 +59,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="25dp"
|
||||
android:textSize="25sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/top_bar"
|
||||
app:layout_constraintStart_toEndOf="@id/info_button"
|
||||
app:layout_constraintTop_toTopOf="@id/top_bar" />
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:text="Naam"
|
||||
android:text="@string/naam"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="9dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="Statistics"
|
||||
android:text="@string/statistieken"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintStart_toEndOf="@id/coupon_back_button"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -27,7 +27,7 @@
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/ic_back_button_24"
|
||||
android:backgroundTint="@color/buttonColour"
|
||||
android:text="Back"
|
||||
android:text="@string/terug"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="9dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="Locations"
|
||||
android:text="@string/locaties"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintStart_toEndOf="@id/location_back_button"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -27,7 +27,7 @@
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/ic_back_button_24"
|
||||
android:backgroundTint="@color/buttonColour"
|
||||
android:text="Back"
|
||||
android:text="@string/terug"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Locatie detail"
|
||||
android:text="@string/locatie_detail"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -36,7 +36,7 @@
|
||||
android:layout_margin="20dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/secondaryColour"
|
||||
android:text="Detail tekst"
|
||||
android:text="@string/locatie_detail_tekst"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/detail_location_image" />
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="9dp"
|
||||
android:text="titel"
|
||||
android:text="@string/titel"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintStart_toEndOf="@id/route_back_button"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -9,21 +9,20 @@
|
||||
tools:context=".fragments.RouteDetailFragment">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/routeDetailBackButton"
|
||||
android:id="@+id/route_detail_back_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="100dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/ic_back_button_24"
|
||||
app:layout_constraintBottom_toBottomOf="@id/route_title"
|
||||
app:layout_constraintEnd_toStartOf="@id/route_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/route_title" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/route_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="titel"
|
||||
android:text="@string/titel"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/routeDetailImage"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -35,7 +34,7 @@
|
||||
android:layout_height="250dp"
|
||||
android:layout_margin="40dp"
|
||||
android:id="@+id/routeDetailImage"
|
||||
app:layout_constraintTop_toBottomOf="@id/routeDetailBackButton"
|
||||
app:layout_constraintTop_toBottomOf="@id/route_detail_back_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/routeDetailText"
|
||||
@@ -57,7 +56,7 @@
|
||||
android:id="@+id/start_route_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Start Route"
|
||||
android:text="@string/start_route"
|
||||
android:backgroundTint="@color/secondaryColour"
|
||||
android:textColor="@color/buttonColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -9,21 +9,22 @@
|
||||
tools:context=".fragments.SettingsFragment">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/settings_back_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
android:src="@drawable/ic_back_button_24"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/textView"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/textView" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/settings"
|
||||
android:text="@string/instellingen"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" km"
|
||||
android:text="@string/km"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -106,7 +106,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="GETAL"
|
||||
android:text="@string/getal"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -153,7 +153,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" minuten"
|
||||
android:text="@string/minuten"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -203,7 +203,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/couponAmount"
|
||||
android:text="GETAL"
|
||||
android:text="@string/getal"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -213,4 +213,14 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/imageButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:src="@drawable/ic_back_button_24"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -19,9 +19,13 @@
|
||||
android:id="@+id/location_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="294dp"
|
||||
android:gravity="center"
|
||||
android:text="location"
|
||||
android:textSize="20dp"
|
||||
app:layout_constraintStart_toEndOf="@+id/route_Image" />
|
||||
android:text="@string/locaties"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
@@ -16,13 +17,14 @@
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/route_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/route_name"
|
||||
android:text="test text"
|
||||
android:gravity="center"
|
||||
android:textSize="20dp"
|
||||
android:text="@string/titel"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/route_Image"
|
||||
/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/locations"
|
||||
android:title="@string/locations"
|
||||
android:title="@string/locaties"
|
||||
android:icon="@drawable/ic_baseline_outlined_flag_24"
|
||||
/>
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/statistics"
|
||||
android:title="@string/statistics"
|
||||
android:title="@string/statistieken"
|
||||
android:icon="@drawable/ic_baseline_graphic_eq_24"
|
||||
/>
|
||||
|
||||
<item
|
||||
android:id="@+id/settings"
|
||||
android:title="@string/settings"
|
||||
android:title="@string/instellingen"
|
||||
android:icon="@drawable/ic_baseline_settings_24"
|
||||
/>
|
||||
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
<resources>
|
||||
<string name="app_name">Next Location</string>
|
||||
<!-- TODO: Remove or change this placeholder text -->
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
<string name="locations">Locaties</string>
|
||||
<string name="locaties">Locaties</string>
|
||||
<string name="routes">Routes</string>
|
||||
<string name="statistics">Statistieken</string>
|
||||
<string name="settings">Instellingen</string>
|
||||
<string name="statistieken">Statistieken</string>
|
||||
<string name="instellingen">Instellingen</string>
|
||||
<string name="taal">Taal</string>
|
||||
<string name="imperiaal_systeem">Imperiaal systeem</string>
|
||||
<string name="_65_stand">65+ stand</string>
|
||||
<string name="kleurenblind">Kleurenblind</string>
|
||||
<string name="statistieken">Statistieken</string>
|
||||
<string name="totale_afstand">Totale afstand:</string>
|
||||
<string name="bezochte_locaties">Bezochte locaties:</string>
|
||||
<string name="totale_tijd">Totale tijd:</string>
|
||||
<string name="coupons_gespaard">Coupons gespaard:</string>
|
||||
<string name="coupons">Coupons</string>
|
||||
<string name="start_route">Start Route</string>
|
||||
<string name="naam">Naam</string>
|
||||
<string name="terug">Terug</string>
|
||||
<string name="locatie_detail">Locatie Detail</string>
|
||||
<string name="locatie_detail_tekst">Detail tekst</string>
|
||||
<string name="titel">Titel</string>
|
||||
<string name="km">Kilometer</string>
|
||||
<string name="getal">Getal</string>
|
||||
<string name="minuten">Minuten</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user