Fix TBA Event coloring

This commit is contained in:
Michael Mikovsky
2025-10-08 20:23:11 -06:00
parent c18a93cb1a
commit 73308f2acc
3 changed files with 9 additions and 7 deletions
@@ -164,6 +164,9 @@ public class ScoutingFragment extends Fragment {
} else { } else {
int teamNum = SettingsManager.getTeamNum(); int teamNum = SettingsManager.getTeamNum();
int curMatchNum = SettingsManager.getMatchNum(); int curMatchNum = SettingsManager.getMatchNum();
binding.textMatchAlliance.setText("Match: " + (curMatchNum+1) + ", " + SettingsManager.getAllyPos());
int nextMatch; int nextMatch;
try { try {
nextMatch = event.getNextTeamMatch(teamNum, curMatchNum).matchIndex; nextMatch = event.getNextTeamMatch(teamNum, curMatchNum).matchIndex;
@@ -172,7 +175,6 @@ public class ScoutingFragment extends Fragment {
return; return;
} }
binding.textMatchAlliance.setText("Match: " + (curMatchNum+1) + ", " + SettingsManager.getAllyPos());
binding.infoBox.addView(new TextViewBuilder(getContext(), "Our next match: Match " + nextMatch) binding.infoBox.addView(new TextViewBuilder(getContext(), "Our next match: Match " + nextMatch)
.body1() .body1()
@@ -165,12 +165,12 @@ public class TBASelectorFragment extends Fragment {
try { try {
Date startDate = format.parse(j.getString("start_date")); Date startDate = format.parse(j.getString("start_date"));
Date endDate = format.parse(j.getString("end_date")); Date endDate = format.parse(j.getString("end_date"));
if(currentTime.after(endDate)){ if(currentTime.after(startDate) && currentTime.before(endDate)) {
row.setColor(tba_current);
} else if(currentTime.after(endDate)){
row.setColor(tba_previous); row.setColor(tba_previous);
}else if(currentTime.before(startDate)){ }else if(currentTime.before(startDate)){
row.setColor(tba_next); row.setColor(tba_next);
}else if(currentTime.after(startDate) && currentTime.before(endDate)){
row.setColor(tba_current);
} }
} catch (Exception e) { } catch (Exception e) {
AlertManager.error("Failed finding start and end dates!", e); AlertManager.error("Failed finding start and end dates!", e);
@@ -67,9 +67,9 @@ public class Colors {
public static final int fileselector_unselected_color = 0x50006600; public static final int fileselector_unselected_color = 0x50006600;
// TBA // TBA
public static final int tba_previous = 0x30FF0000; public static final int tba_previous = Color.argb(30, 64,64,64);
public static final int tba_current = 0x50ff0000; public static final int tba_current = 0x7f00ff00;
public static final int tba_next = 0x30FFFF00; public static final int tba_next = Color.argb(30, 192,192,192);
public static final int tba_red = 0x50ff0000; public static final int tba_red = 0x50ff0000;
public static final int tba_blue = 0x500000ff; public static final int tba_blue = 0x500000ff;
public static final int tba_toggle_background = 0x30000000; public static final int tba_toggle_background = 0x30000000;