6 Commits
v1.0 ... v1.2

Author SHA1 Message Date
SemvdH
1a6fc6a7f0 Merge pull request #4 from SemvdH/develop
Develop
2021-01-07 11:44:22 +01:00
Sem van der Hoeven
38dbbfc534 fiiiix 2021-01-07 11:43:40 +01:00
Sem van der Hoeven
8169e8c680 added back diff line 2021-01-07 11:35:44 +01:00
SemvdH
6eeb0870fc Merge pull request #3 from SemvdH/develop
Develop
2021-01-07 11:21:59 +01:00
Sem van der Hoeven
20431d019b Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-07 11:20:58 +01:00
Sem van der Hoeven
7e99070002 added ok button to help popup 2021-01-07 11:20:48 +01:00
5 changed files with 19 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import androidx.fragment.app.DialogFragment;
@@ -15,6 +16,8 @@ public class HelpPopup extends DialogFragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.help_popup, container, false);
getDialog().setTitle("Simple Dialog");
Button okButton = rootView.findViewById(R.id.help_ok_button);
okButton.setOnClickListener(v -> dismiss());
return rootView;
}
}

View File

@@ -66,7 +66,7 @@ public class RouteDetailFragment extends Fragment {
TextView totalDistance = view.findViewById(R.id.total_distance);
String distance_tekst = getResources().getString(R.string.total_distance_route);
boolean imperialChecked = getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false);
totalDistance.setText(distance_tekst + " " + String.format("%.1f", calculateRoute(this.route.getLocations())) + (imperialChecked ? "ft" : "m"));
totalDistance.setText(distance_tekst + " " + String.format("%.1f", calculateRoute(this.route.getLocations())) + (imperialChecked ? "yd" : "m"));
//Initialises the back button
ImageButton backButton = view.findViewById(R.id.route_detail_back_button);
@@ -118,7 +118,7 @@ public class RouteDetailFragment extends Fragment {
// if the imperialSwitch is checked, return feet, if not, return meters
if (getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false))
return totalDistance *3.28084;
return totalDistance * 1.0936133;
else
return totalDistance;
}

View File

@@ -22,6 +22,7 @@ import com.a1.nextlocation.recyclerview.CouponListManager;
import java.util.List;
public class StatisticFragment extends Fragment {
private TextView distance;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -36,9 +37,7 @@ public class StatisticFragment extends Fragment {
initializeDistanceTextView(view);
TextView locs = view.findViewById(R.id.statistics_locations_visited);
TextView timeText = view.findViewById(R.id.statistics_time_value);
double dist = Data.INSTANCE.getDistanceTraveled() / 1000;
distance.setText("" + String.format("%.1f", dist) + " km");
locs.setText("" + Data.INSTANCE.getLocationsVisited());
long seconds = Data.INSTANCE.getTotalTime() / 1000;
@@ -79,7 +78,7 @@ public class StatisticFragment extends Fragment {
}
private void initializeDistanceTextView(View view){
TextView distance = view.findViewById(R.id.statistics_km);
distance = view.findViewById(R.id.statistics_km);
double dist = Data.INSTANCE.getDistanceTraveled()/1000;
if (getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false))
distance.setText("" + String.format("%.1f",dist * 0.621371) + " mi");

View File

@@ -44,6 +44,15 @@
</ScrollView>
<Button
android:id="@+id/help_ok_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="ok"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/helpPopTitle" />

View File

@@ -7,6 +7,7 @@
<item name="colorSecondary">@color/secondaryColour</item>
<!-- Customize your theme here. -->
<item name="colorButtonNormal">@color/buttonColour</item>
<item name="colorPrimaryDark">@color/secondaryColour</item>
<item name="android:textSize">16sp</item>
</style>
@@ -17,6 +18,7 @@
<item name="colorSecondary">@color/secondaryColour</item>
<!-- Customize your theme here. -->
<item name="colorButtonNormal">@color/buttonColour</item>
<item name="colorPrimaryDark">@color/secondaryColour</item>
<item name="android:textSize">24sp</item>
</style>
</resources>