Fixed first fix bug and fixed GPS progress above map

This commit is contained in:
2014-09-01 11:34:06 -04:00
parent 00b90b4331
commit d196950b92
3 changed files with 30 additions and 13 deletions

View File

@@ -47,14 +47,27 @@
layout="@layout/ringer_info_button_bar"
android:visibility="gone" />
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/buttons"
android:layout_below="@id/map_controls">
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/buttons"
android:layout_below="@id/map_controls"
class="com.google.android.gms.maps.SupportMapFragment" >
</fragment>
class="com.google.android.gms.maps.SupportMapFragment" />
<ProgressBar
android:id="@+id/map_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="invisible"/>
</RelativeLayout>
<TextView
android:id="@+id/radius_textview"

View File

@@ -53,6 +53,8 @@ public class LocationInformationFragment extends Fragment implements LatLngListe
private View view;
private TextView mRadiusTextView;
private Circle mCircle;
private ProgressBar mProgress;
/**
* Creates a new MapFragment
@@ -79,11 +81,11 @@ public class LocationInformationFragment extends Fragment implements LatLngListe
if (isChecked) {
mGPS.enableLocationUpdates(this);
// mMap.enableGPSProgess();
mProgress.setVisibility(View.VISIBLE);
mMap.setOnMapClickListener(this);
} else {
mGPS.disableLocationUpdates();
// mMap.disableGPSProgess();
mProgress.setVisibility(View.INVISIBLE);
mMap.setOnMapClickListener(null);
}
@@ -142,6 +144,8 @@ public class LocationInformationFragment extends Fragment implements LatLngListe
mRadius.setOnSeekBarChangeListener(this);
mRadius.setEnabled(false);
mProgress = (ProgressBar) view.findViewById(R.id.map_progress);
if (mInfo.get(RingerDatabase.KEY_LOCATION) != null) {
final String[] point = mInfo.getAsString(RingerDatabase.KEY_LOCATION).split(",");
final LatLng location = new LatLng(Double.parseDouble(point[0]), Double.parseDouble(point[1]));
@@ -178,15 +182,14 @@ public class LocationInformationFragment extends Fragment implements LatLngListe
* current location
*/
if (isFirstFix) {
// mMap.disableGPSProgess();
mProgress.setVisibility(View.INVISIBLE);
if (mMap != null)
if(mCircle.getCenter() == new LatLng(0, 0));
if(mCircle.getCenter().equals(new LatLng(0, 0)))
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(mPoint, 14));
}
}
// else
// mMap.enableGPSProgess();
} else
mProgress.setVisibility(View.VISIBLE);
}
/**
@@ -325,6 +328,7 @@ public class LocationInformationFragment extends Fragment implements LatLngListe
mMap.getUiSettings().setAllGesturesEnabled(isEnabled);
mMap.getUiSettings().setZoomControlsEnabled(isEnabled);
}
/**
* Called when the Map is clicked
* @param point