Commit caf11021 authored by MUTTINENI NAVYA's avatar MUTTINENI NAVYA

small eroor

parent eea5b411
......@@ -28,6 +28,7 @@ import com.google.android.gms.maps.model.MarkerOptions;
/**
* A simple {@link Fragment} subclass.
* Fragment to select location of found item from a google map
*/
public class LocationFragment extends Fragment implements OnMapReadyCallback, GoogleMap.OnMarkerDragListener, GoogleMap.OnMarkerClickListener, View.OnClickListener {
......@@ -43,7 +44,13 @@ public class LocationFragment extends Fragment implements OnMapReadyCallback, Go
// Required empty public constructor
}
/**
* Defines the layout of fragment
* @param inflater
* @param container
* @param savedInstanceState
* @return mview
*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
......@@ -52,7 +59,11 @@ public class LocationFragment extends Fragment implements OnMapReadyCallback, Go
return mView;
}
/**
*
* @param view
* @param savedInstanceState
*/
@Override
public void onViewCreated(View view, Bundle savedInstanceState){
super.onViewCreated(view, savedInstanceState);
......@@ -68,7 +79,11 @@ public class LocationFragment extends Fragment implements OnMapReadyCallback, Go
}
/**
* Populates all the necessary current info which the map should contain.
* Adds marker and sets latitute and longitude of marker
* @param googleMap
*/
@Override
public void onMapReady(GoogleMap googleMap) {
MapsInitializer.initialize(getContext());
......@@ -92,6 +107,10 @@ public class LocationFragment extends Fragment implements OnMapReadyCallback, Go
mMap.setOnMarkerDragListener(this);
}
/**
* Define what should happen once Select Button is clicked
* @param view
*/
@Override
public void onClick(View view) {
switch (view.getId()) {
......@@ -107,6 +126,11 @@ public class LocationFragment extends Fragment implements OnMapReadyCallback, Go
}
/**
* Defines what happens when marker is clicked
* @param marker
* @return
*/
@Override
public boolean onMarkerClick(Marker marker) {
LatLng my_marker_location = marker.getPosition();
......@@ -125,6 +149,10 @@ public class LocationFragment extends Fragment implements OnMapReadyCallback, Go
}
/**
* Method to define what happens when marker is dragged accross the map
* @param marker
*/
@Override
public void onMarkerDragEnd(Marker marker) {
my_marker.setPosition(marker.getPosition());
......
......@@ -19,6 +19,7 @@ import com.google.android.gms.maps.model.MarkerOptions;
/**
* Fragment for lost item location
* A simple {@link Fragment} subclass.
*/
public class LostItemLocationFragment extends Fragment implements OnMapReadyCallback, GoogleMap.OnMarkerDragListener, GoogleMap.OnMarkerClickListener, View.OnClickListener {
......@@ -44,7 +45,11 @@ public class LostItemLocationFragment extends Fragment implements OnMapReadyCall
return mView;
}
/**
* Sets map's view
* @param view
* @param savedInstanceState
*/
@Override
public void onViewCreated(View view, Bundle savedInstanceState){
super.onViewCreated(view, savedInstanceState);
......@@ -60,7 +65,11 @@ public class LostItemLocationFragment extends Fragment implements OnMapReadyCall
}
/**
* Populatesmap with required info
* Adds marker and sets its location
* @param googleMap
*/
@Override
public void onMapReady(GoogleMap googleMap) {
MapsInitializer.initialize(getContext());
......@@ -78,6 +87,10 @@ public class LostItemLocationFragment extends Fragment implements OnMapReadyCall
mMap.setOnMarkerDragListener(this);
}
/**
* implemented clickable event, select to select location of lost item
* @param view
*/
@Override
public void onClick(View view) {
switch (view.getId()) {
......@@ -93,6 +106,11 @@ public class LostItemLocationFragment extends Fragment implements OnMapReadyCall
getActivity().getSupportFragmentManager().beginTransaction().remove(this).commit();
}
/**
* defines what happens when marker is clicked
* @param marker
* @return
*/
@Override
public boolean onMarkerClick(Marker marker) {
LatLng my_marker_location = marker.getPosition();
......@@ -109,6 +127,10 @@ public class LostItemLocationFragment extends Fragment implements OnMapReadyCall
}
/**
* Defines what happens when the marker is dragged
* @param marker
*/
@Override
public void onMarkerDragEnd(Marker marker) {
my_marker = marker;
......
......@@ -35,7 +35,13 @@ public class SeeLocationFragment extends Fragment implements OnMapReadyCallback,
// Required empty public constructor
}
/**
* Defines the layout of fragment
* @param inflater
* @param container
* @param savedInstanceState
* @return mview
*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
......@@ -59,7 +65,11 @@ public class SeeLocationFragment extends Fragment implements OnMapReadyCallback,
}
/**
* Populates all the necessary current info which the map should contain.
* Adds marker and sets latitute and longitude of marker
* @param googleMap
*/
@Override
public void onMapReady(GoogleMap googleMap) {
MapsInitializer.initialize(getContext());
......@@ -73,7 +83,11 @@ public class SeeLocationFragment extends Fragment implements OnMapReadyCallback,
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(location,16f));
mMap.setOnMarkerClickListener(this);
}
/**
* Define what should happen once Done Button is clicked
* The fragment closes and goes back to parent
* @param view
*/
@Override
public void onClick(View view) {
switch (view.getId()) {
......@@ -83,7 +97,11 @@ public class SeeLocationFragment extends Fragment implements OnMapReadyCallback,
}
}
/**
* Defines what happens when marker is clicked
* @param marker
* @return
*/
@Override
public boolean onMarkerClick(Marker marker) {
LatLng my_marker_location = marker.getPosition();
......
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