|
@@ -1,6 +1,7 @@
|
|
|
import promptAction from '@ohos.promptAction';
|
|
|
-import { BusinessError } from '@kit.BasicServicesKit';
|
|
|
-import { HashMap } from '@kit.ArkTS';
|
|
|
+import { BusinessError, deviceInfo } from '@kit.BasicServicesKit';
|
|
|
+import { HashMap, util } from '@kit.ArkTS';
|
|
|
+import { DeviceInfo } from '../bean/DeviceInfo';
|
|
|
|
|
|
export interface Btn {
|
|
|
text?: string | Resource;
|
|
@@ -67,12 +68,23 @@ function customDialogBuilder<T>(option: ListOptions<T>, dialogId: number) {
|
|
|
.listDirection(Axis.Vertical) // 排列方向
|
|
|
.scrollBar(BarState.Off)
|
|
|
.friction(0.6)
|
|
|
- .divider({ strokeWidth: 1, color: 0xEEEEEE, startMargin: 20, endMargin: 20 }) // 每行之间的分界线
|
|
|
+ .divider({
|
|
|
+ strokeWidth: 1,
|
|
|
+ color: 0xEEEEEE,
|
|
|
+ startMargin: 20,
|
|
|
+ endMargin: 20
|
|
|
+ }) // 每行之间的分界线
|
|
|
.edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring
|
|
|
.width('100%')
|
|
|
.height(option.values.length < 8 ? `${option.values.length / 16 * 100}%` : '50%')
|
|
|
.margin({ top: 20 })
|
|
|
- }.padding({ top: 20, bottom: 20, left: 20, right: 20 })
|
|
|
+ }
|
|
|
+ .padding({
|
|
|
+ top: 20,
|
|
|
+ bottom: 20,
|
|
|
+ left: 20,
|
|
|
+ right: 20
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -209,4 +221,17 @@ export class ToolsHelper {
|
|
|
}
|
|
|
return undefined
|
|
|
}
|
|
|
+
|
|
|
+ private static deviceInfo: DeviceInfo
|
|
|
+
|
|
|
+ static getDeviceInfo() {
|
|
|
+ if (!ToolsHelper.deviceInfo) {
|
|
|
+ ToolsHelper.deviceInfo = new DeviceInfo()
|
|
|
+ ToolsHelper.deviceInfo.ODID = deviceInfo.ODID
|
|
|
+ ToolsHelper.deviceInfo.manufacture = deviceInfo.manufacture
|
|
|
+ ToolsHelper.deviceInfo.brand = deviceInfo.brand
|
|
|
+ ToolsHelper.deviceInfo.osFullName = deviceInfo.osFullName
|
|
|
+ }
|
|
|
+ return ToolsHelper.deviceInfo
|
|
|
+ }
|
|
|
}
|