mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-09 00:37:59 -06:00
Fix TBA Event coloring
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user