8 Commits

Author SHA1 Message Date
Sem van der Hoeven
57edff604e Merge branch 'develop' into ButtonFix 2021-01-12 15:28:49 +01:00
Sem van der Hoeven
04defe4643 0,0 fix 2021-01-12 15:28:26 +01:00
RemoMeijer
02c2981d58 Fixed button 2021-01-12 15:27:46 +01:00
Bipin
209e3f3681 Merge branch 'CosmeticFixes' into develop 2021-01-12 15:11:18 +01:00
Bipin
d87adeec8d text sizes and colours 2021-01-12 15:10:54 +01:00
Bart
27a7feb05a Merge branch 'saveTimeMA8' into develop 2021-01-12 15:04:05 +01:00
Bart
6edcd7b74f Total time walked gets saved and loaded 2021-01-12 15:03:46 +01:00
RemoMeijer
5587c318d0 Fixed start route button 2021-01-12 15:02:12 +01:00
6 changed files with 28 additions and 23 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

@@ -13,7 +13,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:background="@drawable/ic_back_button_24"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -22,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=""
@@ -31,13 +30,13 @@
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_margin="40dp"
android:id="@+id/route_detail_image"
app:layout_constraintTop_toBottomOf="@id/route_detail_back_button"
android:layout_width="228dp"
android:layout_height="208dp"
android:layout_margin="40dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
app:layout_constraintTop_toBottomOf="@id/route_detail_back_button" />
<ScrollView
android:layout_width="match_parent"
@@ -58,18 +57,16 @@
</ScrollView>
<Button
android:id="@+id/start_route_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="45dp"
android:backgroundTint="@color/secondaryColour"
android:text="@string/start_route"
android:textColor="@color/primaryColour"
android:layout_marginBottom="50dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/total_distance" />
@@ -77,7 +74,6 @@
android:id="@+id/total_distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:background="@color/primaryColour"
android:text="@string/total_distance"
android:textColor="@color/secondaryColour"