Fix: timer text color revised

This commit is contained in:
2018-12-10 23:20:16 +09:00
parent 09b1fb100b
commit ac3936aad9
+18 -11
View File
@@ -52,8 +52,8 @@ Timer.prototype.loadDataFromServer = function() {
// this.isTimerGoingOn = false; // this.isTimerGoingOn = false;
// this.setTimerTextColor(0xffffff); // this.setTimerTextColor(0xffffff);
// } // }
// else
this.setTimerTextColor(0x40c0c0); this.setTimerTextColor(Timer.TEXT_COLOR_CYAN);
} }
Timer.prototype.makeTimer = function() { Timer.prototype.makeTimer = function() {
@@ -251,7 +251,10 @@ Timer.prototype.setTimerTextColor = function(color) {
Timer.prototype.startTimer = function() { Timer.prototype.startTimer = function() {
this.isTimerGoingOn = true; this.isTimerGoingOn = true;
this.setTimerTextColor(0xc0c040); if(this.timeLeft < 0)
this.setTimerTextColor(Timer.TEXT_COLOR_RED);
else
this.setTimerTextColor(Timer.TEXT_COLOR_YELLOW);
this.updateTimeText(); this.updateTimeText();
ShowNotifyTimeOver(this.timeLeft * Timer.TIME_MILLISECONDS); ShowNotifyTimeOver(this.timeLeft * Timer.TIME_MILLISECONDS);
@@ -265,9 +268,9 @@ Timer.prototype.startTimer = function() {
} }
Timer.prototype.pauseTimer = function() { Timer.prototype.pauseTimer = function() {
this.isTimeOver = false; // this.isTimeOver = false;
this.setTimerTextColor(0xa0a0a0); this.setTimerTextColor(Timer.TEXT_COLOR_GREY);
this.updateTimeText(); this.updateTimeText();
CancelNotifyTimeOver(); CancelNotifyTimeOver();
@@ -280,11 +283,13 @@ Timer.prototype.pauseTimer = function() {
} }
Timer.prototype.resetTimer = function() { Timer.prototype.resetTimer = function() {
this.isTimeOver = false;
this.timeLeft = this.timeStart; this.timeLeft = this.timeStart;
this.pauseTimer(); this.pauseTimer();
this.isTimerGoingOn = false; this.isTimerGoingOn = false;
this.setTimerTextColor(0x40c0c0); this.setTimerTextColor(Timer.TEXT_COLOR_CYAN);
// this.loadDataFromServer(); // this.loadDataFromServer();
} }
@@ -311,7 +316,7 @@ Timer.prototype.tickTimeLeft = function() {
Timer.prototype.timeOver = function() { Timer.prototype.timeOver = function() {
this.isTimeOver = true; this.isTimeOver = true;
this.setTimerTextColor(0xc04040); this.setTimerTextColor(Timer.TEXT_COLOR_RED);
console.log("time over"); console.log("time over");
@@ -425,8 +430,6 @@ Timer.prototype.makeTimeButton = function(setting, buttonText, eventHandler) {
} }
Timer.prototype.timePlus = function(timePlusSecond, type) { Timer.prototype.timePlus = function(timePlusSecond, type) {
console.log(timePlusSecond + type);
var timeAmount = 0; var timeAmount = 0;
switch(type) { switch(type) {
case Timer.TYPE_HOUR: case Timer.TYPE_HOUR:
@@ -451,8 +454,6 @@ Timer.prototype.timePlus = function(timePlusSecond, type) {
} }
Timer.prototype.timeMinus = function(timeMinusSecond, type) { Timer.prototype.timeMinus = function(timeMinusSecond, type) {
console.log(timeMinusSecond + type);
var timeAmount = 0; var timeAmount = 0;
switch(type) { switch(type) {
case Timer.TYPE_HOUR: case Timer.TYPE_HOUR:
@@ -560,3 +561,9 @@ Timer.TIME_DEFAULT_SEC
Timer.TYPE_HOUR = "hour"; Timer.TYPE_HOUR = "hour";
Timer.TYPE_MINUTE = "minute"; Timer.TYPE_MINUTE = "minute";
Timer.TYPE_SECOND = "second"; Timer.TYPE_SECOND = "second";
Timer.TEXT_COLOR_CYAN = 0x40c0c0;
Timer.TEXT_COLOR_YELLOW = 0xe0e040;
Timer.TEXT_COLOR_GREY = 0xa0a0a0;
Timer.TEXT_COLOR_RED = 0xc04040;