提交 28077f70 编写于 作者: d-u-a's avatar d-u-a

new API uni.onUIStyleChange

上级 b660c94e
......@@ -115,7 +115,8 @@ const device = [
'stopBeaconDiscovery',
'checkIsSupportSoterAuthentication',
'checkIsSoterEnrolledInDevice',
'startSoterAuthentication'
'startSoterAuthentication',
'onUIStyleChange'
]
const keyboard = [
......
......@@ -118,7 +118,8 @@
"uni.onBeaconUpdate": true,
"uni.getBeacons": true,
"uni.startBeaconDiscovery": true,
"uni.stopBeaconDiscovery": true
"uni.stopBeaconDiscovery": true,
"uni.onUIStyleChange": true
}
}, {
"name": "ui",
......@@ -153,8 +154,8 @@
"uni.stopPullDownRefresh": true,
"uni.createSelectorQuery": true,
"uni.createIntersectionObserver": true,
"uni.hideKeyboard": true,
"uni.onKeyboardHeightChange": true
"uni.hideKeyboard": true,
"uni.onKeyboardHeightChange": true
}
}, {
"name": "event",
......
import {
invoke
} from 'uni-core/service/bridge'
import {
onMethod
} from '../../platform'
const callbacks = []
onMethod('onUIStyleChange', function (res) {
callbacks.forEach(callbackId => {
invoke(callbackId, res)
})
})
export function onUIStyleChange (callbackId) {
callbacks.push(callbackId)
}
......@@ -82,7 +82,13 @@ function initGlobalListeners () {
publish('onKeyboardHeightChange', {
height: event.height
})
})
})
plus.globalEvent.addEventListener('uistylechange', function (event) {
publish('onUIStyleChange', {
style: event.uistyle
})
})
plus.globalEvent.addEventListener('plusMessage', onPlusMessage)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册