dunno
This commit is contained in:
parent
f0b568b3fb
commit
dd13101bcb
3
client/Nightr/reference.d.ts
vendored
Normal file
3
client/Nightr/reference.d.ts
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
|
||||||
|
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />
|
||||||
|
/// <reference path="./node_modules/tns-platform-declarations/android-24.d.ts" />
|
|
@ -7,6 +7,18 @@ import { ios as iosUtils } from "tns-core-modules/utils/utils";
|
||||||
})
|
})
|
||||||
export class MyBatteryInfoService {
|
export class MyBatteryInfoService {
|
||||||
|
|
||||||
|
|
||||||
|
/* public getBatteryLife() {
|
||||||
|
// use tns-platform-dclarations to access native APIs (e.g. android.content.Intent)
|
||||||
|
applicationModule.android.registerBroadcastReceiver(
|
||||||
|
android.content.Intent.ACTION_BATTERY_CHANGED,
|
||||||
|
(androidContext, intent) => {
|
||||||
|
const level = intent.getIntExtra(android.os.BatteryManager.EXTRA_LEVEL, -1);
|
||||||
|
const scale = intent.getIntExtra(android.os.BatteryManager.EXTRA_SCALE, -1);
|
||||||
|
const percent = (level / scale) * 100.0;
|
||||||
|
vm.set("batteryLife", percent.toString());
|
||||||
|
});
|
||||||
|
} */
|
||||||
/*public getBatteryLife() {
|
/*public getBatteryLife() {
|
||||||
if (iosApp){
|
if (iosApp){
|
||||||
iosUtils.getter(UIDevice, UIDevice.currentDevice).batteryMonitoringEnabled = true;
|
iosUtils.getter(UIDevice, UIDevice.currentDevice).batteryMonitoringEnabled = true;
|
||||||
|
|
Loading…
Reference in a new issue