Changed listener name

This commit is contained in:
PaulStets 2018-08-09 12:19:25 +03:00
parent ae7d5a7972
commit cedb9d8982

View file

@ -33,7 +33,7 @@ import java.util.Set;
public class SettingsDevelopmentActivity extends SettingsBaseActivity { public class SettingsDevelopmentActivity extends SettingsBaseActivity {
private StateChangedListener<Boolean> jsRoutingListener; private StateChangedListener<Boolean> useJSVoiceGuidanceListener;
@SuppressLint("SimpleDateFormat") @SuppressLint("SimpleDateFormat")
@Override @Override
@ -64,7 +64,7 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
cat.addPreference(createCheckBoxPreference(settings.ANIMATE_MY_LOCATION, cat.addPreference(createCheckBoxPreference(settings.ANIMATE_MY_LOCATION,
R.string.animate_my_location, R.string.animate_my_location,
R.string.animate_my_location_desc)); R.string.animate_my_location_desc));
jsRoutingListener = new StateChangedListener<Boolean>() { useJSVoiceGuidanceListener = new StateChangedListener<Boolean>() {
@Override @Override
public void stateChanged(Boolean change) { public void stateChanged(Boolean change) {
getMyApplication().getDownloadThread().runReloadIndexFilesSilent(); getMyApplication().getDownloadThread().runReloadIndexFilesSilent();
@ -72,7 +72,7 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
}; };
cat.addPreference(createCheckBoxPreference(settings.USE_JS_VOICE_GUIDANCE, "Use JS voice guidance", cat.addPreference(createCheckBoxPreference(settings.USE_JS_VOICE_GUIDANCE, "Use JS voice guidance",
"Use new voice guidance logic based on JavaScript")); "Use new voice guidance logic based on JavaScript"));
settings.USE_JS_VOICE_GUIDANCE.addListener(jsRoutingListener); settings.USE_JS_VOICE_GUIDANCE.addListener(useJSVoiceGuidanceListener);
final Preference firstRunPreference = new Preference(this); final Preference firstRunPreference = new Preference(this);
firstRunPreference.setTitle(R.string.simulate_initial_startup); firstRunPreference.setTitle(R.string.simulate_initial_startup);
@ -263,6 +263,6 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
@Override @Override
public void onDestroy() { public void onDestroy() {
super.onDestroy(); super.onDestroy();
settings.USE_JS_VOICE_GUIDANCE.removeListener(jsRoutingListener); settings.USE_JS_VOICE_GUIDANCE.removeListener(useJSVoiceGuidanceListener);
} }
} }