{
private DebounceModuleHelper module;
+ // Calling these is expensive, so cache the result...
+ private boolean loaded;
+ private boolean safe_to_load;
+ private int debounce_delay;
+
public MS2Debounce()
{
super();
module.setSavedDelay(Integer.parseInt(delay.toString()));
Button reload = (Button)findViewById(R.id.reload);
- if (module.isLoaded() && module.getSavedDelay() != module.getDelay()) {
+ if (loaded && module.getSavedDelay() != debounce_delay) {
reload.setEnabled(true);
} else {
reload.setEnabled(false);
disableUI();
// Calling these is expensive, so cache the result...
- boolean loaded = module.isLoaded();
- boolean safe_to_load = module.is_safe_to_load();
- int debounce_delay = module.getDelay();
+ loaded = module.isLoaded();
+ safe_to_load = module.is_safe_to_load();
+ debounce_delay = module.getDelay();
TextView text = (TextView)findViewById(R.id.text);
text.setText("Current status:\n\nModule loaded: " + loaded + "\ndebounce_delay: " + debounce_delay + "ms\nsafe_to_load: " + safe_to_load);