[CHANGED] String values

This commit is contained in:
Robin Koedood
2021-01-06 12:08:25 +01:00
parent 525d4b776d
commit 0ed16ee069
15 changed files with 29 additions and 25 deletions

View File

@@ -53,6 +53,10 @@ dependencies {
//osm bonus pack //osm bonus pack
implementation 'com.github.MKergall:osmbonuspack:6.6.0' 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.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
testImplementation 'org.mockito:mockito-core:2.7.22' testImplementation 'org.mockito:mockito-core:2.7.22'

View File

@@ -28,6 +28,7 @@ import com.a1.nextlocation.R;
import com.a1.nextlocation.data.StaticData; import com.a1.nextlocation.data.StaticData;
import com.a1.nextlocation.json.DirectionsResult; import com.a1.nextlocation.json.DirectionsResult;
import com.a1.nextlocation.network.ApiHandler; import com.a1.nextlocation.network.ApiHandler;
import com.a1.nextlocation.network.DirectionsListener;
import com.a1.nextlocation.recyclerview.LocationListManager; import com.a1.nextlocation.recyclerview.LocationListManager;
import org.osmdroid.api.IMapController; import org.osmdroid.api.IMapController;
@@ -46,7 +47,7 @@ import org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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"; private final String userAgent = "com.ai.nextlocation.fragments";
public final static String MAPQUEST_API_KEY = "vuyXjqnAADpjeL9QwtgWGleIk95e36My"; public final static String MAPQUEST_API_KEY = "vuyXjqnAADpjeL9QwtgWGleIk95e36My";
private ImageButton imageButton; 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(); ((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; return view;
} }
private void onDirectionsAvailable(DirectionsResult directionsResult) { @Override
public void onDirectionsAvailable(DirectionsResult directionsResult) {
Log.d(TAG, "onDirectionsAvailable: got result! " + directionsResult); Log.d(TAG, "onDirectionsAvailable: got result! " + directionsResult);
ArrayList<GeoPoint> geoPoints = directionsResult.getGeoPoints(); ArrayList<GeoPoint> geoPoints = directionsResult.getGeoPoints();
roadOverlay = new Polyline(); roadOverlay = new Polyline();

View File

@@ -52,7 +52,7 @@ public enum ApiHandler {
if (response.body() != null) { if (response.body() != null) {
String responseString = Objects.requireNonNull(response.body()).string(); String responseString = Objects.requireNonNull(response.body()).string();
Log.d(TAG, "getDirections: got response: " + responseString); Log.d(TAG, "getDirections: got response: " + responseString);
System.out.println(responseString);
DirectionsResult result = new DirectionsResult(); DirectionsResult result = new DirectionsResult();
result.parse(responseString); result.parse(responseString);
Log.d(TAG, "getDirections: " + result.getSteps().size()); Log.d(TAG, "getDirections: " + result.getSteps().size());

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="@string/locatie_detail" android:text=""
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="@string/locatie_detail_tekst" android:text=""
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

@@ -25,7 +25,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="@string/naam" android:text=""
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

@@ -14,7 +14,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="@string/statistieken" android:text="@string/statistics"
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" />
@@ -27,7 +27,6 @@
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="@string/terug"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />

View File

@@ -14,7 +14,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="@string/locaties" android:text="@string/locations"
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" />
@@ -27,7 +27,6 @@
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="@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_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="@string/locatie_detail" android:text=""
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="30sp" android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
@@ -36,7 +36,7 @@
android:layout_margin="20dp" android:layout_margin="20dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/secondaryColour" android:background="@color/secondaryColour"
android:text="@string/locatie_detail_tekst" android:text=""
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/detail_location_image" /> app:layout_constraintTop_toBottomOf="@+id/detail_location_image" />

View File

@@ -23,7 +23,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="@string/titel" android:text="@string/routes"
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

@@ -22,7 +22,7 @@
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="@string/titel" android:text=""
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@+id/routeDetailImage" app:layout_constraintBottom_toTopOf="@+id/routeDetailImage"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"

View File

@@ -24,7 +24,7 @@
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/instellingen" android:text="@string/settings"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="30sp" android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"

View File

@@ -59,7 +59,7 @@
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="@string/km" android:text=""
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
@@ -108,7 +108,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="@string/getal" android:text=""
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
@@ -155,7 +155,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="@string/minuten" android:text=""
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
@@ -205,7 +205,7 @@
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:id="@+id/couponAmount"
android:text="@string/getal" android:text=""
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

@@ -21,7 +21,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="294dp" android:layout_marginEnd="294dp"
android:gravity="center" android:gravity="center"
android:text="@string/locaties" android:text=""
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"

View File

@@ -21,7 +21,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:text="@string/titel" android:text=""
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/route_Image" app:layout_constraintStart_toEndOf="@+id/route_Image"

View File

@@ -3,7 +3,7 @@
<item <item
android:id="@+id/locations" android:id="@+id/locations"
android:title="@string/locaties" android:title="@string/locations"
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/statistieken" android:title="@string/statistics"
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/instellingen" android:title="@string/settings"
android:icon="@drawable/ic_baseline_settings_24" android:icon="@drawable/ic_baseline_settings_24"
/> />