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
e8b4bc8d
Commit
e8b4bc8d
authored
Jul 18, 2018
by
Sajal Narang
Committed by
GitHub
Jul 18, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #155 from pulsejet/maploc
Show user location on InstiMap
parents
7ad93948
6f5b90fa
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
221 additions
and
34 deletions
+221
-34
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-0
app/src/main/java/app/insti/Constants.java
app/src/main/java/app/insti/Constants.java
+5
-0
app/src/main/java/app/insti/MainActivity.java
app/src/main/java/app/insti/MainActivity.java
+1
-2
app/src/main/java/app/insti/fragment/MapFragment.java
app/src/main/java/app/insti/fragment/MapFragment.java
+176
-8
app/src/main/java/com/mrane/data/Marker.java
app/src/main/java/com/mrane/data/Marker.java
+4
-0
app/src/main/java/com/mrane/zoomview/CampusMapView.java
app/src/main/java/com/mrane/zoomview/CampusMapView.java
+15
-22
app/src/main/res/drawable-xhdpi/marker_red_s.png
app/src/main/res/drawable-xhdpi/marker_red_s.png
+0
-0
app/src/main/res/layout/fragment_map.xml
app/src/main/res/layout/fragment_map.xml
+18
-2
No files found.
app/src/main/AndroidManifest.xml
View file @
e8b4bc8d
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_COARSE_LOCATION"
/>
<uses-permission
android:name=
"android.permission.ACCESS_FINE_LOCATION"
/>
<application
<application
android:allowBackup=
"true"
android:allowBackup=
"true"
...
...
app/src/main/java/app/insti/Constants.java
View file @
e8b4bc8d
...
@@ -24,4 +24,9 @@ public class Constants {
...
@@ -24,4 +24,9 @@ public class Constants {
public
static
final
String
BODY_LIST_JSON
=
"body_list_json"
;
public
static
final
String
BODY_LIST_JSON
=
"body_list_json"
;
public
static
final
String
LOGIN_MESSAGE
=
"Please login to continue!"
;
public
static
final
String
LOGIN_MESSAGE
=
"Please login to continue!"
;
/* Map */
public
static
final
double
MAP_Xn
=
19.134417
,
MAP_Yn
=
72.901229
,
MAP_Zn
=
1757
,
MAP_Zyn
=
501
;
public
static
final
double
[]
MAP_WEIGHTS_X
=
{-
11.392001766454612
,
-
36.31634553309953
,
73.91269388324432
,
-
24.14021153064087
,
3.4508817531539115
,
-
0.1462262375477863
,
5.532505074667804
,
-
1.542391995870977
,
36.14211738142935
};
public
static
final
double
[]
MAP_WEIGHTS_Y
=
{
0.09738953520399705
,
-
4.519868444089616
,
62.38493718381985
,
16.664561869057696
,
-
2.168377988768651
,
0.0919143297622087
,
0.32304266159540823
,
0.21688067854428716
,
-
12.81393255320748
};
}
}
app/src/main/java/app/insti/MainActivity.java
View file @
e8b4bc8d
...
@@ -313,8 +313,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
...
@@ -313,8 +313,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
return
;
return
;
case
MY_PERMISSIONS_REQUEST_ACCESS_LOCATION:
case
MY_PERMISSIONS_REQUEST_ACCESS_LOCATION:
if
(
grantResults
.
length
>
0
&&
grantResults
[
0
]
==
PackageManager
.
PERMISSION_GRANTED
)
{
if
(
grantResults
.
length
>
0
&&
grantResults
[
0
]
==
PackageManager
.
PERMISSION_GRANTED
)
{
MapFragment
mapFragment
=
new
MapFragment
();
MapFragment
.
getMainActivity
().
setupGPS
();
updateFragment
(
mapFragment
);
}
else
{
}
else
{
Toast
toast
=
Toast
.
makeText
(
MainActivity
.
this
,
"Need Permission"
,
Toast
.
LENGTH_SHORT
);
Toast
toast
=
Toast
.
makeText
(
MainActivity
.
this
,
"Need Permission"
,
Toast
.
LENGTH_SHORT
);
toast
.
show
();
toast
.
show
();
...
...
app/src/main/java/app/insti/fragment/MapFragment.java
View file @
e8b4bc8d
package
app.insti.fragment
;
package
app.insti.fragment
;
import
android.
app.Activity
;
import
android.
Manifest
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.IntentSender
;
import
android.content.pm.PackageManager
;
import
android.content.res.Configuration
;
import
android.content.res.Configuration
;
import
android.graphics.Color
;
import
android.graphics.Color
;
import
android.graphics.PointF
;
import
android.graphics.PointF
;
import
android.graphics.Typeface
;
import
android.graphics.Typeface
;
import
android.graphics.drawable.ColorDrawable
;
import
android.graphics.drawable.ColorDrawable
;
import
android.graphics.drawable.Drawable
;
import
android.graphics.drawable.Drawable
;
import
android.location.Location
;
import
android.location.LocationListener
;
import
android.location.LocationManager
;
import
android.media.AudioManager
;
import
android.media.AudioManager
;
import
android.media.SoundPool
;
import
android.media.SoundPool
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.os.Message
;
import
android.support.annotation.NonNull
;
import
android.support.design.widget.FloatingActionButton
;
import
android.support.v4.app.ActivityCompat
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.FragmentManager
;
import
android.support.v4.app.FragmentManager
;
import
android.support.v4.app.FragmentTransaction
;
import
android.support.v4.app.FragmentTransaction
;
import
android.support.v4.content.ContextCompat
;
import
android.support.v4.widget.DrawerLayout
;
import
android.support.v4.widget.DrawerLayout
;
import
android.support.v7.app.ActionBarDrawerToggle
;
import
android.support.v7.app.ActionBarDrawerToggle
;
import
android.support.v7.widget.Toolbar
;
import
android.support.v7.widget.Toolbar
;
...
@@ -35,7 +44,6 @@ import android.view.MotionEvent;
...
@@ -35,7 +44,6 @@ import android.view.MotionEvent;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.view.inputmethod.EditorInfo
;
import
android.view.inputmethod.EditorInfo
;
import
android.view.inputmethod.InputMethodManager
;
import
android.widget.AdapterView
;
import
android.widget.AdapterView
;
import
android.widget.ArrayAdapter
;
import
android.widget.ArrayAdapter
;
import
android.widget.EditText
;
import
android.widget.EditText
;
...
@@ -49,6 +57,15 @@ import android.widget.RelativeLayout;
...
@@ -49,6 +57,15 @@ import android.widget.RelativeLayout;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
android.widget.Toast
;
import
com.google.android.gms.common.api.ApiException
;
import
com.google.android.gms.common.api.ResolvableApiException
;
import
com.google.android.gms.location.LocationRequest
;
import
com.google.android.gms.location.LocationServices
;
import
com.google.android.gms.location.LocationSettingsRequest
;
import
com.google.android.gms.location.LocationSettingsResponse
;
import
com.google.android.gms.location.LocationSettingsStatusCodes
;
import
com.google.android.gms.tasks.OnCompleteListener
;
import
com.google.android.gms.tasks.Task
;
import
com.mrane.campusmap.ExpandableListAdapter
;
import
com.mrane.campusmap.ExpandableListAdapter
;
import
com.mrane.campusmap.FuzzySearchAdapter
;
import
com.mrane.campusmap.FuzzySearchAdapter
;
import
com.mrane.campusmap.IndexFragment
;
import
com.mrane.campusmap.IndexFragment
;
...
@@ -56,6 +73,7 @@ import com.mrane.campusmap.ListFragment;
...
@@ -56,6 +73,7 @@ import com.mrane.campusmap.ListFragment;
import
com.mrane.campusmap.SettingsManager
;
import
com.mrane.campusmap.SettingsManager
;
import
com.mrane.data.Building
;
import
com.mrane.data.Building
;
import
com.mrane.data.Locations
;
import
com.mrane.data.Locations
;
import
com.mrane.data.Marker
;
import
com.mrane.data.Room
;
import
com.mrane.data.Room
;
import
com.mrane.navigation.CardSlideListener
;
import
com.mrane.navigation.CardSlideListener
;
import
com.mrane.navigation.SlidingUpPanelLayout
;
import
com.mrane.navigation.SlidingUpPanelLayout
;
...
@@ -68,6 +86,7 @@ import java.util.List;
...
@@ -68,6 +86,7 @@ import java.util.List;
import
java.util.Locale
;
import
java.util.Locale
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
import
app.insti.Constants
;
import
app.insti.MainActivity
;
import
app.insti.MainActivity
;
import
app.insti.R
;
import
app.insti.R
;
import
app.insti.api.RetrofitInterface
;
import
app.insti.api.RetrofitInterface
;
...
@@ -77,6 +96,8 @@ import retrofit2.Call;
...
@@ -77,6 +96,8 @@ import retrofit2.Call;
import
retrofit2.Callback
;
import
retrofit2.Callback
;
import
retrofit2.Response
;
import
retrofit2.Response
;
import
static
app
.
insti
.
Constants
.
MY_PERMISSIONS_REQUEST_LOCATION
;
public
class
MapFragment
extends
Fragment
implements
TextWatcher
,
public
class
MapFragment
extends
Fragment
implements
TextWatcher
,
TextView
.
OnEditorActionListener
,
AdapterView
.
OnItemClickListener
,
View
.
OnFocusChangeListener
,
TextView
.
OnEditorActionListener
,
AdapterView
.
OnItemClickListener
,
View
.
OnFocusChangeListener
,
View
.
OnTouchListener
,
ExpandableListView
.
OnChildClickListener
{
View
.
OnTouchListener
,
ExpandableListView
.
OnChildClickListener
{
...
@@ -127,6 +148,10 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -127,6 +148,10 @@ public class MapFragment extends Fragment implements TextWatcher,
public
SoundPool
soundPool
;
public
SoundPool
soundPool
;
public
int
[]
soundPoolIds
;
public
int
[]
soundPoolIds
;
private
boolean
GPSIsSetup
=
false
;
private
boolean
followingUser
=
false
;
private
Marker
user
=
new
Marker
(
"You"
,
""
,
0
,
0
,
-
10
,
""
);
private
Handler
mHandler
=
new
Handler
()
{
private
Handler
mHandler
=
new
Handler
()
{
@Override
@Override
public
void
handleMessage
(
Message
msg
)
{
public
void
handleMessage
(
Message
msg
)
{
...
@@ -174,18 +199,46 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -174,18 +199,46 @@ public class MapFragment extends Fragment implements TextWatcher,
@Override
@Override
public
void
onResponse
(
Call
<
List
<
Venue
>>
call
,
Response
<
List
<
Venue
>>
response
)
{
public
void
onResponse
(
Call
<
List
<
Venue
>>
call
,
Response
<
List
<
Venue
>>
response
)
{
if
(
response
.
isSuccessful
())
{
if
(
response
.
isSuccessful
())
{
Locations
mLocations
=
new
Locations
(
response
.
body
());
setupWithData
(
response
.
body
());
}
}
@Override
public
void
onFailure
(
Call
<
List
<
Venue
>>
call
,
Throwable
t
)
{
setupWithData
(
new
ArrayList
<
Venue
>());
}
});
}
void
setupWithData
(
List
<
Venue
>
venues
)
{
if
(
getView
()
==
null
||
getActivity
()
==
null
)
return
;
Locations
mLocations
=
new
Locations
(
venues
);
data
=
mLocations
.
data
;
data
=
mLocations
.
data
;
markerlist
=
new
ArrayList
<
com
.
mrane
.
data
.
Marker
>(
data
.
values
());
markerlist
=
new
ArrayList
<
com
.
mrane
.
data
.
Marker
>(
data
.
values
());
setUpDrawer
();
setUpDrawer
();
setupMap
();
setupMap
();
}
}
// Setup locate button
FloatingActionButton
fab
=
getView
().
findViewById
(
R
.
id
.
locate_fab
);
fab
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onFailure
(
Call
<
List
<
Venue
>>
call
,
Throwable
t
)
{
}
public
void
onClick
(
View
v
)
{
locate
();
}
});
});
}
private
void
locate
()
{
followingUser
=
true
;
if
(!
GPSIsSetup
)
{
displayLocationSettingsRequest
(
getContext
());
}
else
if
(
user
!=
null
)
{
if
(!
campusMapView
.
isAddedMarker
(
user
))
{
campusMapView
.
addMarker
(
user
);
}
SubsamplingScaleImageView
.
AnimationBuilder
anim
=
campusMapView
.
animateCenter
(
user
.
getPoint
());
if
(
anim
!=
null
)
anim
.
start
();
}
}
}
private
void
setupMap
()
{
private
void
setupMap
()
{
...
@@ -1014,5 +1067,120 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -1014,5 +1067,120 @@ public class MapFragment extends Fragment implements TextWatcher,
public
SlidingUpPanelLayout
getSlidingLayout
()
{
public
SlidingUpPanelLayout
getSlidingLayout
()
{
return
slidingLayout
;
return
slidingLayout
;
}
}
public
void
setupGPS
()
{
if
(
getView
()
==
null
||
getActivity
()
==
null
)
return
;
// Permissions stuff
if
(
ContextCompat
.
checkSelfPermission
(
getActivity
(),
Manifest
.
permission
.
ACCESS_FINE_LOCATION
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
ActivityCompat
.
requestPermissions
(
getActivity
(),
new
String
[]{
Manifest
.
permission
.
ACCESS_FINE_LOCATION
},
MY_PERMISSIONS_REQUEST_LOCATION
);
}
else
{
LocationManager
locationManager
=
(
LocationManager
)
getActivity
().
getSystemService
(
Context
.
LOCATION_SERVICE
);
LocationListener
locationListener
=
new
MyLocationListener
();
try
{
locationManager
.
requestLocationUpdates
(
LocationManager
.
GPS_PROVIDER
,
50
,
1
,
locationListener
);
GPSIsSetup
=
true
;
Toast
.
makeText
(
getContext
(),
"WARNING: Location is in Beta. Use with Caution."
,
Toast
.
LENGTH_LONG
).
show
();
}
catch
(
SecurityException
ignored
)
{
Toast
.
makeText
(
getContext
(),
"No permission!"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
}
/*---------- Listener class to get coordinates ------------- */
private
class
MyLocationListener
implements
LocationListener
{
@Override
public
void
onLocationChanged
(
Location
loc
)
{
if
(
getView
()
==
null
||
getActivity
()
==
null
)
return
;
// Set the origin
double
Xn
=
Constants
.
MAP_Xn
,
Yn
=
Constants
.
MAP_Yn
,
Zn
=
Constants
.
MAP_Zn
,
Zyn
=
Constants
.
MAP_Zyn
;
double
x
=
(
loc
.
getLatitude
()
-
Xn
)
*
1000
;
double
y
=
(
loc
.
getLongitude
()
-
Yn
)
*
1000
;
// Pre-trained weights
double
[]
A
=
Constants
.
MAP_WEIGHTS_X
;
int
px
=
(
int
)(
Zn
+
A
[
0
]
+
A
[
1
]*
x
+
A
[
2
]*
y
+
A
[
3
]*
x
*
x
+
A
[
4
]*
x
*
x
*
y
+
A
[
5
]*
x
*
x
*
y
*
y
+
A
[
6
]*
y
*
y
+
A
[
7
]*
x
*
y
*
y
+
A
[
8
]*
x
*
y
);
A
=
Constants
.
MAP_WEIGHTS_Y
;
int
py
=
(
int
)(
Zyn
+
A
[
0
]
+
A
[
1
]*
x
+
A
[
2
]*
y
+
A
[
3
]*
x
*
x
+
A
[
4
]*
x
*
x
*
y
+
A
[
5
]*
x
*
x
*
y
*
y
+
A
[
6
]*
y
*
y
+
A
[
7
]*
x
*
y
*
y
+
A
[
8
]*
x
*
y
);
if
(
px
>
0
&&
py
>
0
&&
px
<
5430
&&
py
<
5375
){
if
(!
campusMapView
.
isAddedMarker
(
user
))
{
campusMapView
.
addMarker
(
user
);
}
user
.
setPoint
(
new
PointF
(
px
,
py
));
user
.
setName
(
"You - "
+
(
int
)
loc
.
getAccuracy
()
+
"m"
);
if
(
followingUser
)
{
SubsamplingScaleImageView
.
AnimationBuilder
anim
=
campusMapView
.
animateCenter
(
user
.
getPoint
());
if
(
anim
!=
null
)
anim
.
start
();
}
campusMapView
.
invalidate
();
}
}
@Override
public
void
onProviderDisabled
(
String
provider
)
{}
@Override
public
void
onProviderEnabled
(
String
provider
)
{}
@Override
public
void
onStatusChanged
(
String
provider
,
int
status
,
Bundle
extras
)
{}
}
public
void
setFollowingUser
(
boolean
followingUser
)
{
this
.
followingUser
=
followingUser
;
}
private
void
displayLocationSettingsRequest
(
Context
context
)
{
if
(
getView
()
==
null
||
getActivity
()
==
null
)
return
;
LocationRequest
mLocationRequest
=
LocationRequest
.
create
()
.
setPriority
(
LocationRequest
.
PRIORITY_HIGH_ACCURACY
)
.
setInterval
(
10
*
1000
)
.
setFastestInterval
(
1
*
1000
);
LocationSettingsRequest
.
Builder
settingsBuilder
=
new
LocationSettingsRequest
.
Builder
()
.
addLocationRequest
(
mLocationRequest
);
settingsBuilder
.
setAlwaysShow
(
true
);
Task
<
LocationSettingsResponse
>
result
=
LocationServices
.
getSettingsClient
(
getActivity
())
.
checkLocationSettings
(
settingsBuilder
.
build
());
result
.
addOnCompleteListener
(
new
OnCompleteListener
<
LocationSettingsResponse
>()
{
@Override
public
void
onComplete
(
@NonNull
Task
<
LocationSettingsResponse
>
task
)
{
try
{
LocationSettingsResponse
result
=
task
.
getResult
(
ApiException
.
class
);
if
(
result
.
getLocationSettingsStates
().
isGpsPresent
()
&&
result
.
getLocationSettingsStates
().
isGpsUsable
()
&&
result
.
getLocationSettingsStates
().
isLocationPresent
()
&&
result
.
getLocationSettingsStates
().
isLocationUsable
())
{
setupGPS
();
}
}
catch
(
ApiException
ex
)
{
switch
(
ex
.
getStatusCode
())
{
case
LocationSettingsStatusCodes
.
RESOLUTION_REQUIRED
:
try
{
ResolvableApiException
resolvableApiException
=
(
ResolvableApiException
)
ex
;
resolvableApiException
.
startResolutionForResult
(
getActivity
(),
87
);
setupGPS
();
}
catch
(
IntentSender
.
SendIntentException
e
)
{
}
break
;
case
LocationSettingsStatusCodes
.
SETTINGS_CHANGE_UNAVAILABLE
:
Toast
.
makeText
(
getContext
(),
"GPS is not enabled!"
,
Toast
.
LENGTH_LONG
);
break
;
}
}
}
});
}
}
}
app/src/main/java/com/mrane/data/Marker.java
View file @
e8b4bc8d
...
@@ -81,6 +81,10 @@ public class Marker {
...
@@ -81,6 +81,10 @@ public class Marker {
}
}
public
static
int
getColor
(
int
group
)
{
public
static
int
getColor
(
int
group
)
{
if
(
group
==
-
10
)
{
return
-
10
;
}
Integer
[]
yellowGroup
=
new
Integer
[]
{
HOSTELS
};
Integer
[]
yellowGroup
=
new
Integer
[]
{
HOSTELS
};
Integer
[]
blueGroup
=
new
Integer
[]
{
DEPARTMENTS
,
LABS
,
Integer
[]
blueGroup
=
new
Integer
[]
{
DEPARTMENTS
,
LABS
,
HALLS_N_AUDITORIUMS
};
HALLS_N_AUDITORIUMS
};
...
...
app/src/main/java/com/mrane/zoomview/CampusMapView.java
View file @
e8b4bc8d
...
@@ -58,6 +58,7 @@ public class CampusMapView extends SubsamplingScaleImageView {
...
@@ -58,6 +58,7 @@ public class CampusMapView extends SubsamplingScaleImageView {
private
Bitmap
yellowLockedMarker
;
private
Bitmap
yellowLockedMarker
;
private
Bitmap
greenLockedMarker
;
private
Bitmap
greenLockedMarker
;
private
Bitmap
grayLockedMarker
;
private
Bitmap
grayLockedMarker
;
private
Bitmap
userMarker
;
private
float
pointerWidth
=
12
;
private
float
pointerWidth
=
12
;
private
float
highlightedMarkerScale
;
private
float
highlightedMarkerScale
;
private
Paint
paint
;
private
Paint
paint
;
...
@@ -190,6 +191,11 @@ public class CampusMapView extends SubsamplingScaleImageView {
...
@@ -190,6 +191,11 @@ public class CampusMapView extends SubsamplingScaleImageView {
(
int
)
w
,
(
int
)
h
,
true
);
(
int
)
w
,
(
int
)
h
,
true
);
grayLockedMarker
=
Bitmap
.
createScaledBitmap
(
grayLockedMarker
,
(
int
)
w
,
grayLockedMarker
=
Bitmap
.
createScaledBitmap
(
grayLockedMarker
,
(
int
)
w
,
(
int
)
h
,
true
);
(
int
)
h
,
true
);
userMarker
=
BitmapFactory
.
decodeResource
(
getResources
(),
drawable
.
marker_red_s
,
options
);
userMarker
=
Bitmap
.
createScaledBitmap
(
userMarker
,
(
int
)
w
,
(
int
)
h
,
true
);
}
}
private
void
initPaints
()
{
private
void
initPaints
()
{
...
@@ -541,6 +547,9 @@ public class CampusMapView extends SubsamplingScaleImageView {
...
@@ -541,6 +547,9 @@ public class CampusMapView extends SubsamplingScaleImageView {
markerBitmap
=
grayMarker
;
markerBitmap
=
grayMarker
;
if
(
isAddedMarker
(
marker
))
if
(
isAddedMarker
(
marker
))
markerBitmap
=
grayLockedMarker
;
markerBitmap
=
grayLockedMarker
;
}
else
if
(
color
==
-
10
)
{
if
(
isAddedMarker
(
marker
))
markerBitmap
=
userMarker
;
}
}
if
(
highlightedMarkerScale
!=
1.0f
&&
isResultMarker
(
marker
))
{
if
(
highlightedMarkerScale
!=
1.0f
&&
isResultMarker
(
marker
))
{
...
@@ -736,26 +745,10 @@ public class CampusMapView extends SubsamplingScaleImageView {
...
@@ -736,26 +745,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;
// }
}
}
app/src/main/res/drawable-xhdpi/marker_red_s.png
0 → 100644
View file @
e8b4bc8d
6.91 KB
app/src/main/res/layout/fragment_map.xml
View file @
e8b4bc8d
...
@@ -140,10 +140,10 @@
...
@@ -140,10 +140,10 @@
</LinearLayout>
</LinearLayout>
<RelativeLayout
<RelativeLayout
android:id=
"@+id/loadingPanel"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:gravity=
"center"
>
android:gravity=
"center"
android:id=
"@+id/loadingPanel"
>
<ProgressBar
<ProgressBar
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -151,4 +151,20 @@
...
@@ -151,4 +151,20 @@
android:indeterminate=
"true"
/>
android:indeterminate=
"true"
/>
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<android.support.design.widget.FloatingActionButton
android:id=
"@+id/locate_fab"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_alignParentRight=
"true"
android:layout_marginBottom=
"96dp"
android:layout_marginRight=
"8dp"
android:src=
"@drawable/ic_my_location_black_24dp"
android:tint=
"@android:color/black"
/>
</RelativeLayout>
</FrameLayout>
</FrameLayout>
\ No newline at end of file
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