Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
Hello UTS
提交
e13b0eeb
H
Hello UTS
项目概览
DCloud
/
Hello UTS
通知
1598
Star
27
Fork
9
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
2
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
Hello UTS
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
2
Issue
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
e13b0eeb
编写于
9月 01, 2022
作者:
杜庆泉
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add res button
上级
5f6f1453
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
32 addition
and
14 deletion
+32
-14
manifest.json
manifest.json
+2
-2
pages/advance/advance.vue
pages/advance/advance.vue
+2
-2
pages/resource/resource.vue
pages/resource/resource.vue
+9
-5
uni_modules/uts-advance/utssdk/app-android/config.json
uni_modules/uts-advance/utssdk/app-android/config.json
+1
-1
uni_modules/uts-advance/utssdk/app-android/index.uts
uni_modules/uts-advance/utssdk/app-android/index.uts
+12
-4
uni_modules/uts-advance/utssdk/app-android/res/value-zh/strings.xml
...s/uts-advance/utssdk/app-android/res/value-zh/strings.xml
+3
-0
uni_modules/uts-advance/utssdk/app-android/res/values-en/strings.xml
.../uts-advance/utssdk/app-android/res/values-en/strings.xml
+3
-0
未找到文件。
manifest.json
浏览文件 @
e13b0eeb
...
...
@@ -2,8 +2,8 @@
"name"
:
"HelloUTS"
,
"appid"
:
"__UNI__70BE9D0"
,
"description"
:
""
,
"versionName"
:
"1.0.
0
"
,
"versionCode"
:
"10
0
"
,
"versionName"
:
"1.0.
1
"
,
"versionCode"
:
"10
1
"
,
"transformPx"
:
false
,
/*
5
+App特有相关
*/
"app-plus"
:
{
...
...
pages/advance/advance.vue
浏览文件 @
e13b0eeb
...
...
@@ -10,7 +10,7 @@
<view
class=
"uni-btn-v uni-common-mt"
>
<button
type=
"primary"
@
tap=
"testAddToDecorView"
>
添加TextView至视图顶层
</button>
<button
type=
"primary"
@
tap=
"testRemoveToDecorView"
>
移除视图顶层的TextView
</button>
<button
type=
"primary"
@
tap=
"test
LoadImag
e"
>
资源加载示例
</button>
<button
type=
"primary"
@
tap=
"test
Resourc
e"
>
资源加载示例
</button>
<button
type=
"primary"
@
tap=
"testLifecyle"
>
activity生命周期监听
</button>
</view>
...
...
@@ -84,7 +84,7 @@
removeViewToDecorView
();
},
test
LoadImag
e
:
function
()
{
test
Resourc
e
:
function
()
{
uni
.
navigateTo
({
url
:
'
/pages/resource/resource
'
})
...
...
pages/resource/resource.vue
浏览文件 @
e13b0eeb
...
...
@@ -3,14 +3,15 @@
<page-head
:title=
"title"
></page-head>
<image
:src=
"logo"
mode=
"aspectFit"
style=
"width: 100%;"
></image>
<view
class=
"uni-btn-v uni-common-mt"
>
<button
type=
"primary"
>
插件内置图片
</button>
<button
type=
"primary"
@
tap=
"testAssetLoad"
>
asset资源加载
</button>
<button
type=
"primary"
>
展示插件内置图片
</button>
<button
type=
"primary"
@
tap=
"testAssetLoad"
>
播放asset音频(需自定义基座)
</button>
<button
type=
"primary"
@
tap=
"testResText"
>
获取res目录资源(需自定义基座)
</button>
</view>
</view>
</
template
>
<
script
>
import
{
getLogoPath
,
getAssetAPath
}
from
'
../../uni_modules/uts-advance
'
import
{
getLogoPath
,
playAssetAudio
,
getResText
}
from
'
../../uni_modules/uts-advance
'
export
default
{
...
...
@@ -25,8 +26,11 @@
},
methods
:
{
testAssetLoad
(){
let
aseetPath
=
getAssetAPath
();
console
.
log
(
aseetPath
);
playAssetAudio
();
},
testResText
(){
let
resText
=
getResText
();
console
.
log
(
resText
);
}
}
...
...
uni_modules/uts-advance/utssdk/app-android/config.json
浏览文件 @
e13b0eeb
...
...
@@ -4,4 +4,4 @@
"dependencies"
:
[{
}],
"minSdkVersion"
:
21
}
,
\ No newline at end of file
}
\ No newline at end of file
uni_modules/uts-advance/utssdk/app-android/index.uts
浏览文件 @
e13b0eeb
...
...
@@ -113,17 +113,25 @@ export function getLogoPath(): string {
}
export function
getAssetAPath
() {
export function
playAssetAudio
() {
var
assetManager = getAppContext()!.getAssets();
var
afd = assetManager.openFd("free.mp3");
var
mediaPlayer = new MediaPlayer();
let
assetManager = getAppContext()!.getAssets();
let
afd = assetManager.openFd("free.mp3");
let
mediaPlayer = new MediaPlayer();
mediaPlayer.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(), afd.getLength());
mediaPlayer.prepare();
mediaPlayer.start();
}
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";
}
...
...
uni_modules/uts-advance/utssdk/app-android/res/value-zh/strings.xml
0 → 100644
浏览文件 @
e13b0eeb
<resources>
<string
name=
"uts_resource_text"
>
Chinese Text
</string>
</resources>
\ No newline at end of file
uni_modules/uts-advance/utssdk/app-android/res/values-en/strings.xml
0 → 100644
浏览文件 @
e13b0eeb
<resources>
<string
name=
"uts_resource_text"
>
English Text
</string>
</resources>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录