From 8a176ce1dcc8fbd112b6f7c6bfa6a4686e7f83ae Mon Sep 17 00:00:00 2001 From: smirko-dev Date: Thu, 17 Dec 2020 08:15:50 +0100 Subject: [PATCH] Added touch event to hide appointment --- app/index.js | 17 ++++++++++++----- resources/index.gui | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/index.js b/app/index.js index fd7627d..5112070 100644 --- a/app/index.js +++ b/app/index.js @@ -1,11 +1,8 @@ import document from "document"; import { battery } from "power"; -import { preferences } from "user-settings"; import { display } from "display"; import { today } from 'user-activity'; -import { me } from "appbit"; import { me as device } from "device"; -import * as util from "../common/utils"; import * as appointment from "./appointment"; import * as clock from "./clock"; import * as messaging from "messaging"; @@ -67,8 +64,6 @@ clock.initialize("minutes", data => { dateLabel.text = data.date; // Update appointment renderAppointment(); - // Update battery - renderBattery(); }); battery.onchange = (evt) => { @@ -86,8 +81,18 @@ display.addEventListener("change", () => { renderAppointment(); renderBattery(); } + // Stop updating activity info + else { + hideActivity(); + } }); +// Hide event when touched +appointmentsLabel.addEventListener("mousedown", () => { + showActivity(); + updateActivity(); +}) + function renderAppointment() { // Upate the appointment element let event = appointment.next(); @@ -150,3 +155,5 @@ function renderBattery() { batteryImage.image = `battery-${Math.floor(battery.chargeLevel / 10) * 10}.png`; } } + +renderBattery(); diff --git a/resources/index.gui b/resources/index.gui index a59860b..0ebc4ae 100644 --- a/resources/index.gui +++ b/resources/index.gui @@ -2,7 +2,7 @@ -