Commit 8b06beed authored by Varun Patil's avatar Varun Patil

Show "Searching for GPS!" toast in map

parent eadc13eb
...@@ -236,8 +236,12 @@ public class MapFragment extends Fragment implements TextWatcher, ...@@ -236,8 +236,12 @@ public class MapFragment extends Fragment implements TextWatcher,
if (!campusMapView.isAddedMarker(user)) { if (!campusMapView.isAddedMarker(user)) {
campusMapView.addMarker(user); campusMapView.addMarker(user);
} }
SubsamplingScaleImageView.AnimationBuilder anim = campusMapView.animateCenter(user.getPoint()); if (user.getPoint().x == 0) {
if (anim != null) anim.start(); Toast.makeText(getContext(), "Searching for GPS!", Toast.LENGTH_LONG).show();
} else {
SubsamplingScaleImageView.AnimationBuilder anim = campusMapView.animateCenter(user.getPoint());
if (anim != null) anim.start();
}
} }
} }
...@@ -1175,7 +1179,7 @@ public class MapFragment extends Fragment implements TextWatcher, ...@@ -1175,7 +1179,7 @@ public class MapFragment extends Fragment implements TextWatcher,
} catch (IntentSender.SendIntentException e) { } } catch (IntentSender.SendIntentException e) { }
break; break;
case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE: case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:
Toast.makeText(getContext(), "GPS is not enabled!", Toast.LENGTH_LONG); Toast.makeText(getContext(), "GPS is not enabled!", Toast.LENGTH_LONG).show();
break; break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment