diff --git a/pages.json b/pages.json index b1533b5f994d710699b45405b06de34d4271ac62..824a514ed48ca3452395cec1baaccb6434a14326 100644 --- a/pages.json +++ b/pages.json @@ -37,15 +37,6 @@ "enablePullDownRefresh": false } - }, - { - "path" : "pages/static/static", - "style" : - { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - }, { "path" : "pages/lifecycle/lifecycle", diff --git a/pages/lifecycle/lifecycle.vue b/pages/lifecycle/lifecycle.vue index 962f0ef299d957f98e15c7c0850828ae7bda8617..66f9d9d0c1c988ec83df5ccdc749247d7ea9253e 100644 --- a/pages/lifecycle/lifecycle.vue +++ b/pages/lifecycle/lifecycle.vue @@ -1,7 +1,45 @@ + - \ No newline at end of file + + + diff --git a/pages/resource/resource.vue b/pages/resource/resource.vue index 9f3522fc5baf82dfff1fd4e03892ff7730c7ee56..2855b46ffd1f5538f7a389919b5da69e62eae8af 100644 --- a/pages/resource/resource.vue +++ b/pages/resource/resource.vue @@ -3,15 +3,14 @@ - + - diff --git a/pages/static/static.vue b/pages/static/static.vue deleted file mode 100644 index 12d521c2b43b24313f5255574f46267f658781ff..0000000000000000000000000000000000000000 --- a/pages/static/static.vue +++ /dev/null @@ -1,10 +0,0 @@ - - \ No newline at end of file diff --git a/uni_modules/uts-advance/readme.md b/uni_modules/uts-advance/readme.md index e55e4f8ee69a44f7163f0edef60e30a1a07f0b74..7f435d98ad145397f256b44cfc6fad62c392b6bb 100644 --- a/uni_modules/uts-advance/readme.md +++ b/uni_modules/uts-advance/readme.md @@ -1 +1,3 @@ -# uts-advance \ No newline at end of file +# uts-advance + +UTS进阶示例插件 \ No newline at end of file diff --git a/uni_modules/uts-advance/utssdk/app-android/index.uts b/uni_modules/uts-advance/utssdk/app-android/index.uts index 1516b878d37f3e545ae56931181cfab6acb57130..aab779cc4b826ac8632eb7171cdb83e2638597be 100644 --- a/uni_modules/uts-advance/utssdk/app-android/index.uts +++ b/uni_modules/uts-advance/utssdk/app-android/index.uts @@ -10,13 +10,18 @@ import Runnable from 'java.lang.Runnable'; import Exception from 'java.lang.Exception'; import MediaPlayer from 'android.media.MediaPlayer'; +/** + * 定时任务参数封装 + */ type TimerOptions = { start: (res: string) => void; work: (res: string) => void; }; - +/** + * 执行延时任务 + */ export function doTimerTask(opts:TimerOptions) { opts.start('doTimerTask start'); setTimeout(function() { @@ -26,7 +31,9 @@ export function doTimerTask(opts:TimerOptions) { return { name: "doTimerTask" }; } - +/** + * 执行周期任务 + */ export function doIntervalTask(opts:TimerOptions) { let taskRet = setInterval(function() { @@ -37,6 +44,9 @@ export function doIntervalTask(opts:TimerOptions) { return { name: "doIntervalTask",taskId:taskRet}; } +/** + * 清除周期任务 + */ export function clearIntervalTask(taskId:number) { clearInterval(taskId); @@ -85,14 +95,12 @@ class RemoveUIRunnable extends Runnable { export function addViewToDecorView() { let uiRunable = new AddUIRunnable(); - // 获取android环境下 宿主decorview的基本信息 getUniActivity()!.runOnUiThread(uiRunable) } export function removeViewToDecorView() { var uiRunable = new RemoveUIRunnable(); - // 获取android环境下 宿主decorview的基本信息 getUniActivity()!.runOnUiThread(uiRunable) } @@ -124,31 +132,32 @@ export function playAssetAudio() { } -const RTEXT:number = 10020; -export function getResText() :string{ - // let text = "aaa " + com.sina.weibo.sdk.R2.string.com_sina_weibo_sdk_logout; - // let resText = getAppContext()!.getString(io.dcloud.uni_modules.uts_advance.R.string.dcloud_common_app_res_download_failed) - return "222"; -} - -export function initAppLifecycle() { - console.log("initAppLifecycle"); +export function initAppLifecycle(onLifecycleChange: (event:string) => void) { onAppActivityDestroy(() => { - console.log("onAppActivityDestroy"); + + let eventName = "onAppActivityDestroy - " + Date.now(); + onLifecycleChange(eventName); + console.log(eventName); }); onAppActivityPause(() => { - console.log("onAppActivityPause"); + let eventName = "onAppActivityPause - " + Date.now(); + onLifecycleChange(eventName); + console.log(eventName); }); onAppActivityResume(() => { - console.log("onAppActivityResume"); + let eventName = "onAppActivityResume - " + Date.now(); + onLifecycleChange(eventName); + console.log(eventName); }); onAppActivityBack(() => { - console.log("onAppActivityBack"); + let eventName = "onAppActivityBack - " + Date.now(); + onLifecycleChange(eventName); + console.log(eventName); }); } diff --git a/uni_modules/uts-advance/utssdk/app-android/res/value-zh/strings.xml b/uni_modules/uts-advance/utssdk/app-android/res/value-zh/strings.xml deleted file mode 100644 index 08100b94c452d9cd93258df3990842b1a2c7f2c2..0000000000000000000000000000000000000000 --- a/uni_modules/uts-advance/utssdk/app-android/res/value-zh/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Chinese Text - \ No newline at end of file diff --git a/uni_modules/uts-advance/utssdk/app-android/res/values-en/strings.xml b/uni_modules/uts-advance/utssdk/app-android/res/values-en/strings.xml deleted file mode 100644 index 5775c641f48d58d6aee9908531a03b32192bc4b2..0000000000000000000000000000000000000000 --- a/uni_modules/uts-advance/utssdk/app-android/res/values-en/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - English Text - \ No newline at end of file diff --git a/uni_modules/uts-helloworld/readme.md b/uni_modules/uts-helloworld/readme.md index 0643d4a2bed77b0fc9d5bcf7f347c4b2df3b3663..ffa10507e8a4bf1426ae13853514d439004e6d7e 100644 --- a/uni_modules/uts-helloworld/readme.md +++ b/uni_modules/uts-helloworld/readme.md @@ -1 +1,3 @@ -# uts-helloworld \ No newline at end of file +# uts-helloworld + +UTS入门示例插件 \ No newline at end of file