googlearchive / science-journal-ios

Use the sensors in your mobile devices to perform science experiments. Science doesn’t just happen in the classroom or lab—tools like Science Journal let you see how the world works with just your phone.
https://sciencejournal.withgoogle.com/
Apache License 2.0
536 stars 62 forks source link

Display message if Bluetooth is unavailable #25

Open taquitos opened 5 years ago

taquitos commented 5 years ago

We don't present any errors if bluetooth isn't available, we probably should

https://github.com/google/science-journal-ios/blob/be7ecf0c3749793d6b18c1058d343a66c6d4314d/ScienceJournal/UI/SensorSettingsDataSource.swift#L446

RadiBarq commented 5 years ago

@taquitos hey, I am working on the issue should I present an alert only when the bluetooth is not available the first time the setting view open or every time the bluetooth is not available while the settings view is open, (for example if the user turned off the bluetooth while it's open).

taquitos commented 5 years ago

Great question, I think we could split this into two different PRs, and feel free to do either, or both!

  1. I think every time somebody opens settings while bluetooth isn't available we should show an alert.
  2. If bluetooth is turned off while it's open we should present an alert.

We have some standard alerting via MDCSnackbarMessage I think that would be the best way to alert the users.

RadiBarq commented 5 years ago

ok thank you, I will do both. About the warning message, do you translate texts to all the supported languages manually or what. and if there is a suggested warning message in english to be translated to other languages that's would be great.

taquitos commented 5 years ago

We do translation in-house- we write an English string and then a team takes care of the rest. Maybe something like: "Bluetooth is disabled, please enable to use external sensors." Paging @garrettmurray (he's much better at words than I 😄 )

garrettmurray commented 5 years ago

Let's match the Android string here: https://github.com/google/science-journal/blob/2521c303bc420d0c7fb141cc545771cbcd139579/OpenScienceJournal/whistlepunk_library/src/main/res/values/strings.xml#L778

Cannot connect to external sensor: Bluetooth is disabled. Turn on Bluetooth to connect to your external sensor.