mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-09 08:38:03 -06:00
Add scouting dashboard details
This commit is contained in:
@@ -108,12 +108,11 @@ public class EventFragment extends Fragment {
|
||||
if(rescout[0]) {
|
||||
text.setBackgroundColor(color_rescout);
|
||||
DataManager.rescout_list.add(filename);
|
||||
DataManager.save_rescout_list();
|
||||
}else{
|
||||
text.setBackgroundColor(color_found);
|
||||
DataManager.rescout_list.remove(filename);
|
||||
DataManager.save_rescout_list();
|
||||
}
|
||||
DataManager.save_rescout_list();
|
||||
return true;
|
||||
});
|
||||
}else{
|
||||
@@ -179,12 +178,11 @@ public class EventFragment extends Fragment {
|
||||
if(rescout[0]) {
|
||||
text.setBackgroundColor(color_rescout);
|
||||
DataManager.rescout_list.add(filename);
|
||||
DataManager.save_rescout_list();
|
||||
}else{
|
||||
text.setBackgroundColor(color_found);
|
||||
DataManager.rescout_list.remove(filename);
|
||||
DataManager.save_rescout_list();
|
||||
}
|
||||
DataManager.save_rescout_list();
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ridgebotics.ridgescout.ui.scouting;
|
||||
import static android.widget.LinearLayout.VERTICAL;
|
||||
import static androidx.navigation.fragment.FragmentKt.findNavController;
|
||||
|
||||
import static com.ridgebotics.ridgescout.utility.DataManager.evcode;
|
||||
import static com.ridgebotics.ridgescout.utility.DataManager.event;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
@@ -27,6 +28,7 @@ import com.ridgebotics.ridgescout.databinding.FragmentScoutingBinding;
|
||||
import com.ridgebotics.ridgescout.utility.DataManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
|
||||
public class ScoutingFragment extends Fragment {
|
||||
|
||||
@@ -82,6 +84,12 @@ public class ScoutingFragment extends Fragment {
|
||||
|
||||
if(event == null){
|
||||
binding.noEventError.setVisibility(View.VISIBLE);
|
||||
|
||||
binding.textMatchAlliance.setVisibility(View.GONE);
|
||||
binding.textName.setVisibility(View.GONE);
|
||||
binding.textNextMatch.setVisibility(View.GONE);
|
||||
binding.textRescoutIndicator.setVisibility(View.GONE);
|
||||
|
||||
binding.matchScoutingButton.setEnabled(false);
|
||||
binding.pitScoutingButton.setEnabled(false);
|
||||
binding.eventButton.setEnabled(false);
|
||||
@@ -113,6 +121,21 @@ public class ScoutingFragment extends Fragment {
|
||||
findNavController(this).navigate(R.id.action_navigation_scouting_to_navigation_scouting_event);
|
||||
});
|
||||
|
||||
|
||||
binding.textName.setText("Welcome, " + SettingsManager.getUsername() + "!");
|
||||
|
||||
int nextMatch = -1;
|
||||
int teamNum = SettingsManager.getTeamNum();
|
||||
for(int i = SettingsManager.getMatchNum(); i < event.matches.size(); i++){ // Loop through matches and find next match
|
||||
boolean foundMatch = false;
|
||||
for(int a = 0; a < 3; a++) if(event.matches.get(i).blueAlliance[a] == teamNum){nextMatch = i+1; foundMatch = true;}
|
||||
for(int a = 0; a < 3; a++) if(event.matches.get(i).redAlliance[a] == teamNum){nextMatch = i+1; foundMatch = true;}
|
||||
if(foundMatch) break;
|
||||
}
|
||||
binding.textNextMatch.setText("Our next match: Match " + nextMatch);
|
||||
binding.textMatchAlliance.setText("Match: " + (SettingsManager.getMatchNum()+1) + ", " + SettingsManager.getAllyPos());
|
||||
binding.textRescoutIndicator.setText("Things to rescout: " + DataManager.rescout_list.size());
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ public final class FileEditor {
|
||||
}
|
||||
|
||||
public static boolean deleteFile(String filepath){
|
||||
if(fileExist(filepath)){
|
||||
if(!fileExist(filepath)){
|
||||
return true;
|
||||
}
|
||||
File file = new File(baseDir + filepath);
|
||||
|
||||
Reference in New Issue
Block a user