mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-05-23 22:37:41 +08:00
上移Toast位置避免遮挡播放模式图标 (#603)
* 上移Toast位置避免遮挡播放模式图标 * Update tools.ts * 添加更新日志 --------- Co-authored-by: momenta\sibo.jia <sibo.jia@momenta.ai> Co-authored-by: lyswhut <lyswhut@qq.com>
This commit is contained in:
parent
732edea827
commit
162764290d
@ -1,4 +1,4 @@
|
||||
### 优化
|
||||
|
||||
- 首次使用的提示窗口可以点击背景或者返回键关闭(#577)
|
||||
|
||||
- 上移 Toast 位置避免遮挡播放模式图标(#603 @sibojia)
|
||||
|
@ -116,19 +116,23 @@ export const toast = (message: string, duration: 'long' | 'short' = 'short', pos
|
||||
break
|
||||
}
|
||||
let _position
|
||||
let offset: number
|
||||
switch (position) {
|
||||
case 'top':
|
||||
_position = ToastAndroid.TOP
|
||||
offset = 80
|
||||
break
|
||||
case 'center':
|
||||
_position = ToastAndroid.CENTER
|
||||
offset = 0
|
||||
break
|
||||
case 'bottom':
|
||||
default:
|
||||
_position = ToastAndroid.BOTTOM
|
||||
offset = 80
|
||||
break
|
||||
}
|
||||
ToastAndroid.showWithGravity(message, _duration, _position)
|
||||
ToastAndroid.showWithGravityAndOffset(message, _duration, _position, 0, offset)
|
||||
}
|
||||
|
||||
export const openUrl = async(url: string): Promise<void> => Linking.canOpenURL(url).then(async() => Linking.openURL(url))
|
||||
|
Loading…
x
Reference in New Issue
Block a user