Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
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
xpstem
appinventor-sources
Commits
7ec248ca
Commit
7ec248ca
authored
Jun 18, 2018
by
User
Committed by
Jeffrey Schiller
Jun 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update NativeOpenStreetMapController.java (#1265)
Move compass to the right side as shown in the designer.
parent
c0cd37b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
appinventor/components/src/com/google/appinventor/components/runtime/util/NativeOpenStreetMapController.java
...omponents/runtime/util/NativeOpenStreetMapController.java
+9
-0
No files found.
appinventor/components/src/com/google/appinventor/components/runtime/util/NativeOpenStreetMapController.java
View file @
7ec248ca
...
@@ -76,6 +76,7 @@ import android.graphics.drawable.Drawable;
...
@@ -76,6 +76,7 @@ import android.graphics.drawable.Drawable;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.MotionEvent
;
import
android.view.MotionEvent
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewTreeObserver
;
import
android.view.animation.Animation
;
import
android.view.animation.Animation
;
class
NativeOpenStreetMapController
implements
MapController
,
MapListener
{
class
NativeOpenStreetMapController
implements
MapController
,
MapListener
{
...
@@ -359,6 +360,14 @@ class NativeOpenStreetMapController implements MapController, MapListener {
...
@@ -359,6 +360,14 @@ class NativeOpenStreetMapController implements MapController, MapListener {
public
void
setCompassEnabled
(
boolean
enabled
)
{
public
void
setCompassEnabled
(
boolean
enabled
)
{
if
(
enabled
&&
compass
==
null
)
{
if
(
enabled
&&
compass
==
null
)
{
compass
=
new
CompassOverlay
(
view
.
getContext
(),
view
);
compass
=
new
CompassOverlay
(
view
.
getContext
(),
view
);
view
.
getViewTreeObserver
().
addOnPreDrawListener
(
new
ViewTreeObserver
.
OnPreDrawListener
()
{
@Override
public
boolean
onPreDraw
()
{
float
density
=
view
.
getContext
().
getResources
().
getDisplayMetrics
().
density
;
compass
.
setCompassCenter
(
view
.
getMeasuredWidth
()
/
density
-
35
,
35
);
return
true
;
}
});
view
.
getOverlayManager
().
add
(
compass
);
view
.
getOverlayManager
().
add
(
compass
);
}
}
if
(
compass
!=
null
)
{
if
(
compass
!=
null
)
{
...
...
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