[CHANGED] String values
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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<GeoPoint> geoPoints = directionsResult.getGeoPoints();
|
||||
roadOverlay = new Polyline();
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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" />
|
||||
|
||||
|
||||
@@ -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" />
|
||||
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/minuten"
|
||||
android:text=""
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -205,7 +205,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/couponAmount"
|
||||
android:text="@string/getal"
|
||||
android:text=""
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="294dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/locaties"
|
||||
android:text=""
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/titel"
|
||||
android:text=""
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/route_Image"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/locations"
|
||||
android:title="@string/locaties"
|
||||
android:title="@string/locations"
|
||||
android:icon="@drawable/ic_baseline_outlined_flag_24"
|
||||
/>
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/statistics"
|
||||
android:title="@string/statistieken"
|
||||
android:title="@string/statistics"
|
||||
android:icon="@drawable/ic_baseline_graphic_eq_24"
|
||||
/>
|
||||
|
||||
<item
|
||||
android:id="@+id/settings"
|
||||
android:title="@string/instellingen"
|
||||
android:title="@string/settings"
|
||||
android:icon="@drawable/ic_baseline_settings_24"
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user