simonpoole / OpeningHoursFragment

Android UI element for displaying and editing an opening hours value
MIT License
9 stars 2 forks source link

“Save to file” dialog in “Manage templates” could be improved #53

Open jajajaneeneenee opened 3 years ago

jajajaneeneenee commented 3 years ago

Behaviour/Symptoms

When I used the “Save to file” command in “Manage templates” the first time(s), I did not see the input field for a file name at all – I thought it is only possible to choose a folder to save to. I only saw the SAVE button at the bottom right (“SPEICH.“ on my german system) and directly pressed it, because the input field is nearly invisible as long as you don't tap on it (and it gets focus with a cursor) – then it also gets a slightly thicker line, but it's still not very clearly visible ... it's a white field on a white background with a thin line.

Here are 2 screenshots (scaled down):

“Save to file” dialog 01 270px “Save to file” dialog 02 (with focus) 270px

And if you press the save button without entering a file name you get a file with the name “(invalid)”. And if such a file already exist, the result is “(invalid) (1)“.

When I used the command the first time(s), this was some kind of confusing (although the content of the file is completely OK – and not invalid ...). It took some time until I detected the input field ... and I think I'm not a very unexperienced user ...

Vespucci /Android Version/Device

Expected Behaviour

If you really don't enter a file name and press the SAVE button, a better and descriptive file name would be nice ... perhaps something like “Opening hours template database file.txt”. Or a warning should appear that you have to enter a file name.

UI Improvements

simonpoole commented 3 years ago

The SAF file picker is an activity provided by the system (exact visual appearance depends on the Android version) and can't be easily replaced. Further we don't have any control over it's internal workings so can't determine what gets focus when. Yes that kind of sucks.

We should however catch an empty URL being returned so leaving open for now.

jajajaneeneenee commented 3 years ago

How bad that you don't have more control over the file picker. It's also not possible to display a (grey) hint text in the input field (something like "Enter filename here")?

Or perhaps you should prefill this input field with a default name (like “Opening hours template database file.txt”), it this is possible. It would save you the hassle of thinking up or typing a filename (or you could change it if you don't like it) I don't know if this would be possible ... perhaps not ...

But in any case, an empty input field should be catched, yes!