Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiLostAndFound
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
MUTTINENI NAVYA
InstiLostAndFound
Commits
caf11021
Commit
caf11021
authored
Nov 27, 2019
by
MUTTINENI NAVYA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small eroor
parent
eea5b411
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
9 deletions
+77
-9
app/src/main/java/com/example/instilostandfound/LocationFragment.java
.../java/com/example/instilostandfound/LocationFragment.java
+31
-3
app/src/main/java/com/example/instilostandfound/LostItemLocationFragment.java
...m/example/instilostandfound/LostItemLocationFragment.java
+24
-2
app/src/main/java/com/example/instilostandfound/SeeLocationFragment.java
...va/com/example/instilostandfound/SeeLocationFragment.java
+22
-4
No files found.
app/src/main/java/com/example/instilostandfound/LocationFragment.java
View file @
caf11021
...
...
@@ -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
());
...
...
app/src/main/java/com/example/instilostandfound/LostItemLocationFragment.java
View file @
caf11021
...
...
@@ -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
;
...
...
app/src/main/java/com/example/instilostandfound/SeeLocationFragment.java
View file @
caf11021
...
...
@@ -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
,
16
f
));
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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment