Merge branch 'develop' into ButtonFix

This commit is contained in:
Sem van der Hoeven
2021-01-12 15:28:49 +01:00
6 changed files with 22 additions and 13 deletions

View File

@@ -63,6 +63,9 @@ public enum Data {
public void addTimeWalked(long time) {
totalTime += time;
editor.putLong("timeWalked", totalTime);
editor.apply();
}
public double getDistanceTraveled() {
@@ -105,8 +108,9 @@ public enum Data {
public void load(){
SharedPreferences prefs = context.getSharedPreferences("Data", Context.MODE_PRIVATE);
this.editor = prefs.edit();
Data.INSTANCE.addDistance(Double.parseDouble(prefs.getString("distanceTraveled", "0")));
this.addDistance(Double.parseDouble(prefs.getString("distanceTraveled", "0")));
this.locationsVisited = loadAndGetVisitedNamesList().size();
this.totalTime = prefs.getLong("timeWalked", 0);
}
public android.location.Location getLocation() {

View File

@@ -208,7 +208,7 @@ public class HomeFragment extends Fragment implements LocationListener {
if (currentLocation == null) currentLocation = location;
if (location != null) {
GeoPoint start = new GeoPoint(location.getLatitude(), location.getLongitude());
GeoPoint start = new GeoPoint(currentLocation.getLatitude(), currentLocation.getLongitude());
mapController.setCenter(start);
}

View File

@@ -14,10 +14,13 @@
android:layout_height="wrap_content"
android:layout_margin="9dp"
android:layout_marginTop="20dp"
android:text="@string/statistics"
android:textSize="20sp"
app:layout_constraintStart_toEndOf="@id/coupon_back_button"
app:layout_constraintTop_toTopOf="parent" />
android:text="@string/coupons"
android:textSize="30sp"
android:textColor="@color/secondaryColour"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/coupon_back_button"
app:layout_constraintBottom_toBottomOf="@id/coupon_back_button"/>
<ImageButton
android:id="@+id/coupon_back_button"
@@ -26,7 +29,6 @@
android:layout_marginStart="10dp"
android:layout_marginTop="12dp"
android:background="@drawable/ic_back_button_24"
android:backgroundTint="@color/buttonColour"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@@ -15,8 +15,9 @@
android:layout_margin="9dp"
android:layout_marginTop="20dp"
android:text="@string/locations"
android:textSize="20sp"
app:layout_constraintStart_toEndOf="@id/location_back_button"
android:textSize="30sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton

View File

@@ -24,9 +24,11 @@
android:layout_height="wrap_content"
android:layout_margin="9dp"
android:text="@string/routes"
android:textSize="20sp"
app:layout_constraintStart_toEndOf="@id/route_back_button"
app:layout_constraintTop_toTopOf="parent" />
android:textSize="30sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/route_back_button"
app:layout_constraintBottom_toBottomOf="@id/route_back_button"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/route_recyclerview"

View File

@@ -21,7 +21,7 @@
android:id="@+id/route_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textColor="@color/secondaryColour"
android:textSize="30sp"
app:layout_constraintBottom_toTopOf="@+id/route_detail_image"
android:text=""