]> hydra-www.ietfng.org Git - acmetensortoys-ctfws-android/commitdiff
Overhaul tinychrono strings
authorNathaniel Wesley Filardo <nwfilardo@gmail.com>
Tue, 1 Mar 2022 00:50:43 +0000 (00:50 +0000)
committerNathaniel Wesley Filardo <nwfilardo@gmail.com>
Sat, 5 Mar 2022 17:08:57 +0000 (17:08 +0000)
Choose short strings that still describe counting-up (old Android) or
counting down (new Android) and set the counting-up case to italic.  Do
the same, while here, for the main display.

mobile/src/main/java/com/acmetensortoys/ctfwstimer/activity/main/CtFwSDisplay.java
mobile/src/main/java/com/acmetensortoys/ctfwstimer/utils/CtFwSDisplayTinyChrono.java
mobile/src/main/res/values/strings.xml

index 567876fa6a40c10794ad28054059add9a25887ae..224adc42b3a837f7927e75c1a52abea921d1e505 100644 (file)
@@ -3,7 +3,7 @@ package com.acmetensortoys.ctfwstimer.activity.main;
 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;
@@ -217,9 +217,8 @@ public class CtFwSDisplay implements CtFwSGameStateManager.Observer {
                     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
index a2b04e9372e933a41a96a075c64c057ef27de597..72bd4e801e91a7dc21d1531312ad7020feee7166 100644 (file)
@@ -1,6 +1,7 @@
 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;
@@ -56,19 +57,27 @@ public class CtFwSDisplayTinyChrono implements CtFwSGameStateManager.Observer {
                 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();
         });
     }
index 25bb612644a18efcbc013737ead9a78a342b2eab..896fe11c21688a957ecd14a01f7f23cc24d9c40f 100644 (file)
@@ -9,13 +9,24 @@
     <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.]]>