Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
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
RAHUL SHARMA
InstiApp
Commits
9e2278a3
Commit
9e2278a3
authored
Jul 15, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup locate button properly
parent
886db27a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
26 deletions
+25
-26
app/src/main/java/app/insti/fragment/MapFragment.java
app/src/main/java/app/insti/fragment/MapFragment.java
+20
-5
app/src/main/java/com/mrane/zoomview/CampusMapView.java
app/src/main/java/com/mrane/zoomview/CampusMapView.java
+5
-21
No files found.
app/src/main/java/app/insti/fragment/MapFragment.java
View file @
9e2278a3
...
@@ -141,7 +141,10 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -141,7 +141,10 @@ public class MapFragment extends Fragment implements TextWatcher,
public
static
final
int
SOUND_ID_REMOVE
=
2
;
public
static
final
int
SOUND_ID_REMOVE
=
2
;
public
SoundPool
soundPool
;
public
SoundPool
soundPool
;
public
int
[]
soundPoolIds
;
public
int
[]
soundPoolIds
;
Marker
user
=
new
Marker
(
"You"
,
""
,
0
,
0
,
1
,
""
);
private
boolean
GPSIsSetup
=
false
;
private
boolean
followingUser
=
false
;
private
Marker
user
=
new
Marker
(
"You"
,
""
,
0
,
0
,
1
,
""
);
private
Handler
mHandler
=
new
Handler
()
{
private
Handler
mHandler
=
new
Handler
()
{
@Override
@Override
...
@@ -219,8 +222,13 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -219,8 +222,13 @@ public class MapFragment extends Fragment implements TextWatcher,
}
}
private
void
locate
()
{
private
void
locate
()
{
setupGPS
();
followingUser
=
true
;
if
(!
GPSIsSetup
)
{
setupGPS
();
}
else
if
(
user
!=
null
)
{
SubsamplingScaleImageView
.
AnimationBuilder
anim
=
campusMapView
.
animateCenter
(
user
.
getPoint
());
if
(
anim
!=
null
)
anim
.
start
();
}
}
}
private
void
setupMap
()
{
private
void
setupMap
()
{
...
@@ -1066,6 +1074,7 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -1066,6 +1074,7 @@ public class MapFragment extends Fragment implements TextWatcher,
locationManager
.
requestLocationUpdates
(
locationManager
.
requestLocationUpdates
(
LocationManager
.
GPS_PROVIDER
,
50
,
1
,
locationListener
);
LocationManager
.
GPS_PROVIDER
,
50
,
1
,
locationListener
);
campusMapView
.
addMarker
(
user
);
campusMapView
.
addMarker
(
user
);
GPSIsSetup
=
true
;
}
catch
(
SecurityException
ignored
)
{
}
catch
(
SecurityException
ignored
)
{
Toast
.
makeText
(
getContext
(),
"No permission!"
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
getContext
(),
"No permission!"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
...
@@ -1099,8 +1108,10 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -1099,8 +1108,10 @@ public class MapFragment extends Fragment implements TextWatcher,
if
(
px
>
0
&&
py
>
0
&&
px
<
5430
&&
py
<
5375
){
if
(
px
>
0
&&
py
>
0
&&
px
<
5430
&&
py
<
5375
){
user
.
setPoint
(
new
PointF
(
px
,
py
));
user
.
setPoint
(
new
PointF
(
px
,
py
));
SubsamplingScaleImageView
.
AnimationBuilder
anim
=
campusMapView
.
animateCenter
(
user
.
getPoint
());
if
(
followingUser
)
{
if
(
anim
!=
null
)
anim
.
start
();
SubsamplingScaleImageView
.
AnimationBuilder
anim
=
campusMapView
.
animateCenter
(
user
.
getPoint
());
if
(
anim
!=
null
)
anim
.
start
();
}
campusMapView
.
invalidate
();
campusMapView
.
invalidate
();
}
}
}
}
...
@@ -1114,5 +1125,9 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -1114,5 +1125,9 @@ public class MapFragment extends Fragment implements TextWatcher,
@Override
@Override
public
void
onStatusChanged
(
String
provider
,
int
status
,
Bundle
extras
)
{}
public
void
onStatusChanged
(
String
provider
,
int
status
,
Bundle
extras
)
{}
}
}
public
void
setFollowingUser
(
boolean
followingUser
)
{
this
.
followingUser
=
followingUser
;
}
}
}
app/src/main/java/com/mrane/zoomview/CampusMapView.java
View file @
9e2278a3
...
@@ -736,26 +736,10 @@ public class CampusMapView extends SubsamplingScaleImageView {
...
@@ -736,26 +736,10 @@ public class CampusMapView extends SubsamplingScaleImageView {
return
scale
;
return
scale
;
}
}
// public void setAddedMarkers(String addedMarkerString) {
@Override
// addedMarkerList = new ArrayList<Marker>();
public
boolean
onTouchEvent
(
MotionEvent
event
)
{
// String[] addedMarkerNames = addedMarkerString.split("###");
MapFragment
.
getMainActivity
().
setFollowingUser
(
false
);
// for (String s : addedMarkerNames) {
return
super
.
onTouchEvent
(
event
);
// if (!s.equals("")) {
}
// Log.d("test123","names = " + s);
// if (data.containsKey(s)) {
// addedMarkerList.add(data.get(s));
// }
// }
// }
// }
//
// public String getAddedMarkerString() {
// String s = "";
// for (Marker m : addedMarkerList) {
// s = s + m.name + "###";
// }
// Log.d("test123","addedMarkerStringGen = " + s);
// return s;
// }
}
}
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