mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-10 21:02:40 +00:00
Merge branch 'bug4844'
This commit is contained in:
commit
03caf71b35
7 files changed
+20
-43
No files matched your search
+8
@@ -4,6 +4,14 @@
|
||||
<div id="mainContent">
|
||||
<h4 class="articleHeadline">What's New - SAP Sailing Race Manager</h4>
|
||||
<div class="innerContent">
|
||||
<h5 class="articleSubheadline">July 2019</h5>
|
||||
<ul class="bulletList">
|
||||
<li>The app no longer remembers the last entered duration when setting a protest time.
|
||||
The protest duration can now be configured correctly in the app settings.
|
||||
Please consider that a protest duration in the specific regatta configuration is preferred to
|
||||
the protest duration in the default regatta configuration.</li>
|
||||
</ul>
|
||||
|
||||
<h5 class="articleSubheadline">May 2019</h5>
|
||||
<ul class="bulletList">
|
||||
<li>The Course editor now works correctly when managing more than one regatta.
|
||||
|
||||
@@ -116,9 +116,6 @@
|
||||
<bool name="preference_allow_edit_race_factor_default">true</bool>
|
||||
<string name="preference_protest_time_duration_key">protestTimeDuration</string>
|
||||
<integer name="preference_protest_time_duration_default">90</integer>
|
||||
<string name="preference_protest_time_duration_custom_key">protestTimeDurationCustom</string>
|
||||
<string name="preference_protest_time_duration_custom_editable_key">protestTimeDurationCustomEditable</string>
|
||||
<bool name="preference_protest_time_duration_custom_editable_default">true</bool>
|
||||
|
||||
<string name="preference_allow_demo_key" translatable="false">allow_demo</string>
|
||||
<bool name="preference_allow_demo_default">false</bool>
|
||||
|
||||
-21
@@ -523,33 +523,12 @@ public class AppPreferences {
|
||||
context.getResources().getInteger(R.integer.preference_protest_time_duration_default));
|
||||
}
|
||||
|
||||
public int getProtestTimeDurationInMinutesCustom() {
|
||||
return helper.getInt(context.getString(R.string.preference_protest_time_duration_custom_key), -1);
|
||||
}
|
||||
|
||||
public boolean isDefaultProtestTimeCustomEditable() {
|
||||
return helper.getBoolean(context.getString(R.string.preference_protest_time_duration_custom_editable_key),
|
||||
context.getResources().getBoolean(R.bool.preference_protest_time_duration_custom_editable_default));
|
||||
}
|
||||
|
||||
public void setDefaultProtestTimeDurationInMinutes(int protestTimeInMinutes) {
|
||||
helper.getEditor()
|
||||
.putInt(context.getString(R.string.preference_protest_time_duration_key), protestTimeInMinutes)
|
||||
.commit();
|
||||
}
|
||||
|
||||
public void setDefaultProtestTimeDurationInMinutesCustom(int protestTimeInMinutest) {
|
||||
helper.getEditor()
|
||||
.putInt(context.getString(R.string.preference_protest_time_duration_custom_key), protestTimeInMinutest)
|
||||
.commit();
|
||||
}
|
||||
|
||||
public void setDefaultProtestTimeDurationInMinutesCustomEditable(boolean editable) {
|
||||
helper.getEditor()
|
||||
.putBoolean(context.getString(R.string.preference_protest_time_duration_custom_editable_key), editable)
|
||||
.commit();
|
||||
}
|
||||
|
||||
public void setAccessToken(String accessToken) {
|
||||
helper.getEditor().putString(context.getString(R.string.preference_access_token_key), accessToken).commit();
|
||||
}
|
||||
|
||||
+3
-6
@@ -1,8 +1,5 @@
|
||||
package com.sap.sailing.racecommittee.app.domain.configuration.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.sap.sailing.android.shared.logging.ExLog;
|
||||
import com.sap.sailing.domain.base.configuration.ConfigurationLoader;
|
||||
import com.sap.sailing.domain.base.configuration.RacingProcedureConfiguration;
|
||||
@@ -23,6 +20,9 @@ import com.sap.sailing.domain.common.racelog.RacingProcedureType;
|
||||
import com.sap.sailing.racecommittee.app.AppPreferences;
|
||||
import com.sap.sse.common.Duration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
|
||||
public class PreferencesRegattaConfigurationLoader implements ConfigurationLoader<RegattaConfiguration> {
|
||||
|
||||
private static final String TAG = PreferencesRegattaConfigurationLoader.class.getSimpleName();
|
||||
@@ -113,9 +113,6 @@ public class PreferencesRegattaConfigurationLoader implements ConfigurationLoade
|
||||
if (configuration.getDefaultProtestTimeDuration() != null) {
|
||||
preferences.setDefaultProtestTimeDurationInMinutes(
|
||||
(int) configuration.getDefaultProtestTimeDuration().asMinutes());
|
||||
preferences.setDefaultProtestTimeDurationInMinutesCustomEditable(false);
|
||||
} else {
|
||||
preferences.setDefaultProtestTimeDurationInMinutesCustomEditable(true);
|
||||
}
|
||||
|
||||
if (configuration.getRRS26Configuration() != null) {
|
||||
|
||||
-1
@@ -401,7 +401,6 @@ public class LoginActivity extends BaseActivity implements EventSelectedListener
|
||||
public void onLoadFailed(Exception reason) {
|
||||
dismissProgressSpinner();
|
||||
|
||||
preferences.setDefaultProtestTimeDurationInMinutesCustomEditable(true);
|
||||
if (reason instanceof FileNotFoundException) {
|
||||
Toast.makeText(getApplicationContext(), getString(R.string.loading_configuration_not_found),
|
||||
Toast.LENGTH_LONG).show();
|
||||
|
||||
+4
-11
@@ -319,8 +319,7 @@ public class ProtestTimeDialogFragment extends AttachedDialogFragment implements
|
||||
TimePoint startTime = TimeUtils.getTime(mTimePicker);
|
||||
TimePoint now = MillisecondsTimePoint.now();
|
||||
for (ManagedRace race : selectedRaces) {
|
||||
Duration duration = Duration.ONE_MINUTE
|
||||
.times(AppPreferences.on(getActivity()).getProtestTimeDurationInMinutes());
|
||||
Duration duration = Duration.ONE_MINUTE.times(mDuration);
|
||||
TimeRange protestTime = new TimeRangeImpl(startTime, startTime.plus(duration));
|
||||
race.getState().setProtestTime(now, protestTime);
|
||||
}
|
||||
@@ -404,12 +403,6 @@ public class ProtestTimeDialogFragment extends AttachedDialogFragment implements
|
||||
private void updateProtestRange() {
|
||||
if (mDuration == null) {
|
||||
mDuration = mPreferences.getProtestTimeDurationInMinutes();
|
||||
if (mPreferences.isDefaultProtestTimeCustomEditable()) {
|
||||
int custom = mPreferences.getProtestTimeDurationInMinutesCustom();
|
||||
if (custom >= 0) {
|
||||
mDuration = custom;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mProtestDuration != null) {
|
||||
mProtestDuration.setText(getString(R.string.protest_duration, mDuration));
|
||||
@@ -468,9 +461,9 @@ public class ProtestTimeDialogFragment extends AttachedDialogFragment implements
|
||||
builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
mDuration = Integer.parseInt(duration.getText().toString());
|
||||
if (mPreferences.isDefaultProtestTimeCustomEditable()) {
|
||||
mPreferences.setDefaultProtestTimeDurationInMinutesCustom(mDuration);
|
||||
try {
|
||||
mDuration = Integer.parseInt(duration.getText().toString());
|
||||
} catch (NumberFormatException ignored) {
|
||||
}
|
||||
updateProtestRange();
|
||||
}
|
||||
|
||||
+5
-1
@@ -25,6 +25,10 @@ public class IntegerEditTextPreference extends EditTextPreference {
|
||||
|
||||
@Override
|
||||
protected boolean persistString(String value) {
|
||||
return persistInt(Integer.valueOf(value));
|
||||
try {
|
||||
return persistInt(Integer.valueOf(value));
|
||||
} catch (NumberFormatException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user