Fixed first fix bug and fixed GPS progress above map
This commit is contained in:
@@ -47,14 +47,27 @@
|
|||||||
layout="@layout/ringer_info_button_bar"
|
layout="@layout/ringer_info_button_bar"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<fragment
|
|
||||||
android:id="@+id/map"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_above="@id/buttons"
|
android:layout_above="@id/buttons"
|
||||||
android:layout_below="@id/map_controls"
|
android:layout_below="@id/map_controls">
|
||||||
class="com.google.android.gms.maps.SupportMapFragment" >
|
|
||||||
</fragment>
|
<fragment
|
||||||
|
android:id="@+id/map"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
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
|
<TextView
|
||||||
android:id="@+id/radius_textview"
|
android:id="@+id/radius_textview"
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ public class LocationInformationFragment extends Fragment implements LatLngListe
|
|||||||
private View view;
|
private View view;
|
||||||
private TextView mRadiusTextView;
|
private TextView mRadiusTextView;
|
||||||
private Circle mCircle;
|
private Circle mCircle;
|
||||||
|
private ProgressBar mProgress;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new MapFragment
|
* Creates a new MapFragment
|
||||||
@@ -79,11 +81,11 @@ public class LocationInformationFragment extends Fragment implements LatLngListe
|
|||||||
|
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
mGPS.enableLocationUpdates(this);
|
mGPS.enableLocationUpdates(this);
|
||||||
// mMap.enableGPSProgess();
|
mProgress.setVisibility(View.VISIBLE);
|
||||||
mMap.setOnMapClickListener(this);
|
mMap.setOnMapClickListener(this);
|
||||||
} else {
|
} else {
|
||||||
mGPS.disableLocationUpdates();
|
mGPS.disableLocationUpdates();
|
||||||
// mMap.disableGPSProgess();
|
mProgress.setVisibility(View.INVISIBLE);
|
||||||
mMap.setOnMapClickListener(null);
|
mMap.setOnMapClickListener(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,6 +144,8 @@ public class LocationInformationFragment extends Fragment implements LatLngListe
|
|||||||
mRadius.setOnSeekBarChangeListener(this);
|
mRadius.setOnSeekBarChangeListener(this);
|
||||||
mRadius.setEnabled(false);
|
mRadius.setEnabled(false);
|
||||||
|
|
||||||
|
mProgress = (ProgressBar) view.findViewById(R.id.map_progress);
|
||||||
|
|
||||||
if (mInfo.get(RingerDatabase.KEY_LOCATION) != null) {
|
if (mInfo.get(RingerDatabase.KEY_LOCATION) != null) {
|
||||||
final String[] point = mInfo.getAsString(RingerDatabase.KEY_LOCATION).split(",");
|
final String[] point = mInfo.getAsString(RingerDatabase.KEY_LOCATION).split(",");
|
||||||
final LatLng location = new LatLng(Double.parseDouble(point[0]), Double.parseDouble(point[1]));
|
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
|
* current location
|
||||||
*/
|
*/
|
||||||
if (isFirstFix) {
|
if (isFirstFix) {
|
||||||
// mMap.disableGPSProgess();
|
mProgress.setVisibility(View.INVISIBLE);
|
||||||
if (mMap != null)
|
if (mMap != null)
|
||||||
if(mCircle.getCenter() == new LatLng(0, 0));
|
if(mCircle.getCenter().equals(new LatLng(0, 0)))
|
||||||
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(mPoint, 14));
|
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(mPoint, 14));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
// else
|
mProgress.setVisibility(View.VISIBLE);
|
||||||
// mMap.enableGPSProgess();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -325,6 +328,7 @@ public class LocationInformationFragment extends Fragment implements LatLngListe
|
|||||||
mMap.getUiSettings().setAllGesturesEnabled(isEnabled);
|
mMap.getUiSettings().setAllGesturesEnabled(isEnabled);
|
||||||
mMap.getUiSettings().setZoomControlsEnabled(isEnabled);
|
mMap.getUiSettings().setZoomControlsEnabled(isEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the Map is clicked
|
* Called when the Map is clicked
|
||||||
* @param point
|
* @param point
|
||||||
|
|||||||
Submodule location_library updated: 4ca015c7cd...45107300d1
Reference in New Issue
Block a user