提交 5ad7aa9e 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

fix: uts-progressNotification 更新版本 去除ts警告

上级 a3d3d513
## 1.1.1(2024-09-03)
去除TypeScript警告
## 1.1.0(2024-03-08)
修复uniapp打包报错问题
## 1.0.9(2024-02-29)
......
{
"id": "uts-progressNotification",
"displayName": "uts-progressNotification",
"version": "1.1.0",
"version": "1.1.1",
"description": "uts-progressNotification",
"keywords": [
"uts-progressNotification"
"progressNotification"
],
"repository": "",
"engines": {
......@@ -36,7 +36,8 @@
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
"aliyun": "y",
"alipay": "n"
},
"client": {
"Vue": {
......
......@@ -4,7 +4,7 @@ import Build from 'android.os.Build';
import View from 'android.view.View';
import Color from 'android.graphics.Color';
import WindowManager from 'android.view.WindowManager';
import { globalNotificationProgressFinishCallBack, globalNotificationProgressCallBack } from './callbacks.uts';
import { getGlobalNotificationProgressCallBack, getGlobalNotificationProgressFinishCallBack, setGlobalNotificationProgressCallBack, setGlobalNotificationProgressFinishCallBack} from './callbacks.uts';
import { ACTION_DOWNLOAD_FINISH, ACTION_DOWNLOAD_PROGRESS } from "./constant.uts"
......@@ -20,16 +20,16 @@ export class TransparentActivity extends Activity {
const action = this.getIntent().getAction()
if (action == ACTION_DOWNLOAD_FINISH) {
setTimeout(() => {
globalNotificationProgressFinishCallBack()
globalNotificationProgressFinishCallBack = () => { }
getGlobalNotificationProgressFinishCallBack()?.()
setGlobalNotificationProgressFinishCallBack(() => { })
}, 100)
this.overridePendingTransition(0, 0)
}
if (action == ACTION_DOWNLOAD_PROGRESS) {
setTimeout(() => {
globalNotificationProgressCallBack?.()
globalNotificationProgressCallBack = () => { }
getGlobalNotificationProgressCallBack()?.()
setGlobalNotificationProgressCallBack(() => { })
}, 100)
this.overridePendingTransition(0, 0)
}
......
export let globalNotificationProgressCallBack : (() => void) | null = () => { }
export let globalNotificationProgressFinishCallBack = () => { }
let globalNotificationProgressCallBack : (() => void) | null = () => { }
let globalNotificationProgressFinishCallBack : (() => void) | null = () => { }
export function setGlobalNotificationProgressCallBack(callBack : (() => void) | null) : void {
globalNotificationProgressCallBack = callBack
}
export function getGlobalNotificationProgressCallBack() : (() => void) | null {
return globalNotificationProgressCallBack
}
export function setGlobalNotificationProgressFinishCallBack(callBack : (() => void) | null) : void {
globalNotificationProgressFinishCallBack = callBack
}
export function getGlobalNotificationProgressFinishCallBack() : (() => void) | null {
return globalNotificationProgressFinishCallBack
}
......@@ -9,7 +9,7 @@ import PendingIntent from 'android.app.PendingIntent';
import { CreateNotificationProgressOptions, FinishNotificationProgressOptions } from '../interface.uts';
import { ACTION_DOWNLOAD_FINISH, ACTION_DOWNLOAD_PROGRESS } from "./constant.uts"
import { globalNotificationProgressFinishCallBack, globalNotificationProgressCallBack } from './callbacks.uts';
import { setGlobalNotificationProgressCallBack, setGlobalNotificationProgressFinishCallBack } from './callbacks.uts';
export { TransparentActivity } from './TransparentActivity.uts';
......@@ -67,7 +67,7 @@ export function cancelNotificationProgress() : void {
function realCreateNotificationProgress(title : string, content : string, progress : number, cb : (() => void) | null) : void {
globalNotificationProgressCallBack = cb
setGlobalNotificationProgressCallBack(cb)
const context = UTSAndroid.getAppContext() as Context
const notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
createDownloadChannel(notificationManager)
......@@ -81,7 +81,7 @@ function realCreateNotificationProgress(title : string, content : string, progre
export function finishNotificationProgress(options : FinishNotificationProgressOptions) {
globalNotificationProgressFinishCallBack = options.onClick
setGlobalNotificationProgressFinishCallBack(options.onClick)
const context = UTSAndroid.getAppContext() as Context
const notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
createDownloadChannel(notificationManager)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册