GPSLogger icon indicating copy to clipboard operation
GPSLogger copied to clipboard

Add a Switch to Numeric EditTextPreferences to activate/deactivate them

Open GrazianoCapelli opened this issue 3 years ago • 4 comments

Enabling and Disabling Distance Filter, Interval Filter, and Manual Correction is not comfortable. When I want to disable one of these preferences, I have to open the dialog, move the cursor to the right position of the EditText, set it to zero and click OK; when I later want to re-enable it, I have to remember the old value (:unamused:), open the dialog, set it, and click OK.

We could add a switch to the preference in order to simplify this process:

manual_correction

GrazianoCapelli avatar Feb 08 '22 08:02 GrazianoCapelli

@GrazianoCapelli Can you please answer the following questions to help me understand the requirements properly?

  1. Do I need to add a switch button along with the existing numeric EditTextPreference ?

  2. Do I need to add a switch button for all three preferences (Distance Filter, Interval Filter, and Manual Correction) ?

GaneshVasireddy avatar Oct 06 '24 10:10 GaneshVasireddy

@VasireddyGanesh

1. Do I need to add a switch button along with the existing numeric EditTextPreference ?

Yes, the preference should keep working as edittext, but we would like to add a switch on side in order to activate/deactivate the preference (with the value specified by the user).

2. Do I need to add a switch button for all three preferences (Distance Filter, Interval Filter, and Manual Correction) ?

Yes, for all 3 preferences.

GrazianoCapelli avatar Oct 06 '24 15:10 GrazianoCapelli

but we would like to add a switch on side in order to activate/deactivate the preference (with the value specified by the user).

@GrazianoCapelli Should I create a custom preference that combines an EditText and a Switch, or would it be sufficient to have two separate preferences, one for the EditText and another for the Switch ?

GaneshVasireddy avatar Oct 09 '24 13:10 GaneshVasireddy

@VasireddyGanesh we should implement a custom preference that combines an EditText and a Switch. The same custom preference layout can be used for all the 3 preferences.

GrazianoCapelli avatar Oct 09 '24 14:10 GrazianoCapelli