Merge branch 'RecyclerView' into follow-route

# Conflicts:
#	app/src/main/assets/locations.json
#	app/src/main/assets/routes.json
#	app/src/main/java/com/a1/nextlocation/fragments/LocationDetailFragment.java
#	app/src/main/java/com/a1/nextlocation/fragments/RouteDetailFragment.java
#	app/src/main/res/values/strings.xml
This commit is contained in:
RemoMeijer
2021-01-06 13:20:52 +01:00
44 changed files with 233 additions and 115 deletions

View File

@@ -15,21 +15,14 @@ public class Route implements Parcelable {
@NonNull @NonNull
private String name; private String name;
private String description;
private List<Location> locations; private List<Location> locations;
private float totalDistance; private float totalDistance;
private int totalTime; private int totalTime;
public Route(@NotNull String name) { public Route(@NotNull String name) {
this.name = name; this.name = name;
this.locations = new ArrayList<>(); this.locations = new ArrayList<>();
} }
protected Route(Parcel in) { protected Route(Parcel in) {
@@ -103,4 +96,12 @@ public class Route implements Parcelable {
parcel.writeFloat(totalDistance); parcel.writeFloat(totalDistance);
parcel.writeInt(totalTime); parcel.writeInt(totalTime);
} }
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
} }

View File

