Search in sources :

Example 1 with BatteryHistoryUpdatedEvent

use of com.edotasx.amazfit.events.BatteryHistoryUpdatedEvent in project AmazMod by edotassi.

the class BatteryCard method updateBatteryViews.

@DexWrap
public void updateBatteryViews(BatteryInfo batteryInfo) {
    updateBatteryViews(batteryInfo);
    BatteryRead batteryRead = new BatteryRead();
    batteryRead.setDate(System.currentTimeMillis());
    batteryRead.setLevel(batteryInfo.getBatteryLevel());
    batteryRead.setCharging(batteryInfo.isBatteryCharging());
    FlowManager.getModelAdapter(BatteryRead.class).insert(batteryRead);
    Log.d("BatteryChart", "level: " + batteryInfo.getBatteryLevel());
    RxBus.get().post(new BatteryHistoryUpdatedEvent());
}
Also used : BatteryRead(com.edotasx.amazfit.db.model.BatteryRead) BatteryHistoryUpdatedEvent(com.edotasx.amazfit.events.BatteryHistoryUpdatedEvent) DexWrap(lanchon.dexpatcher.annotation.DexWrap)

Aggregations

BatteryRead (com.edotasx.amazfit.db.model.BatteryRead)1 BatteryHistoryUpdatedEvent (com.edotasx.amazfit.events.BatteryHistoryUpdatedEvent)1 DexWrap (lanchon.dexpatcher.annotation.DexWrap)1