import android.app.Activity;
import android.content.SharedPreferences;
import android.content.res.Resources;
-import android.graphics.Color;
+import android.graphics.Typeface;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
ch_jb.setBase((now.roundEnd + 1) * 1000 - tbcf);
ch_jb.setCountDown(true);
} else {
+ ch_jb.setTypeface(null, Typeface.ITALIC);
ch_jb.setBase(now.roundStart * 1000 - tbcf);
- ch_jb.setBackgroundColor(Color.BLACK);
- ch_jb.setTextColor(Color.WHITE);
}
ch_jb.setOnChronometerTickListener(new Chronometer.OnChronometerTickListener() {
@Override
package com.acmetensortoys.ctfwstimer.utils;
import android.content.res.Resources;
+import android.graphics.Typeface;
import android.os.Build;
import android.os.SystemClock;
import android.widget.Chronometer;
mCh.setText(rid);
return;
}
-
- if (now.round == 0) {
- mCh.setFormat(mRes.getString(R.string.ctfws_chrono_gamestart));
- } else if (now.round == gs.getRounds()) {
- mCh.setFormat(mRes.getString(R.string.ctfws_chrono_gameend));
- } else {
- mCh.setFormat(String.format(mRes.getString(R.string.ctfws_chrono_jailbreak),
- now.round));
- }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
mCh.setCountDown(true);
+ if (now.round == 0) {
+ mCh.setFormat(mRes.getString(R.string.ctfws_chrono_startin));
+ } else if (now.round == gs.getRounds()) {
+ mCh.setFormat(mRes.getString(R.string.ctfws_chrono_gameend));
+ } else {
+ mCh.setFormat(String.format(mRes.getString(R.string.ctfws_chrono_jailbreakin),
+ now.round));
+ }
+ mCh.setBase(now.roundEnd * 1000 - tbcf);
+ } else {
+ mCh.setTypeface(null, Typeface.ITALIC);
+ if (now.round == 0) {
+ mCh.setFormat(mRes.getString(R.string.ctfws_chrono_setup));
+ mCh.setBase(now.roundStart * 1000 - tbcf);
+ } else {
+ mCh.setFormat(mRes.getString(R.string.ctfws_chrono_elapsed));
+ mCh.setBase(gs.getFirstRoundStartT() * 1000 - tbcf);
+ }
}
- mCh.setBase(now.roundEnd * 1000 - tbcf);
mCh.start();
});
}
<string name="ctfws_gamestart">Game\nStart</string>
<string name="ctfws_jailbreak">Jailbreak\n%1$d of %2$d</string>
- <string name="ctfws_chrono_future">Pending</string>
- <string name="ctfws_chrono_gameend">Ending\n%s</string>
- <string name="ctfws_chrono_gamestart">Setup\n%s</string>
- <string name="ctfws_chrono_jailbreak">JB %1$d:\n%%s</string>
<string name="ctfws_chrono_menutext">Game Timer</string>
+ <!-- No timer; setup start in future -->
+ <string name="ctfws_chrono_future">Pending</string>
+ <!-- No timer; game not configured -->
<string name="ctfws_chrono_nogame">No Game</string>
+ <!-- No timer; game end in past -->
<string name="ctfws_chrono_over">Over!</string>
+ <!-- Counting up, on older Androids: setup in past, start in future -->
+ <string name="ctfws_chrono_setup">Setup\n%s</string>
+ <!-- Counting up, on older Androids: start in past, end in future; JBs not delineated -->
+ <string name="ctfws_chrono_elapsed">Game\n%s</string>
+ <!-- Counting down: start in future -->
+ <string name="ctfws_chrono_startin">Go in\n%s</string>
+ <!-- Counting down: start in past, ultimate jailbreak in future -->
+ <string name="ctfws_chrono_jailbreakin">JB %1$d in\n%%s</string>
+ <!-- Counting down: No more jailbreaks -->
+ <string name="ctfws_chrono_gameend">End in\n%s</string>
+
<string name="ctfws_sides_wd">
<![CDATA[<b><font color=#a94442>Red</font></b> is defending Wean; <b><font color=#8a6d3b>Yellow</font></b> is defending Doherty.]]>