@@ -41,18 +41,18 @@ public class CouponFragment extends Fragment {
this.couponRecyclerView.setHasFixedSize(true); this.couponRecyclerView.setHasFixedSize(true);
this.layoutManager = new LinearLayoutManager(this.getContext()); 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.setContext(this.getContext());
CouponListManager.INSTANCE.load(); CouponListManager.INSTANCE.load();
this.couponList = CouponListManager.INSTANCE.getCouponList(); this.couponList = CouponListManager.INSTANCE.getCouponList();
this.couponAdapter = new CouponAdapter(this.getContext(), this.couponList, clickedPosition -> showPopup(this.couponList.get(clickedPosition))); 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.setLayoutManager(this.layoutManager);
this.couponRecyclerView.setAdapter(this.couponAdapter); this.couponRecyclerView.setAdapter(this.couponAdapter);
return view; return view;

View File

@@ -1,5 +1,6 @@
package com.a1.nextlocation.fragments; package com.a1.nextlocation.fragments;
import android.media.Image;
import android.os.Bundle; import android.os.Bundle;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
@@ -52,8 +53,10 @@ public class LocationFragment extends Fragment {
this.locationAdapter = new LocationAdapter(this.getContext(), this.locationList, clickedPosition -> { this.locationAdapter = new LocationAdapter(this.getContext(), this.locationList, clickedPosition -> {
LocationDetailFragment locationDetailFragment = new LocationDetailFragment(); LocationDetailFragment locationDetailFragment = new LocationDetailFragment();
locationDetailFragment.setLocation(this.locationList.get(clickedPosition));
Bundle locationBundle = new Bundle(); Bundle locationBundle = new Bundle();
locationBundle.putParcelable("location", this.locationList.get(clickedPosition)); locationBundle.putParcelable("location", this.locationList.get(clickedPosition));
locationDetailFragment.setLocation(this.locationList.get(clickedPosition));
locationDetailFragment.setArguments(locationBundle); locationDetailFragment.setArguments(locationBundle);
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationDetailFragment).addToBackStack(null).commit(); ((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationDetailFragment).addToBackStack(null).commit();
}); });

View File

@@ -13,6 +13,7 @@ import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageButton;
import com.a1.nextlocation.R; import com.a1.nextlocation.R;
import com.a1.nextlocation.data.Route; import com.a1.nextlocation.data.Route;
@@ -33,6 +34,7 @@ public class RouteFragment extends Fragment {
private RecyclerView.LayoutManager layoutManager; private RecyclerView.LayoutManager layoutManager;
private List<Route> routeList; private List<Route> routeList;
private RouteAdapter routeAdapter; private RouteAdapter routeAdapter;
private ImageButton imageButton;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@@ -60,6 +62,12 @@ public class RouteFragment extends Fragment {
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeDetailFragment).addToBackStack(null).commit(); ((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.setLayoutManager(this.layoutManager);
this.routeRecyclerView.setAdapter(this.routeAdapter); this.routeRecyclerView.setAdapter(this.routeAdapter);
return view; return view;

View File

@@ -1,15 +1,19 @@
package com.a1.nextlocation.fragments; package com.a1.nextlocation.fragments;
import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.widget.SwitchCompat;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.Spinner; import android.widget.Spinner;
import com.a1.nextlocation.MainActivity; import com.a1.nextlocation.MainActivity;
@@ -17,6 +21,10 @@ import com.a1.nextlocation.R;
public class SettingsFragment extends Fragment { public class SettingsFragment extends Fragment {
private ImageView imageButton;
SwitchCompat fontChanger;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@@ -36,6 +44,41 @@ public class SettingsFragment extends Fragment {
// Inflate the layout for this fragment // Inflate the layout for this fragment
Spinner dropdown = view.findViewById(R.id.dropdown_menu_Settings); Spinner dropdown = view.findViewById(R.id.dropdown_menu_Settings);
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();
});
fontChanger = view.findViewById(R.id.BigFont);
SharedPreferences sharedPreferences = requireActivity().getSharedPreferences("com.a1.nextlocation",0);
SharedPreferences.Editor editor = sharedPreferences.edit();
fontChanger.setChecked(sharedPreferences.getBoolean("switch", false));
if (fontChanger.isChecked()){
requireActivity().setTheme(R.style.Theme_NextLocationBig);
}else if (!fontChanger.isChecked()){
requireActivity().setTheme(R.style.Theme_NextLocation);
}
fontChanger.setOnClickListener(view1 -> {
if(fontChanger.isChecked())
{
requireActivity().setTheme(R.style.Theme_NextLocationBig);
editor.putBoolean("switch",true);
editor.apply();
}
if(!fontChanger.isChecked())
{
requireActivity().setTheme(R.style.Theme_NextLocation);
editor.putBoolean("switch",false);
editor.apply();
}
editor.commit();
});
String[] items = new String[]{"Nederlands", "Engels", "Chinees"}; String[] items = new String[]{"Nederlands", "Engels", "Chinees"};
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, items); ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, items);

View File

@@ -26,6 +26,7 @@ public class StatisticFragment extends Fragment {
private List<Coupon> couponList; private List<Coupon> couponList;
private ImageView imageButton; private ImageView imageButton;
private ImageView couponButton;
@Override @Override
@@ -50,6 +51,18 @@ public class StatisticFragment extends Fragment {
couponNumber.setText(String.valueOf(adapter.getItemCount())); couponNumber.setText(String.valueOf(adapter.getItemCount()));
this.imageButton = view.findViewById(R.id.statistics_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.couponButton = view.findViewById(R.id.coupon_button);
this.couponButton.setOnClickListener(v -> {
CouponFragment couponFragment = new CouponFragment();
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, couponFragment).addToBackStack(null).commit();
});
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

@@ -4,6 +4,7 @@ import android.content.Context;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
@@ -27,10 +28,12 @@ public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.Locati
class LocationViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { class LocationViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private TextView locationName; private TextView locationName;
private ImageView locationImage;
public LocationViewHolder(@NonNull View itemView) { public LocationViewHolder(@NonNull View itemView) {
super(itemView); super(itemView);
this.locationName = itemView.findViewById(R.id.location_name); this.locationName = itemView.findViewById(R.id.location_name);
this.locationImage = itemView.findViewById(R.id.location_image);
itemView.setOnClickListener(this); itemView.setOnClickListener(this);
} }
@@ -43,6 +46,13 @@ public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.Locati
this.locationName = itemView.findViewById(R.id.location_name); this.locationName = itemView.findViewById(R.id.location_name);
locationName.setText(text); locationName.setText(text);
} }
public void setImageViewImage(String text){
this.locationImage = itemView.findViewById(R.id.location_image);
Context context = locationImage.getContext();
int id = context.getResources().getIdentifier(text, "drawable", context.getPackageName());
locationImage.setImageResource(id);
}
} }
public LocationAdapter(Context context, List<Location> location, OnItemClickListener listener){ public LocationAdapter(Context context, List<Location> location, OnItemClickListener listener){
@@ -62,6 +72,7 @@ public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.Locati
public void onBindViewHolder(@NonNull LocationAdapter.LocationViewHolder holder, int position) { public void onBindViewHolder(@NonNull LocationAdapter.LocationViewHolder holder, int position) {
Location location = locationList.get(position); Location location = locationList.get(position);
holder.setTextViewText(location.getName()); holder.setTextViewText(location.getName());
holder.setImageViewImage(location.getImageUrl());
} }
@Override @Override

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

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_marginTop="16dp" android:layout_marginTop="16dp"
android:text="Locatie detail" android:text="@string/locatie_detail"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="30sp" android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@@ -35,7 +35,7 @@
android:layout_height="283dp" android:layout_height="283dp"
android:layout_marginEnd="30dp" android:layout_marginEnd="30dp"
android:background="@color/secondaryColour" android:background="@color/secondaryColour"
android:text="Detail tekst" android:text="@string/locatie_detail_tekst"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/detail_location_name" /> app:layout_constraintTop_toBottomOf="@+id/detail_location_name" />

View File

@@ -7,6 +7,19 @@
android:background="@color/primaryColour" android:background="@color/primaryColour"
tools:context=".fragments.RouteDetailFragment"> 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/reoute_detail_tekst"
app:layout_constraintStart_toStartOf="@+id/reoute_detail_tekst"
app:layout_constraintTop_toBottomOf="@+id/reoute_detail_tekst"
app:layout_constraintVertical_bias="0.873" />
<ImageButton <ImageButton
android:id="@+id/routeDetailBackButton" android:id="@+id/routeDetailBackButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -26,13 +39,13 @@
android:layout_marginEnd="250dp" android:layout_marginEnd="250dp"
android:text="titel" android:text="titel"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@+id/routeDetailImage" app:layout_constraintBottom_toTopOf="@+id/route_detail_image"
app:layout_constraintEnd_toStartOf="@+id/routeDetailText" app:layout_constraintEnd_toStartOf="@+id/reoute_detail_tekst"
app:layout_constraintStart_toEndOf="@id/routeDetailBackButton" app:layout_constraintStart_toEndOf="@id/routeDetailBackButton"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
android:id="@+id/routeDetailImage" android:id="@+id/route_detail_image"
android:layout_width="250dp" android:layout_width="250dp"
android:layout_height="250dp" android:layout_height="250dp"
android:layout_marginEnd="350dp" android:layout_marginEnd="350dp"
@@ -42,7 +55,7 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/routeDetailText" android:id="@+id/reoute_detail_tekst"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="10dp" android:layout_height="10dp"
android:layout_marginStart="50dp" android:layout_marginStart="50dp"
@@ -51,33 +64,7 @@
android:text="" android:text=""
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/routeDetailImage" app:layout_constraintStart_toEndOf="@id/route_detail_image"
app:layout_constraintTop_toTopOf="parent" /> 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> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -58,7 +58,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/app_name" android:text="@string/app_name"
android:textColor="@color/secondaryColour" android:textColor="@color/secondaryColour"
android:textSize="25dp" android:textSize="25sp"
app:layout_constraintBottom_toBottomOf="@id/top_bar" app:layout_constraintBottom_toBottomOf="@id/top_bar"
app:layout_constraintStart_toEndOf="@id/info_button" app:layout_constraintStart_toEndOf="@id/info_button"
app:layout_constraintTop_toTopOf="@id/top_bar" /> app:layout_constraintTop_toTopOf="@id/top_bar" />

View File

@@ -24,7 +24,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:text="Naam" android:text="@string/naam"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"

View File

@@ -13,7 +13,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="9dp" android:layout_margin="9dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:text="Statistics" android:text="@string/statistieken"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintStart_toEndOf="@id/coupon_back_button" app:layout_constraintStart_toEndOf="@id/coupon_back_button"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@@ -26,7 +26,7 @@
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:background="@drawable/ic_back_button_24" android:background="@drawable/ic_back_button_24"
android:backgroundTint="@color/buttonColour" android:backgroundTint="@color/buttonColour"
android:text="Back" android:text="@string/terug"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />

View File

@@ -13,7 +13,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="9dp" android:layout_margin="9dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:text="Locations" android:text="@string/locaties"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintStart_toEndOf="@id/location_back_button" app:layout_constraintStart_toEndOf="@id/location_back_button"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@@ -26,7 +26,7 @@
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:background="@drawable/ic_back_button_24" android:background="@drawable/ic_back_button_24"
android:backgroundTint="@color/buttonColour" android:backgroundTint="@color/buttonColour"
android:text="Back" android:text="@string/terug"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />

View File

@@ -9,12 +9,13 @@
<TextView <TextView
android:id="@+id/detail_location_name" android:id="@+id/detail_location_name"
android:layout_width="wrap_content" android:layout_width="300dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:text="Locatie detail" android:text="@string/locatie_detail"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="30sp" android:textSize="30sp"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@@ -29,16 +30,24 @@
app:layout_constraintTop_toBottomOf="@+id/detail_location_name" app:layout_constraintTop_toBottomOf="@+id/detail_location_name"
tools:src="@tools:sample/avatars" /> tools:src="@tools:sample/avatars" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_margin="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/detail_location_image">
<TextView <TextView
android:id="@+id/detail_location_text" android:id="@+id/detail_location_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_margin="20dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/secondaryColour" android:background="@color/secondaryColour"
android:text="Detail tekst" android:text="@string/locatie_detail_tekst"
app:layout_constraintEnd_toEndOf="parent" />
app:layout_constraintStart_toStartOf="parent" </ScrollView>
app:layout_constraintTop_toBottomOf="@+id/detail_location_image" />
<ImageButton <ImageButton
android:id="@+id/detail_location_back_button" android:id="@+id/detail_location_back_button"

View File

@@ -13,7 +13,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="10dp" android:layout_margin="10dp"
android:background="@drawable/ic_back_button_24" android:background="@drawable/ic_back_button_24"
android:text="Back" android:text="@string/terug"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@@ -22,7 +22,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="titel" android:text="@string/titel"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintStart_toEndOf="@id/route_back_button" app:layout_constraintStart_toEndOf="@id/route_back_button"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />

View File

@@ -8,23 +8,22 @@
tools:context=".fragments.RouteDetailFragment"> tools:context=".fragments.RouteDetailFragment">
<ImageButton <ImageButton
android:id="@+id/routeDetailBackButton" android:id="@+id/route_detail_back_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="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" 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_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/route_title" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/route_title" android:id="@+id/route_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="titel" android:text="@string/titel"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@+id/routeDetailImage" app:layout_constraintBottom_toTopOf="@+id/route_detail_image"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@@ -33,16 +32,16 @@
android:layout_width="250dp" android:layout_width="250dp"
android:layout_height="250dp" android:layout_height="250dp"
android:layout_margin="40dp" android:layout_margin="40dp"
android:id="@+id/routeDetailImage" android:id="@+id/route_detail_image"
app:layout_constraintTop_toBottomOf="@id/routeDetailBackButton" app:layout_constraintTop_toBottomOf="@id/route_detail_back_button"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/routeDetailText" app:layout_constraintBottom_toTopOf="@id/reoute_detail_tekst"
/> />
<TextView <TextView
android:id="@+id/routeDetailText" android:id="@+id/reoute_detail_tekst"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp" android:layout_marginHorizontal="20dp"
@@ -50,20 +49,20 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.6" app:layout_constraintHorizontal_bias="0.6"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/routeDetailImage" /> app:layout_constraintTop_toBottomOf="@id/route_detail_image" />
<Button <Button
android:id="@+id/start_route_button" android:id="@+id/start_route_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Start Route" android:text="@string/start_route"
android:backgroundTint="@color/secondaryColour" android:backgroundTint="@color/secondaryColour"
android:textColor="@color/buttonColour" android:textColor="@color/buttonColour"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498" app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/routeDetailText" app:layout_constraintTop_toBottomOf="@+id/reoute_detail_tekst"
app:layout_constraintVertical_bias="0.671" /> app:layout_constraintVertical_bias="0.671" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -8,21 +8,22 @@
tools:context=".fragments.SettingsFragment"> tools:context=".fragments.SettingsFragment">
<androidx.appcompat.widget.AppCompatImageButton <androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/settings_back_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:backgroundTint="@color/primaryColour" android:backgroundTint="@color/primaryColour"
android:src="@drawable/ic_back_button_24" 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_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/textView" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/textView" android:id="@+id/textView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:text="@string/settings" android:text="@string/instellingen"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="30sp" android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@@ -159,6 +160,7 @@
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/BigFont"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/Balk3" app:layout_constraintStart_toStartOf="@id/Balk3"

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/primaryColour" android:background="@color/primaryColour"
tools:context=".fragments.StatisticFragment"> tools:context=".fragments.StatisticFragment">
@@ -23,12 +23,12 @@
android:id="@+id/name_box" android:id="@+id/name_box"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="70dp"
android:layout_marginHorizontal="20dp"
android:background="@color/secondaryColour"
app:layout_constraintBottom_toTopOf="@id/Box2" app:layout_constraintBottom_toTopOf="@id/Box2"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textView" app:layout_constraintTop_toBottomOf="@id/textView"
android:background="@color/secondaryColour"
android:layout_marginHorizontal="20dp"
> >
@@ -51,14 +51,13 @@
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"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent" />
/>
<TextView <TextView
android:id="@+id/statistics_km" android:id="@+id/statistics_km"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text=" km" android:text="@string/km"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
@@ -107,7 +106,7 @@
android:id="@+id/statistics_locations_visited" android:id="@+id/statistics_locations_visited"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="GETAL" android:text="@string/getal"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
@@ -127,8 +126,7 @@
app:layout_constraintBottom_toTopOf="@id/Box4" app:layout_constraintBottom_toTopOf="@id/Box4"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/Box2" app:layout_constraintTop_toBottomOf="@id/Box2">
>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -154,7 +152,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text=" minuten" android:text="@string/minuten"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
@@ -169,14 +167,14 @@
android:id="@+id/Box4" android:id="@+id/Box4"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="70dp"
android:layout_marginHorizontal="20dp"
android:background="@color/secondaryColour"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.85"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/Box3"
android:background="@color/secondaryColour"
android:layout_marginHorizontal="20dp"
> app:layout_constraintTop_toBottomOf="@id/Box3">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -197,14 +195,13 @@
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"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent" />
/>
<TextView <TextView
android:id="@+id/couponAmount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/couponAmount" android:text="@string/getal"
android:text="GETAL"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
@@ -212,6 +209,31 @@
app:layout_constraintStart_toStartOf="@id/Balk4" app:layout_constraintStart_toStartOf="@id/Balk4"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/coupon_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:background="@drawable/ic_back_button_24"
android:scaleX="-1"
android:text="@string/terug"
app:layout_constraintBottom_toBottomOf="@+id/couponAmount"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/couponAmount" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<ImageButton
android:id="@+id/statistics_back_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/ic_back_button_24"
android:backgroundTint="@color/buttonColour"
android:src="@drawable/ic_back_button_24"
android:text="@string/terug"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <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_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
@@ -7,20 +8,26 @@
android:layout_margin="20dp"> android:layout_margin="20dp">
<ImageView <ImageView
android:id="@+id/location_image"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:id="@+id/location_image"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
/> app:layout_constraintEnd_toStartOf="@id/location_name"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0" />
<TextView <TextView
android:id="@+id/location_name" android:id="@+id/location_name"
android:layout_width="wrap_content" android:layout_width="321dp"
android:layout_height="match_parent" android:layout_height="47dp"
android:gravity="center" android:gravity="left"
android:text="location" android:text="@string/locaties"
android:textSize="20dp" android:textSize="20sp"
app:layout_constraintStart_toEndOf="@+id/route_Image" /> app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <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_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
@@ -15,13 +16,14 @@
/> />
<TextView <TextView
android:id="@+id/route_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/route_name"
android:text="test text"
android:gravity="center" 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_constraintStart_toEndOf="@+id/route_Image"
/> app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -3,7 +3,7 @@
<item <item
android:id="@+id/locations" android:id="@+id/locations"
android:title="@string/locations" android:title="@string/locaties"
android:icon="@drawable/ic_baseline_outlined_flag_24" android:icon="@drawable/ic_baseline_outlined_flag_24"
/> />
@@ -15,13 +15,13 @@
<item <item
android:id="@+id/statistics" android:id="@+id/statistics"
android:title="@string/statistics" android:title="@string/statistieken"
android:icon="@drawable/ic_baseline_graphic_eq_24" android:icon="@drawable/ic_baseline_graphic_eq_24"
/> />
<item <item
android:id="@+id/settings" android:id="@+id/settings"
android:title="@string/settings" android:title="@string/instellingen"
android:icon="@drawable/ic_baseline_settings_24" android:icon="@drawable/ic_baseline_settings_24"
/> />

View File

@@ -7,5 +7,16 @@
<item name="colorSecondary">@color/secondaryColour</item> <item name="colorSecondary">@color/secondaryColour</item>
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="colorButtonNormal">@color/buttonColour</item> <item name="colorButtonNormal">@color/buttonColour</item>
<item name="android:textSize">16sp</item>
</style>
<style name="Theme.NextLocationBig" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/primaryColour</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/secondaryColour</item>
<!-- Customize your theme here. -->
<item name="colorButtonNormal">@color/buttonColour</item>
<item name="android:textSize">24sp</item>
</style> </style>
</resources> </resources>