提交 a418cbb5 编写于 作者: 杜庆泉's avatar 杜庆泉

移除手动引用 utsandroid 的问题

上级 3ac3992c
......@@ -22,11 +22,6 @@ import AlertDialog from 'android.app.AlertDialog';
import DialogInterface from 'android.content.DialogInterface';
import EditText from 'android.widget.EditText';
import {
UTSAndroid
} from "io.dcloud.uts";
/**
* 定时任务参数封装
......
import {
UTSAndroid
} from "io.dcloud.uts";
import Toast from 'android.widget.Toast';
import AlertDialog from 'android.app.AlertDialog';
......
......@@ -10,7 +10,6 @@
import LottieAnimationView from 'com.airbnb.lottie.LottieAnimationView'
import LottieDrawable from 'com.airbnb.lottie.LottieDrawable'
import FileInputStream from 'java.io.FileInputStream'
import { UTSAndroid } from "io.dcloud.uts";
class CustomAnimListener extends Animator.AnimatorListener {
......
import Context from "android.content.Context";
import BatteryManager from "android.os.BatteryManager";
import { UTSAndroid } from "io.dcloud.uts";
type GetBatteryInfoOptions = {
......
......@@ -3,7 +3,6 @@ import Context from 'android.content.Context';
import AppWidgetManager from 'android.appwidget.AppWidgetManager';
import RemoteViews from 'android.widget.RemoteViews';
import Handler from 'android.os.Handler';
import UTSAndroid from 'io.dcloud.uts.UTSAndroid';
import R from 'io.dcloud.uni_modules.uts_nativepage.R';
export class DoAppWidget extends AppWidgetProvider {
......
......@@ -17,10 +17,6 @@ import IBinder from 'android.os.IBinder';
import Toast from 'android.widget.Toast';
import {
UTSAndroid
} from "io.dcloud.uts";
import Service from 'android.app.Service';
import System from 'java.lang.System';
import Looper from 'android.os.Looper';
......
import {
UTSAndroid
} from "io.dcloud.uts";
import { OnUserCaptureScreen, OffUserCaptureScreen, UserCaptureScreenCallback, OnUserCaptureScreenResult } from "../interface.uts"
......
import {
UTSAndroid
} from "io.dcloud.uts";
import ActivityCompat from "androidx.core.app.ActivityCompat";
import Manifest from "android.Manifest";
......@@ -23,26 +21,18 @@ export function requestPremission() {
*/
TencentLocationManager.setUserAgreePrivacy(true);
// 注册一个请求回调
UTSAndroid.onAppActivityRequestPermissionsResult((requestCode: number,
permissions: MutableList<string>,
grantResults: MutableList<number>) => {
/**
* 0 已同意
* -1 已拒绝
*/
console.log(grantResults);
console.log(permissions);
console.log(requestCode);
});
// 发起权限申请
ActivityCompat.requestPermissions(
UTSAndroid.getUniActivity()!,
arrayOf(Manifest.permission.ACCESS_COARSE_LOCATION,Manifest.permission.ACCESS_FINE_LOCATION), 1001);
// 请求权限
return { name: "requestPremission"};
/**
* 准备权限
*/
let permissionNeed = [Manifest.permission.ACCESS_COARSE_LOCATION,Manifest.permission.ACCESS_FINE_LOCATION];
UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight:boolean,_grantedList:string[]) {
console.log("用户同意了权限")
}, function (_doNotAskAgain:boolean,_grantedList:string[]) {
console.log("用户拒绝了部分权限:")
})
// 请求权限
return { name: "requestPremission"};
}
......
import {
UTSAndroid
} from "io.dcloud.uts";
import XToast from "com.hjq.xtoast.XToast";
import R from "io.dcloud.uni_modules.uts_toast.R";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册