import {showToast,showToastButton,androidDialog,showColorToast,screenShotEnableState,AndroidTTSVoice} from "@/uni_modules/android-utils"
showToast("test");
showToastButton("test");
androidDialog("标题","消息","确定",function(){
showToast("单击确定")
},"取消",function(){
showToast("单击取消")
return true;
})
showColorToast("这是一个安卓原生吐司","#ff0000")
screenShotEnableState(true);// 禁用截屏
screenShotEnableState(false);// 启用截屏
import {showToast,showToastButton,androidDialog,showColorToast,screenShotEnableState,AndroidTTSVoice} from "@/uni_modules/android-utils"
tts=new AndroidTTSVoice(function(state){
console.log(state)
if(state){
tts.listenerVoiceState(function(b){
console.log(b)
})
tts.speak("语音测试");
}
});
import {showToast,showToastButton,androidDialog,showColorToast,screenShotEnableState,AndroidTTSVoice} from "@/uni_modules/android-utils"
tts=new AndroidTTSVoice(function(state:boolean){
if(state){
tts.listenerVoiceState(function(b:boolean){
})
tts.speak("语音测试");
}
});
参数1 function 方法 function 参数1 boolean
参数1 string 播放内容
retrn string[]
参数1 string 语音名称
参数1 number 0-1
return boolean 是否正在播放
参数1 function 参数1 number 0 开始 1 完成 2 错误