Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-api
提交
5ad7aa9e
U
uni-api
项目概览
DCloud
/
uni-api
通知
655
Star
22
Fork
12
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-api
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5ad7aa9e
编写于
9月 03, 2024
作者:
taohebin@dcloud.io
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: uts-progressNotification 更新版本 去除ts警告
上级
a3d3d513
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
33 addition
and
15 deletion
+33
-15
uni_modules/uts-progressNotification/changelog.md
uni_modules/uts-progressNotification/changelog.md
+2
-0
uni_modules/uts-progressNotification/package.json
uni_modules/uts-progressNotification/package.json
+4
-3
uni_modules/uts-progressNotification/utssdk/app-android/TransparentActivity.uts
...ssNotification/utssdk/app-android/TransparentActivity.uts
+5
-5
uni_modules/uts-progressNotification/utssdk/app-android/callbacks.uts
...uts-progressNotification/utssdk/app-android/callbacks.uts
+19
-4
uni_modules/uts-progressNotification/utssdk/app-android/index.uts
...les/uts-progressNotification/utssdk/app-android/index.uts
+3
-3
未找到文件。
uni_modules/uts-progressNotification/changelog.md
浏览文件 @
5ad7aa9e
## 1.1.1(2024-09-03)
去除TypeScript警告
## 1.1.0(2024-03-08)
修复uniapp打包报错问题
## 1.0.9(2024-02-29)
...
...
uni_modules/uts-progressNotification/package.json
浏览文件 @
5ad7aa9e
{
"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"
:
{
...
...
uni_modules/uts-progressNotification/utssdk/app-android/TransparentActivity.uts
浏览文件 @
5ad7aa9e
...
...
@@ -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 { g
lobalNotificationProgressFinishCallBack, globalNotificationProgressCallBack
} from './callbacks.uts';
import { g
etGlobalNotificationProgressCallBack, 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(() => {
g
lobalNotificationProgressCallBack
?.()
globalNotificationProgressCallBack = () => { }
g
etGlobalNotificationProgressCallBack()
?.()
setGlobalNotificationProgressCallBack(() => { })
}, 100)
this.overridePendingTransition(0, 0)
}
...
...
uni_modules/uts-progressNotification/utssdk/app-android/callbacks.uts
浏览文件 @
5ad7aa9e
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
}
uni_modules/uts-progressNotification/utssdk/app-android/index.uts
浏览文件 @
5ad7aa9e
...
...
@@ -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, globalNotificationProgress
CallBack } from './callbacks.uts';
import {
setGlobalNotificationProgressCallBack, setGlobalNotificationProgressFinish
CallBack } 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录