Recording stats layout customizable.

Users can select the order, visibility and importance (primary or secondary) of all stats for recording layout from the Settings.
Also, users can select the number of columns per row in the recording layout: 1, 2 or 3.
Finally, show altitude/coordinate from settings have been removed (not needed anymore).
Fixes #659.
Fixes #302.
Fixes #820.
This commit is contained in:
Román Martínez
2021-06-19 21:29:06 +02:00
parent 7f10ae5c3f
commit 9c4c8131f5
93 changed files with 2146 additions and 1126 deletions
@@ -3,6 +3,7 @@ package de.dennisguse.opentracks.settings;
import android.content.Context;
import android.os.Bundle;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.Toast;
import androidx.fragment.app.FragmentActivity;
@@ -35,15 +36,23 @@ public class ResetDialogPreference extends DialogPreference {
@Override
public void onDialogClosed(boolean positiveResult) {
if (positiveResult) {
FragmentActivity activity = getActivity();
if (!positiveResult) {
return;
}
FragmentActivity activity = getActivity();
String preferenceKey = getArguments().getString(PreferenceDialogFragmentCompat.ARG_KEY);
if (preferenceKey.equals(getString(R.string.settings_reset_key))) {
PreferencesUtils.resetPreferences(activity, true);
Toast.makeText(activity, R.string.settings_reset_done, Toast.LENGTH_SHORT).show();
} else if (preferenceKey.equals(getString(R.string.settings_layout_reset_key))) {
PreferencesUtils.resetCustomLayoutPreferences(activity);
Toast.makeText(activity, R.string.settings_layout_reset_done, Toast.LENGTH_SHORT).show();
}
if (activity instanceof ResetCallback) {
((ResetCallback) activity).onReset();
}
if (activity instanceof ResetCallback) {
((ResetCallback) activity).onReset();
}
}
}