From 0ed16ee0693c4ad17b80d6ec1eb174b85f36af17 Mon Sep 17 00:00:00 2001 From: Robin Koedood Date: Wed, 6 Jan 2021 12:08:25 +0100 Subject: [PATCH] [CHANGED] String values --- app/build.gradle | 4 ++++ .../java/com/a1/nextlocation/fragments/HomeFragment.java | 8 +++++--- .../main/java/com/a1/nextlocation/network/ApiHandler.java | 2 +- app/src/main/res/layout-land/fragment_location_detail.xml | 4 ++-- app/src/main/res/layout/coupon_item.xml | 2 +- app/src/main/res/layout/fragment_coupon.xml | 3 +-- app/src/main/res/layout/fragment_location.xml | 3 +-- app/src/main/res/layout/fragment_location_detail.xml | 4 ++-- app/src/main/res/layout/fragment_route.xml | 2 +- app/src/main/res/layout/fragment_route_detail.xml | 2 +- app/src/main/res/layout/fragment_settings.xml | 2 +- app/src/main/res/layout/fragment_statistic.xml | 8 ++++---- app/src/main/res/layout/location_item.xml | 2 +- app/src/main/res/layout/route_item.xml | 2 +- app/src/main/res/menu/navmenu.xml | 6 +++--- 15 files changed, 29 insertions(+), 25 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a5eb575..8bcfb89 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -53,6 +53,10 @@ dependencies { //osm bonus pack implementation 'com.github.MKergall:osmbonuspack:6.6.0' + //BeforeEach + testImplementation(platform('org.junit:junit-bom:5.7.0')) + testImplementation 'org.junit.jupiter:junit-jupiter' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' testImplementation 'org.mockito:mockito-core:2.7.22' diff --git a/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java index 1786782..9212d47 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java @@ -28,6 +28,7 @@ import com.a1.nextlocation.R; import com.a1.nextlocation.data.StaticData; import com.a1.nextlocation.json.DirectionsResult; import com.a1.nextlocation.network.ApiHandler; +import com.a1.nextlocation.network.DirectionsListener; import com.a1.nextlocation.recyclerview.LocationListManager; import org.osmdroid.api.IMapController; @@ -46,7 +47,7 @@ import org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay; import java.util.ArrayList; import java.util.List; -public class HomeFragment extends Fragment implements LocationListener{ +public class HomeFragment extends Fragment implements LocationListener, DirectionsListener { private final String userAgent = "com.ai.nextlocation.fragments"; public final static String MAPQUEST_API_KEY = "vuyXjqnAADpjeL9QwtgWGleIk95e36My"; private ImageButton imageButton; @@ -84,11 +85,12 @@ public class HomeFragment extends Fragment implements LocationListener{ ((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationFragment).addToBackStack(null).commit(); }); - ApiHandler.INSTANCE.addListener(this::onDirectionsAvailable); + ApiHandler.INSTANCE.addListener(this); return view; } - private void onDirectionsAvailable(DirectionsResult directionsResult) { + @Override + public void onDirectionsAvailable(DirectionsResult directionsResult) { Log.d(TAG, "onDirectionsAvailable: got result! " + directionsResult); ArrayList geoPoints = directionsResult.getGeoPoints(); roadOverlay = new Polyline(); diff --git a/app/src/main/java/com/a1/nextlocation/network/ApiHandler.java b/app/src/main/java/com/a1/nextlocation/network/ApiHandler.java index 570e683..00ff233 100644 --- a/app/src/main/java/com/a1/nextlocation/network/ApiHandler.java +++ b/app/src/main/java/com/a1/nextlocation/network/ApiHandler.java @@ -52,7 +52,7 @@ public enum ApiHandler { if (response.body() != null) { String responseString = Objects.requireNonNull(response.body()).string(); Log.d(TAG, "getDirections: got response: " + responseString); - + System.out.println(responseString); DirectionsResult result = new DirectionsResult(); result.parse(responseString); Log.d(TAG, "getDirections: " + result.getSteps().size()); diff --git a/app/src/main/res/layout-land/fragment_location_detail.xml b/app/src/main/res/layout-land/fragment_location_detail.xml index 6e87547..386d98a 100644 --- a/app/src/main/res/layout-land/fragment_location_detail.xml +++ b/app/src/main/res/layout-land/fragment_location_detail.xml @@ -12,7 +12,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:text="@string/locatie_detail" + android:text="" 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="@string/locatie_detail_tekst" + android:text="" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@+id/detail_location_name" /> diff --git a/app/src/main/res/layout/coupon_item.xml b/app/src/main/res/layout/coupon_item.xml index 2354e4c..76cff35 100644 --- a/app/src/main/res/layout/coupon_item.xml +++ b/app/src/main/res/layout/coupon_item.xml @@ -25,7 +25,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="20dp" - android:text="@string/naam" + android:text="" android:textColor="@color/black" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" diff --git a/app/src/main/res/layout/fragment_coupon.xml b/app/src/main/res/layout/fragment_coupon.xml index b3ac9cb..ba8db19 100644 --- a/app/src/main/res/layout/fragment_coupon.xml +++ b/app/src/main/res/layout/fragment_coupon.xml @@ -14,7 +14,7 @@ android:layout_height="wrap_content" android:layout_margin="9dp" android:layout_marginTop="20dp" - android:text="@string/statistieken" + android:text="@string/statistics" android:textSize="20sp" app:layout_constraintStart_toEndOf="@id/coupon_back_button" app:layout_constraintTop_toTopOf="parent" /> @@ -27,7 +27,6 @@ android:layout_marginTop="12dp" android:background="@drawable/ic_back_button_24" android:backgroundTint="@color/buttonColour" - android:text="@string/terug" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> diff --git a/app/src/main/res/layout/fragment_location.xml b/app/src/main/res/layout/fragment_location.xml index 7732796..a0325ba 100644 --- a/app/src/main/res/layout/fragment_location.xml +++ b/app/src/main/res/layout/fragment_location.xml @@ -14,7 +14,7 @@ android:layout_height="wrap_content" android:layout_margin="9dp" android:layout_marginTop="20dp" - android:text="@string/locaties" + android:text="@string/locations" android:textSize="20sp" app:layout_constraintStart_toEndOf="@id/location_back_button" app:layout_constraintTop_toTopOf="parent" /> @@ -27,7 +27,6 @@ android:layout_marginTop="12dp" android:background="@drawable/ic_back_button_24" android:backgroundTint="@color/buttonColour" - android:text="@string/terug" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> diff --git a/app/src/main/res/layout/fragment_location_detail.xml b/app/src/main/res/layout/fragment_location_detail.xml index 2af2f90..289ffd9 100644 --- a/app/src/main/res/layout/fragment_location_detail.xml +++ b/app/src/main/res/layout/fragment_location_detail.xml @@ -13,7 +13,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:text="@string/locatie_detail" + android:text="" 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="@string/locatie_detail_tekst" + android:text="" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/detail_location_image" /> diff --git a/app/src/main/res/layout/fragment_route.xml b/app/src/main/res/layout/fragment_route.xml index 0c79419..494defe 100644 --- a/app/src/main/res/layout/fragment_route.xml +++ b/app/src/main/res/layout/fragment_route.xml @@ -23,7 +23,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="9dp" - android:text="@string/titel" + android:text="@string/routes" android:textSize="20sp" app:layout_constraintStart_toEndOf="@id/route_back_button" app:layout_constraintTop_toTopOf="parent" /> diff --git a/app/src/main/res/layout/fragment_route_detail.xml b/app/src/main/res/layout/fragment_route_detail.xml index 6cf1a4b..735dbcf 100644 --- a/app/src/main/res/layout/fragment_route_detail.xml +++ b/app/src/main/res/layout/fragment_route_detail.xml @@ -22,7 +22,7 @@ android:id="@+id/route_title" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/titel" + android:text="" android:textSize="20sp" app:layout_constraintBottom_toTopOf="@+id/routeDetailImage" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index 751fdc9..3cc8966 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -24,7 +24,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dp" - android:text="@string/instellingen" + android:text="@string/settings" android:textColor="@color/white" android:textSize="30sp" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/fragment_statistic.xml b/app/src/main/res/layout/fragment_statistic.xml index bef7ebb..e6e1afd 100644 --- a/app/src/main/res/layout/fragment_statistic.xml +++ b/app/src/main/res/layout/fragment_statistic.xml @@ -59,7 +59,7 @@ android:id="@+id/statistics_km" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/km" + android:text="" android:textColor="@color/black" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" @@ -108,7 +108,7 @@ android:id="@+id/statistics_locations_visited" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/getal" + android:text="" android:textColor="@color/black" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" @@ -155,7 +155,7 @@ @@ -15,13 +15,13 @@