From 8011041a2520739f878381d6941cd4aeed544e31 Mon Sep 17 00:00:00 2001 From: taohebin Date: Mon, 11 Dec 2023 16:36:07 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=94=B9=E5=90=8Duts-progressNotific?= =?UTF-8?q?ation=EF=BC=8C=E5=B9=B6=E4=B8=94=E4=B8=8D=E6=8C=82=E5=88=B0uni?= =?UTF-8?q?=E4=B8=8B=EF=BC=8C=E9=9C=80=E6=98=BE=E7=A4=BA=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utssdk/interface.uts | 145 ------------------ .../changelog.md | 7 + .../package.json | 40 +---- .../readme.md | 12 +- .../utssdk/app-android/AndroidManifest.xml | 6 +- .../app-android/TransparentActivity.uts | 2 +- .../utssdk/app-android/config.json | 0 .../utssdk/app-android/constant.uts | 0 .../utssdk/app-android/index.uts | 2 +- .../values/notification_progress_styles.xml | 0 .../utssdk/app-ios/config.json | 0 .../utssdk/app-ios/index.uts | 0 .../utssdk/interface.uts | 46 ++++++ .../utssdk/unierror.uts | 0 14 files changed, 72 insertions(+), 188 deletions(-) delete mode 100644 uni_modules/uni-progress-notification/utssdk/interface.uts rename uni_modules/{uni-progress-notification => uts-progressNotification}/changelog.md (66%) rename uni_modules/{uni-progress-notification => uts-progressNotification}/package.json (68%) rename uni_modules/{uni-progress-notification => uts-progressNotification}/readme.md (77%) rename uni_modules/{uni-progress-notification => uts-progressNotification}/utssdk/app-android/AndroidManifest.xml (77%) rename uni_modules/{uni-progress-notification => uts-progressNotification}/utssdk/app-android/TransparentActivity.uts (97%) rename uni_modules/{uni-progress-notification => uts-progressNotification}/utssdk/app-android/config.json (100%) rename uni_modules/{uni-progress-notification => uts-progressNotification}/utssdk/app-android/constant.uts (100%) rename uni_modules/{uni-progress-notification => uts-progressNotification}/utssdk/app-android/index.uts (96%) rename uni_modules/{uni-progress-notification => uts-progressNotification}/utssdk/app-android/res/values/notification_progress_styles.xml (100%) rename uni_modules/{uni-progress-notification => uts-progressNotification}/utssdk/app-ios/config.json (100%) rename uni_modules/{uni-progress-notification => uts-progressNotification}/utssdk/app-ios/index.uts (100%) create mode 100644 uni_modules/uts-progressNotification/utssdk/interface.uts rename uni_modules/{uni-progress-notification => uts-progressNotification}/utssdk/unierror.uts (100%) diff --git a/uni_modules/uni-progress-notification/utssdk/interface.uts b/uni_modules/uni-progress-notification/utssdk/interface.uts deleted file mode 100644 index 74841bf..0000000 --- a/uni_modules/uni-progress-notification/utssdk/interface.uts +++ /dev/null @@ -1,145 +0,0 @@ -export type uni = { - /** - * createNotificationProgress() - * @description - * 创建通知栏下载进度消息 - * @param {CreateNotificationProgressOptions} - * @return {void} - * @uniPlatform { - * "app": { - * "android": { - * "osVer": "4.4", - * "uniVer": "3.9+", - * "unixVer": "3.9+" - * }, - * "ios": { - * "osVer": "x", - * "uniVer": "x", - * "unixVer": "x" - * } - * } - * } - * @example - ```typescript - uni.createNotificationProgress({ - title: "正在下载升级包", - content: "进度 50%", - progress: 50, - onClick:()=>{ - console.log("正在下载"); - } - } - ``` - */ - createNotificationProgress : (options : CreateNotificationProgressOptions) => void, - /** - * finishNotificationProgress() - * @description - * 通知栏显示下载完成,并且传入点击通知栏消息的回调。 - * @param {FinishNotificationProgressOptions} - * @return {void} - * @uniPlatform { - * "app": { - * "android": { - * "osVer": "4.4", - * "uniVer": "3.9+", - * "unixVer": "3.9+" - * }, - * "ios": { - * "osVer": "x", - * "uniVer": "x", - * "unixVer": "x" - * } - * } - * } - * @example - ```typescript - uni.finishNotificationProgress({ - title: "安装升级包", - content: "下载完成。", - onClick: () => { - uni.installApk({ - filePath: e.tempFilePath, - complete(res) { - console.log(res); - } - }) - } - } - ``` - */ - finishNotificationProgress : (options: FinishNotificationProgressOptions) => void, - /** - * cancelNotificationProgress() - * @description - * 取消通知消息显示 - * @param {void} - * @return {void} - * @uniPlatform { - * "app": { - * "android": { - * "osVer": "4.4", - * "uniVer": "3.9+", - * "unixVer": "3.9+" - * }, - * "ios": { - * "osVer": "x", - * "uniVer": "x", - * "unixVer": "x" - * } - * } - * } - * @example - ```typescript - uni.cancelNotificationProgress() - ``` - */ - cancelNotificationProgress : () => void -} - -export type CreateNotificationProgressOptions = { - /** - * 通知标题 - * @defaultValue 应用名称 - */ - title ?: string | null - /** - * 通知内容 - */ - content : string, - /** - * 进度 - */ - progress : number, - /** - * 点击通知消息回调 - * @defaultValue null - */ - onClick? : (() => void) | null -} - - -export type FinishNotificationProgressOptions = { - /** - * 通知标题 - * @defaultValue 应用名称 - */ - title ?: string | null - /** - * 通知内容 - */ - content : string, - /** - * 点击通知消息回调 - */ - onClick : () => void -} - - -export type CreateNotificationProgress = (options : CreateNotificationProgressOptions) => void; - - -export type CancelNotificationProgress = () => void; - - -export type FinishNotificationProgress = (options: FinishNotificationProgressOptions) => void \ No newline at end of file diff --git a/uni_modules/uni-progress-notification/changelog.md b/uni_modules/uts-progressNotification/changelog.md similarity index 66% rename from uni_modules/uni-progress-notification/changelog.md rename to uni_modules/uts-progressNotification/changelog.md index 1066eb5..3324704 100644 --- a/uni_modules/uni-progress-notification/changelog.md +++ b/uni_modules/uts-progressNotification/changelog.md @@ -1,3 +1,10 @@ +## 1.0.7(2023-12-11) +去除无用代码 +## 1.0.6(2023-12-11) +修改文档 +## 1.0.5(2023-12-11) +1.修改插件名称 +2.修改插件引入方式为import导入 ## 1.0.4(2023-11-30) 1. createNotificationProgress增加`onClick`回调 2.修复在小米部分系统上,通知消息会归类于不重要通知的bug diff --git a/uni_modules/uni-progress-notification/package.json b/uni_modules/uts-progressNotification/package.json similarity index 68% rename from uni_modules/uni-progress-notification/package.json rename to uni_modules/uts-progressNotification/package.json index e4bae82..09e6709 100644 --- a/uni_modules/uni-progress-notification/package.json +++ b/uni_modules/uts-progressNotification/package.json @@ -1,10 +1,10 @@ { - "id": "uni-progress-notification", - "displayName": "uni-progress-notification", - "version": "1.0.4", - "description": "uni-progress-notification", + "id": "uts-progressNotification", + "displayName": "uts-progressNotification", + "version": "1.0.7", + "description": "uts-progressNotification", "keywords": [ - "uni-progress-notification" + "uts-progressNotification" ], "repository": "", "engines": { @@ -32,34 +32,6 @@ }, "uni_modules": { "dependencies": [], - "uni-ext-api": { - "uni": { - "createNotificationProgress": { - "name": "createNotificationProgress", - "app": { - "js": true, - "kotlin": true, - "swift": false - } - }, - "finishNotificationProgress": { - "name": "finishNotificationProgress", - "app": { - "js": true, - "kotlin": true, - "swift": false - } - }, - "cancelNotificationProgress": { - "name": "cancelNotificationProgress", - "app": { - "js": true, - "kotlin": true, - "swift": false - } - } - } - }, "encrypt": [], "platforms": { "cloud": { @@ -108,4 +80,4 @@ } } } -} \ No newline at end of file +} diff --git a/uni_modules/uni-progress-notification/readme.md b/uni_modules/uts-progressNotification/readme.md similarity index 77% rename from uni_modules/uni-progress-notification/readme.md rename to uni_modules/uts-progressNotification/readme.md index 161bf99..87d8576 100644 --- a/uni_modules/uni-progress-notification/readme.md +++ b/uni_modules/uts-progressNotification/readme.md @@ -1,12 +1,16 @@ -# uni-download-notification +# uts-progressNotification -## 使用说明 +## 使用说明 Android平台创建显示进度的通知栏消息 **注意: 需要自定义基座,否则点击通知栏消息不会拉起应用** -### uni.createNotificationProgress(options : CreateNotificationProgressOptions) : void, +### 导入 + +需要import导入插件 + +### createNotificationProgress(options : CreateNotificationProgressOptions) : void, 创建显示进度的通知栏消息 @@ -35,7 +39,7 @@ export type CreateNotificationProgressOptions = { } ``` -### uni.finishNotificationProgress(options: FinishNotificationProgressOptions) : void +### finishNotificationProgress(options: FinishNotificationProgressOptions) : void 完成时调用的API,比如下载完成后需要显示下载完成并隐藏进度时调用。 diff --git a/uni_modules/uni-progress-notification/utssdk/app-android/AndroidManifest.xml b/uni_modules/uts-progressNotification/utssdk/app-android/AndroidManifest.xml similarity index 77% rename from uni_modules/uni-progress-notification/utssdk/app-android/AndroidManifest.xml rename to uni_modules/uts-progressNotification/utssdk/app-android/AndroidManifest.xml index 4d679e4..93749e9 100644 --- a/uni_modules/uni-progress-notification/utssdk/app-android/AndroidManifest.xml +++ b/uni_modules/uts-progressNotification/utssdk/app-android/AndroidManifest.xml @@ -1,11 +1,11 @@ + package="uts.sdk.modules.utsProgressNotification"> - - \ No newline at end of file + diff --git a/uni_modules/uni-progress-notification/utssdk/app-android/TransparentActivity.uts b/uni_modules/uts-progressNotification/utssdk/app-android/TransparentActivity.uts similarity index 97% rename from uni_modules/uni-progress-notification/utssdk/app-android/TransparentActivity.uts rename to uni_modules/uts-progressNotification/utssdk/app-android/TransparentActivity.uts index 0368df2..283e01d 100644 --- a/uni_modules/uni-progress-notification/utssdk/app-android/TransparentActivity.uts +++ b/uni_modules/uts-progressNotification/utssdk/app-android/TransparentActivity.uts @@ -15,7 +15,7 @@ export class TransparentActivity extends Activity { override onCreate(savedInstanceState : Bundle | null) { super.onCreate(savedInstanceState) - this.fullScreen(this) + this.fullScreen(this) const action = this.getIntent().getAction() if (action == ACTION_DOWNLOAD_FINISH) { setTimeout(() => { diff --git a/uni_modules/uni-progress-notification/utssdk/app-android/config.json b/uni_modules/uts-progressNotification/utssdk/app-android/config.json similarity index 100% rename from uni_modules/uni-progress-notification/utssdk/app-android/config.json rename to uni_modules/uts-progressNotification/utssdk/app-android/config.json diff --git a/uni_modules/uni-progress-notification/utssdk/app-android/constant.uts b/uni_modules/uts-progressNotification/utssdk/app-android/constant.uts similarity index 100% rename from uni_modules/uni-progress-notification/utssdk/app-android/constant.uts rename to uni_modules/uts-progressNotification/utssdk/app-android/constant.uts diff --git a/uni_modules/uni-progress-notification/utssdk/app-android/index.uts b/uni_modules/uts-progressNotification/utssdk/app-android/index.uts similarity index 96% rename from uni_modules/uni-progress-notification/utssdk/app-android/index.uts rename to uni_modules/uts-progressNotification/utssdk/app-android/index.uts index a04b7e0..39d14cd 100644 --- a/uni_modules/uni-progress-notification/utssdk/app-android/index.uts +++ b/uni_modules/uts-progressNotification/utssdk/app-android/index.uts @@ -111,7 +111,7 @@ function reset() { function createPendingIntent(context : Context, action : string) : PendingIntent { const i = new Intent(action); - i.setComponent(new ComponentName(context.getPackageName(), "uts.sdk.modules.uniProgressNotification.TransparentActivity")); + i.setComponent(new ComponentName(context.getPackageName(), "uts.sdk.modules.utsProgressNotification.TransparentActivity")); let flags = PendingIntent.FLAG_ONE_SHOT; if (Build.VERSION.SDK_INT >= 23) { flags = PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE; diff --git a/uni_modules/uni-progress-notification/utssdk/app-android/res/values/notification_progress_styles.xml b/uni_modules/uts-progressNotification/utssdk/app-android/res/values/notification_progress_styles.xml similarity index 100% rename from uni_modules/uni-progress-notification/utssdk/app-android/res/values/notification_progress_styles.xml rename to uni_modules/uts-progressNotification/utssdk/app-android/res/values/notification_progress_styles.xml diff --git a/uni_modules/uni-progress-notification/utssdk/app-ios/config.json b/uni_modules/uts-progressNotification/utssdk/app-ios/config.json similarity index 100% rename from uni_modules/uni-progress-notification/utssdk/app-ios/config.json rename to uni_modules/uts-progressNotification/utssdk/app-ios/config.json diff --git a/uni_modules/uni-progress-notification/utssdk/app-ios/index.uts b/uni_modules/uts-progressNotification/utssdk/app-ios/index.uts similarity index 100% rename from uni_modules/uni-progress-notification/utssdk/app-ios/index.uts rename to uni_modules/uts-progressNotification/utssdk/app-ios/index.uts diff --git a/uni_modules/uts-progressNotification/utssdk/interface.uts b/uni_modules/uts-progressNotification/utssdk/interface.uts new file mode 100644 index 0000000..9570353 --- /dev/null +++ b/uni_modules/uts-progressNotification/utssdk/interface.uts @@ -0,0 +1,46 @@ +export type CreateNotificationProgressOptions = { + /** + * 通知标题 + * @defaultValue 应用名称 + */ + title ?: string | null + /** + * 通知内容 + */ + content : string, + /** + * 进度 + */ + progress : number, + /** + * 点击通知消息回调 + * @defaultValue null + */ + onClick? : (() => void) | null +} + + +export type FinishNotificationProgressOptions = { + /** + * 通知标题 + * @defaultValue 应用名称 + */ + title ?: string | null + /** + * 通知内容 + */ + content : string, + /** + * 点击通知消息回调 + */ + onClick : () => void +} + + +export type CreateNotificationProgress = (options : CreateNotificationProgressOptions) => void; + + +export type CancelNotificationProgress = () => void; + + +export type FinishNotificationProgress = (options: FinishNotificationProgressOptions) => void diff --git a/uni_modules/uni-progress-notification/utssdk/unierror.uts b/uni_modules/uts-progressNotification/utssdk/unierror.uts similarity index 100% rename from uni_modules/uni-progress-notification/utssdk/unierror.uts rename to uni_modules/uts-progressNotification/utssdk/unierror.uts -- GitLab