Fix double click to map icon and refresh icon click

This commit is contained in:
Neslihan 2017-05-12 18:41:25 +03:00
parent f6ac8fd1a5
commit 470ad29380
3 changed files with 7 additions and 15 deletions

View file

@ -55,9 +55,12 @@ public class NearbyActivity extends BaseActivity {
} }
private void showMapView() { private void showMapView() {
isMapViewActive = true; if(!isMapViewActive){
getSupportFragmentManager().beginTransaction() getSupportFragmentManager().beginTransaction()
.replace(R.id.container, new NearbyMapFragment()).commit(); .replace(R.id.container, new NearbyMapFragment()).commit();
isMapViewActive = true;
}
} }
@Override @Override

View file

@ -48,8 +48,6 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_nearby_map, container, false);
ButterKnife.bind(this, view);
MapboxMapOptions options = new MapboxMapOptions() MapboxMapOptions options = new MapboxMapOptions()
.styleUrl(Style.OUTDOORS) .styleUrl(Style.OUTDOORS)
.camera(new CameraPosition.Builder() .camera(new CameraPosition.Builder()
@ -60,9 +58,8 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
// create map // create map
mapView = new MapView(getActivity(), options); mapView = new MapView(getActivity(), options);
mapView.onCreate(savedInstanceState); mapView.onCreate(savedInstanceState);
getActivity().setContentView(mapView);
setHasOptionsMenu(false); setHasOptionsMenu(false);
return view; return mapView;
} }
@Override @Override

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mapbox="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
</LinearLayout>