Added a progress circle to the mapfragment
the progress circle will be used to indicate that there is work being done in the background Change-Id: Id2929f5be68fce0d223e18d8dd07babfcdb37a34 Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import com.TwentyCodes.android.location.MapView;
|
||||
import com.TwentyCodes.android.location.R;
|
||||
@@ -25,6 +26,8 @@ import com.google.android.maps.Overlay;
|
||||
public abstract class MapFragmentBase extends Fragment {
|
||||
|
||||
private MapView mMapView;
|
||||
private boolean isGPSDialogEnabled;
|
||||
private ProgressBar mProgress;
|
||||
|
||||
/**
|
||||
* Creates a new MapFragment
|
||||
@@ -65,6 +68,8 @@ public abstract class MapFragmentBase extends Fragment {
|
||||
|
||||
mMapView = (MapView) view.findViewById(R.id.mapview);
|
||||
mMapView.setClickable(true);
|
||||
|
||||
mProgress = (ProgressBar) view.findViewById(R.id.mapProgressBar);
|
||||
|
||||
onMapViewCreate(mMapView);
|
||||
|
||||
@@ -98,4 +103,27 @@ public abstract class MapFragmentBase extends Fragment {
|
||||
mMapView.getController().setCenter(point);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables the Acquiring GPS dialog
|
||||
* @author ricky barrette
|
||||
*/
|
||||
public void disableGPSProgess(){
|
||||
isGPSDialogEnabled = false;
|
||||
mProgress.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables the Acquiring GPS dialog if the location has not been acquired
|
||||
*
|
||||
* @author ricky barrette
|
||||
*/
|
||||
public void enableGPSProgess(){
|
||||
isGPSDialogEnabled = true;
|
||||
mProgress.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
public boolean isGPSProgessShowing(){
|
||||
return isGPSDialogEnabled;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user