mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-08 16:28:00 -06:00
Change dashboard if there are no matches
This commit is contained in:
@@ -157,28 +157,33 @@ public class ScoutingFragment extends Fragment {
|
|||||||
private void updateDashboard() {
|
private void updateDashboard() {
|
||||||
binding.textName.setText("Welcome, " + SettingsManager.getUsername() + "!");
|
binding.textName.setText("Welcome, " + SettingsManager.getUsername() + "!");
|
||||||
|
|
||||||
int curMatchNum = SettingsManager.getMatchNum();
|
|
||||||
int nextMatch;
|
|
||||||
int teamNum = SettingsManager.getTeamNum();
|
|
||||||
try {
|
|
||||||
nextMatch = event.getNextTeamMatch(teamNum, curMatchNum).matchIndex;
|
|
||||||
} catch (Exception e){
|
|
||||||
AlertManager.error("Sorry, in event ("+evcode+"), your team number ("+teamNum+") wasn't found!", e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.textMatchAlliance.setText("Match: " + (curMatchNum+1) + ", " + SettingsManager.getAllyPos());
|
|
||||||
binding.textRescoutIndicator.setText("Things to rescout: " + DataManager.rescout_list.size());
|
binding.textRescoutIndicator.setText("Things to rescout: " + DataManager.rescout_list.size());
|
||||||
|
|
||||||
binding.infoBox.addView(new TextViewBuilder(getContext(), "Our next match: Match " + nextMatch)
|
if(event.matches.size() == 0) {
|
||||||
.body1()
|
binding.textMatchAlliance.setText("No Matches!");
|
||||||
.build());
|
} else {
|
||||||
|
int teamNum = SettingsManager.getTeamNum();
|
||||||
|
int curMatchNum = SettingsManager.getMatchNum();
|
||||||
|
int nextMatch;
|
||||||
|
try {
|
||||||
|
nextMatch = event.getNextTeamMatch(teamNum, curMatchNum).matchIndex;
|
||||||
|
} catch (Exception e){
|
||||||
|
AlertManager.error("Sorry, in event ("+evcode+"), your team number ("+teamNum+") wasn't found!", e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int informedBy = event.getMostInformedBy(teamNum, curMatchNum);
|
binding.textMatchAlliance.setText("Match: " + (curMatchNum+1) + ", " + SettingsManager.getAllyPos());
|
||||||
|
|
||||||
|
binding.infoBox.addView(new TextViewBuilder(getContext(), "Our next match: Match " + nextMatch)
|
||||||
|
.body1()
|
||||||
|
.build());
|
||||||
|
|
||||||
|
int informedBy = event.getMostInformedBy(teamNum, curMatchNum);
|
||||||
|
|
||||||
|
|
||||||
binding.infoBox.addView(new TextViewBuilder(getContext(), "Most informed by: Match " + informedBy)
|
binding.infoBox.addView(new TextViewBuilder(getContext(), "Most informed by: Match " + informedBy)
|
||||||
.body1()
|
.body1()
|
||||||
.build());
|
.build());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user