Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
react-native-amap3d
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
放牛的园子
react-native-amap3d
Commits
48e84d00
Commit
48e84d00
authored
Jun 05, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化事件处理代码
parent
aecb6355
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
13 deletions
+7
-13
AMapMarker.kt
android/src/main/java/cn/qiuxiang/react/amap3d/AMapMarker.kt
+3
-5
AMapOverlay.kt
...oid/src/main/java/cn/qiuxiang/react/amap3d/AMapOverlay.kt
+4
-8
No files found.
android/src/main/java/cn/qiuxiang/react/amap3d/AMapMarker.kt
View file @
48e84d00
...
@@ -107,11 +107,9 @@ class AMapMarker(context: ThemedReactContext) : ReactViewGroup(context) {
...
@@ -107,11 +107,9 @@ class AMapMarker(context: ThemedReactContext) : ReactViewGroup(context) {
fun
setIconView
(
overlay
:
AMapOverlay
)
{
fun
setIconView
(
overlay
:
AMapOverlay
)
{
overlay
.
addOnLayoutChangeListener
{
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
->
updateIconView
(
overlay
)
}
overlay
.
addOnLayoutChangeListener
{
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
,
_
->
updateIconView
(
overlay
)
}
overlay
.
setOnUpdateListener
(
object
:
AMapOverlay
.
OnUpdateListener
{
overlay
.
onUpdate
{
override
fun
onUpdate
()
{
updateIconView
(
overlay
)
updateIconView
(
overlay
)
}
}
})
}
}
private
fun
updateIconView
(
overlay
:
AMapOverlay
)
{
private
fun
updateIconView
(
overlay
:
AMapOverlay
)
{
...
...
android/src/main/java/cn/qiuxiang/react/amap3d/AMapOverlay.kt
View file @
48e84d00
...
@@ -4,17 +4,13 @@ import android.content.Context
...
@@ -4,17 +4,13 @@ import android.content.Context
import
com.facebook.react.views.view.ReactViewGroup
import
com.facebook.react.views.view.ReactViewGroup
class
AMapOverlay
(
context
:
Context
)
:
ReactViewGroup
(
context
)
{
class
AMapOverlay
(
context
:
Context
)
:
ReactViewGroup
(
context
)
{
private
var
onUpdateListener
:
OnUpdateListener
?
=
null
private
var
updateHandler
:
(()
->
Unit
)
?
=
null
fun
setOnUpdateListener
(
listener
:
OnUpdateListener
)
{
fun
onUpdate
(
handler
:
()
->
Unit
)
{
onUpdateListener
=
listen
er
updateHandler
=
handl
er
}
}
fun
update
()
{
fun
update
()
{
onUpdateListener
?.
onUpdate
()
updateHandler
?.
invoke
()
}
interface
OnUpdateListener
{
fun
onUpdate
()
}
}
}
}
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