Work on converting everything to fragments

This commit is contained in:
astatin3
2024-07-26 23:48:12 -06:00
parent 0238631557
commit b5562a4cf9
17 changed files with 1215 additions and 758 deletions
+1
View File
@@ -21,6 +21,7 @@ Ridgebotics 2025 scouting app in Android
#### Data Analysis:
- Make a word cloud for the compiled mode of text input type
#### Functionality:
- Make everything use Fragments instead of views that toggle visibility
- Make pit and match data field builder UIs. I don't want to have to keep editing a variable
@@ -55,6 +55,7 @@ public class MainActivity extends AppCompatActivity {
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
R.id.navigation_scouting, R.id.navigation_transfer, R.id.navigation_settings)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_activity_main);
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
NavigationUI.setupWithNavController(binding.navView, navController);
@@ -0,0 +1,122 @@
package com.astatin3.scoutingapp2025.ui;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.astatin3.scoutingapp2025.SettingsVersionStack.latestSettings;
import com.astatin3.scoutingapp2025.databinding.FragmentMatchScoutDataEnterBinding;
import com.astatin3.scoutingapp2025.databinding.FragmentTeamSelectorBinding;
import com.astatin3.scoutingapp2025.types.frcEvent;
import com.astatin3.scoutingapp2025.types.frcTeam;
import com.astatin3.scoutingapp2025.utility.AlertManager;
import com.astatin3.scoutingapp2025.utility.fileEditor;
import java.util.Arrays;
public class TeamSelectorFragment extends Fragment {
private FragmentTeamSelectorBinding binding;
private String evcode;
private frcEvent event;
private static onTeamSelected onSelect = new onTeamSelected() {@Override public void onSelect(TeamSelectorFragment self, frcTeam team) {}};
public interface onTeamSelected {
void onSelect(TeamSelectorFragment self, frcTeam team);
}
public static void setOnSelect(onTeamSelected tmponSelect){
onSelect = tmponSelect;
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
binding = FragmentTeamSelectorBinding.inflate(inflater, container, false);
// event = fileEditor.g
evcode = latestSettings.settings.get_evcode();
if(evcode == null || evcode.equals("unset")){
AlertManager.error("You somehow have not loaded an event!");
return binding.getRoot();
}
load_teams();
return binding.getRoot();
}
public void load_teams(){
// binding.pitFileIndicator.setVisibility(View.GONE);
// binding.pitTeamName.setVisibility(View.GONE);
// binding.pitTeamDescription.setVisibility(View.GONE);
//
// clear_fields();
int[] teamNums = new int[event.teams.size()];
for(int i = 0 ; i < event.teams.size(); i++){
teamNums[i] = event.teams.get(i).teamNumber;
}
Arrays.sort(teamNums);
TableLayout table = new TableLayout(getContext());
table.setStretchAllColumns(true);
binding.teams.addView(table);
for(int i = 0; i < event.teams.size(); i++){
frcTeam team = null;
for(int a = 0 ; a < event.teams.size(); a++){
if(event.teams.get(a).teamNumber == teamNums[i]){
team = event.teams.get(a);
break;
}
}
TableRow tr = new TableRow(getContext());
TableLayout.LayoutParams rowParams = new TableLayout.LayoutParams(
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT
);
rowParams.setMargins(20,20,20,20);
tr.setLayoutParams(rowParams);
tr.setPadding(20,20,20,20);
table.addView(tr);
if(fileEditor.fileExist(evcode + "-" + team.teamNumber + ".pitscoutdata")){
tr.setBackgroundColor(0x3000FF00);
}else{
tr.setBackgroundColor(0x30FF0000);
}
TextView tv = new TextView(getContext());
tv.setText(String.valueOf(team.teamNumber));
tv.setTextSize(20);
tr.addView(tv);
tv = new TextView(getContext());
tv.setText(team.teamName);
tv.setTextSize(16);
tr.addView(tv);
frcTeam finalTeam = team;
tr.setOnClickListener(v -> {
onSelect.onSelect(this, finalTeam);
});
}
}
}
@@ -2,7 +2,7 @@ package com.astatin3.scoutingapp2025.ui.data;
import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TableLayout;
import android.widget.TableRow;
@@ -10,13 +10,11 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.astatin3.scoutingapp2025.databinding.FragmentDataBinding;
import com.astatin3.scoutingapp2025.scoutingData.fields;
import com.astatin3.scoutingapp2025.types.input.inputType;
import java.util.ArrayList;
import java.util.List;
public class fieldsView extends ConstraintLayout {
@@ -78,10 +76,9 @@ public class fieldsView extends ConstraintLayout {
rowParams.setMargins(20,20,20,20);
tr.setLayoutParams(rowParams);
tr.setPadding(20,20,20,20);
tr.setBackgroundColor(background_color);
TextView tv = new TextView(getContext());
tv.setText("v" + i + "\n eee");
tv.setText("v" + i);
tv.setTextSize(20);
tr.addView(tv);
@@ -92,10 +89,15 @@ public class fieldsView extends ConstraintLayout {
binding.fieldsArea.addView(tr);
int fi = i;
tr.setOnClickListener(v -> {
display_fields(values[fi]);
});
if(i == values.length-1) {
tr.setBackgroundColor(background_color);
int fi = i;
tr.setOnClickListener(v -> {
display_fields(values[fi]);
});
}else{
tr.setBackgroundColor(unfocused_background_color);
}
}
}
@@ -129,21 +131,32 @@ public class fieldsView extends ConstraintLayout {
tv.setText(version_values[i].name);
tv.setTextSize(20);
tr.addView(tv);
binding.fieldsArea.addView(tr);
tr.setOnClickListener(v -> {
trHighlight(tr);
binding.fieldsArea.addView(tr);
tr.setOnClickListener(v -> {
trOnClick(version_values, tr);
});
}
}
private void trHighlight(TableRow self){
for(int i = 0; i < binding.teamsArea.getChildCount(); i++){
TableRow child = (TableRow) binding.teamsArea.getChildAt(i);
child.setBackgroundColor(unfocused_background_color);
private void trOnClick(inputType[] version_values, TableRow tr){
int index = -1;
for(int i = 0; i < binding.fieldsArea.getChildCount(); i++){
View v = binding.fieldsArea.getChildAt(i);
if(v.equals(tr)) {
tr.setBackgroundColor(background_color);
index = i;
} else
binding.fieldsArea.getChildAt(i).setBackgroundColor(unfocused_background_color);
}
self.setBackgroundColor(background_color);
onFieldSelect(version_values[binding.fieldsArea.getReorderedIndexes().get(index)]);
}
private void onFieldSelect(inputType field){
System.out.println(field.name);
}
}
@@ -0,0 +1,341 @@
package com.astatin3.scoutingapp2025.ui.scouting;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.astatin3.scoutingapp2025.SettingsVersionStack.latestSettings;
import com.astatin3.scoutingapp2025.databinding.FragmentMatchScoutDataEnterBinding;
import com.astatin3.scoutingapp2025.scoutingData.ScoutingDataWriter;
import com.astatin3.scoutingapp2025.scoutingData.fields;
import com.astatin3.scoutingapp2025.scoutingData.transfer.transferType;
import com.astatin3.scoutingapp2025.types.data.dataType;
import com.astatin3.scoutingapp2025.types.frcEvent;
import com.astatin3.scoutingapp2025.types.frcMatch;
import com.astatin3.scoutingapp2025.types.frcTeam;
import com.astatin3.scoutingapp2025.types.input.inputType;
import com.astatin3.scoutingapp2025.utility.AutoSaveManager;
import com.astatin3.scoutingapp2025.utility.fileEditor;
import java.util.ArrayList;
import java.util.function.Function;
public class matchScoutDataEnterFragment extends Fragment {
private FragmentMatchScoutDataEnterBinding binding;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
binding = FragmentMatchScoutDataEnterBinding.inflate(inflater, container, false);
alliance_position = latestSettings.settings.get_alliance_pos();
evcode = event.eventCode;
username = latestSettings.settings.get_username();
binding.eventcode.setText(evcode);
binding.alliancePosText.setText(alliance_position);
binding.teamDescription.setVisibility(View.GONE);
binding.teamName.setVisibility(View.GONE);
clear_fields();
binding.teamDescription.setVisibility(View.VISIBLE);
binding.teamName.setVisibility(View.VISIBLE);
if(values == null || values.length == 0){
TextView tv = new TextView(getContext());
tv.setText("Failed to load fields.\nTry to either download or create match scouting fields.");
tv.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
binding.MatchScoutArea.addView(tv);
return binding.getRoot();
}
values = fields.load(fields.matchFieldsFilename);
if(values == null){
return binding.getRoot();
}
latest_values = values[values.length-1];
transferValues = transferType.get_transfer_values(values);
cur_match_num = latestSettings.settings.get_match_num();
update_match_num();
binding.nextButton.setOnClickListener(v -> {
if(edited) save();
latestSettings.settings.set_match_num(cur_match_num+1);
cur_match_num += 1;
update_match_num();
update_scouting_data();
});
binding.backButton.setOnClickListener(v -> {
if(edited) save();
latestSettings.settings.set_match_num(cur_match_num-1);
cur_match_num -= 1;
update_match_num();
update_scouting_data();
});
// binding.middleButton.setOnClickListener(v -> {
// if(edited) save();
// });
create_fields();
update_scouting_data();
return binding.getRoot();
}
private static final int unsaved_color = 0x60ff0000;
private static final int saved_color = 0x6000ff00;
String alliance_position;
String evcode;
int cur_match_num;
frcEvent event;
String username;
String filename;
boolean edited = false;
TextView[] titles;
inputType[][] values;
inputType[] latest_values;
transferType[][] transferValues;
AutoSaveManager asm = new AutoSaveManager(this::save);
ArrayList<dataType> dataTypes;
public void save(){
System.out.println("Saved!");
edited = false;
set_indicator_color(saved_color);
// fileEditor.createFile(filename);
save_fields();
}
public void set_indicator_color(int color){
binding.fileIndicator.setBackgroundColor(color);
}
public void update_asm(){
// v.getBackground().setColorFilter(Color.parseColor("#00ff00"), PorterDuff.Mode.DARKEN);
edited = true;
set_indicator_color(unsaved_color);
asm.update();
}
public void clear_fields(){
int childCount = binding.MatchScoutArea.getChildCount();
View[] views = new View[childCount];
for(int i = 0; i < childCount; i++){
views[i] = binding.MatchScoutArea.getChildAt(i);
}
for(int i = 0; i < childCount; i++){
if(!views[i].isShown()) continue;
binding.MatchScoutArea.removeView(views[i]);
}
}
private int default_text_color = 0;
private void create_fields(){
if(asm.isRunning){
asm.stop();
}
titles = new TextView[latest_values.length];
for(int i = 0 ; i < latest_values.length; i++) {
final TextView tv = new TextView(getContext());
tv.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
tv.setText(latest_values[i].name);
tv.setPadding(8,8,8,8);
tv.setTextSize(24);
titles[i] = tv;
default_text_color = tv.getCurrentTextColor();
final View v = latest_values[i].createView(getContext(), new Function<dataType, Integer>() {
@Override
public Integer apply(dataType dataType) {
// edited = true;
if(asm.isRunning)
update_asm();
return 0;
}
});
binding.MatchScoutArea.addView(tv);
int fi = i;
tv.setOnClickListener(p -> {
// boolean blank = !latest_values[fi].getViewValue().isNull();
// System.out.println(blank);
asm.update();
if(!latest_values[fi].isBlank){
tv.setBackgroundColor(0xffff0000);
tv.setTextColor(0xff000000);
latest_values[fi].nullify();
}else{
tv.setBackgroundColor(0x00000000);
tv.setTextColor(default_text_color);
latest_values[fi].setViewValue(latest_values[fi].default_value);
}
});
binding.MatchScoutArea.addView(v);
}
}
private void update_match_num(){
// cur_match_num = latestSettings.settings.get_match_num();
edited = false;
binding.matchnum.setText(String.valueOf(cur_match_num+1));
if(cur_match_num <= 0){
binding.backButton.setVisibility(View.GONE);
}else{
binding.backButton.setVisibility(View.VISIBLE);
}
if(cur_match_num >= event.matches.size()-1){
binding.nextButton.setVisibility(View.GONE);
}else{
binding.nextButton.setVisibility(View.VISIBLE);
}
}
private frcTeam get_team(frcMatch match){
// Get team number
String[] split = alliance_position.split("-");
Integer team_num = null;
switch (split[0]){
case "red":
team_num = match.redAlliance[Integer.parseInt(split[1])-1];
break;
case "blue":
team_num = match.blueAlliance[Integer.parseInt(split[1])-1];
break;
}
binding.barTeamNum.setText(String.valueOf(team_num));
frcTeam team = null;
for(int i=0; i < event.teams.size(); i++){
frcTeam tmpteam = event.teams.get(i);
if(tmpteam.teamNumber == team_num){
team = tmpteam;
break;
}
}
filename = evcode + "-" + (cur_match_num+1) + "-" + alliance_position + "-" + team_num + ".matchscoutdata";
return team;
}
public void update_scouting_data(){
frcMatch match = event.matches.get(cur_match_num);
frcTeam team = get_team(match);
binding.teamName.setText(team.teamName);
binding.teamDescription.setText(team.getDescription());
boolean new_file = !fileEditor.fileExist(filename);
if(asm.isRunning){
asm.stop();
}
if(new_file){
default_fields();
set_indicator_color(unsaved_color);
}else{
get_fields();
set_indicator_color(saved_color);
}
asm.start();
}
public void default_fields(){
for(int i = 0; i < latest_values.length; i++){
inputType input = latest_values[i];
input.setViewValue(input.default_value);
titles[i].setBackgroundColor(0x00000000);
titles[i].setTextColor(default_text_color);
}
}
public void get_fields(){
ScoutingDataWriter.ParsedScoutingDataResult psdr = ScoutingDataWriter.load(filename, values, transferValues);
dataType[] types = psdr.data.array;
for(int i = 0; i < latest_values.length; i++){
// types[i] = latest_values[i].getViewValue();
latest_values[i].setViewValue(types[i]);
if(latest_values[i].isBlank){
titles[i].setBackgroundColor(0xffff0000);
titles[i].setTextColor(0xff000000);
}else{
titles[i].setBackgroundColor(0x00000000);
titles[i].setTextColor(default_text_color);
}
}
}
public void save_fields(){
dataType[] types = new dataType[latest_values.length];
for(int i = 0; i < latest_values.length; i++){
types[i] = latest_values[i].getViewValue();
}
if(ScoutingDataWriter.save(values.length-1, username, filename, types))
System.out.println("Saved!");
else
System.out.println("Error saving");
}
}
@@ -26,316 +26,318 @@ import com.astatin3.scoutingapp2025.utility.AutoSaveManager;
import java.util.ArrayList;
import java.util.function.Function;
public class matchScoutingView extends ConstraintLayout {
public matchScoutingView(Context context) {
super(context);
}
public matchScoutingView(Context context, AttributeSet attributeSet){
super(context, attributeSet);
}
public class matchScoutingView {}
private static final int unsaved_color = 0x60ff0000;
private static final int saved_color = 0x6000ff00;
FragmentScoutingBinding binding;
String alliance_position;
String evcode;
int cur_match_num;
frcEvent event;
String filename;
String username;
boolean edited = false;
TextView[] titles;
inputType[][] values;
inputType[] latest_values;
transferType[][] transferValues;
AutoSaveManager asm = new AutoSaveManager(this::save);
ArrayList<dataType> dataTypes;
public void save(){
System.out.println("Saved!");
edited = false;
set_indicator_color(saved_color);
// fileEditor.createFile(filename);
save_fields();
}
public void set_indicator_color(int color){
binding.fileIndicator.setBackgroundColor(color);
}
public void update_asm(){
// v.getBackground().setColorFilter(Color.parseColor("#00ff00"), PorterDuff.Mode.DARKEN);
edited = true;
set_indicator_color(unsaved_color);
asm.update();
}
public void clear_fields(){
int childCount = binding.MatchScoutArea.getChildCount();
View[] views = new View[childCount];
for(int i = 0; i < childCount; i++){
views[i] = binding.MatchScoutArea.getChildAt(i);
}
for(int i = 0; i < childCount; i++){
if(!views[i].isShown()) continue;
binding.MatchScoutArea.removeView(views[i]);
}
}
public void init(FragmentScoutingBinding tmp_binding, frcEvent event){
binding = tmp_binding;
alliance_position = latestSettings.settings.get_alliance_pos();
evcode = event.eventCode;
this.event = event;
username = latestSettings.settings.get_username();
binding.eventcode.setText(evcode);
binding.alliancePosText.setText(alliance_position);
binding.teamDescription.setVisibility(View.GONE);
binding.teamName.setVisibility(View.GONE);
clear_fields();
binding.teamDescription.setVisibility(View.VISIBLE);
binding.teamName.setVisibility(View.VISIBLE);
values = fields.load(fields.matchFieldsFilename);
if(values == null || values.length == 0){
TextView tv = new TextView(getContext());
tv.setText("Failed to load fields.\nTry to either download or create match scouting fields.");
tv.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
binding.MatchScoutArea.addView(tv);
return;
}
cur_match_num = latestSettings.settings.get_match_num();
update_match_num();
binding.nextButton.setOnClickListener(v -> {
if(edited) save();
latestSettings.settings.set_match_num(cur_match_num+1);
cur_match_num += 1;
update_match_num();
update_scouting_data();
});
binding.backButton.setOnClickListener(v -> {
if(edited) save();
latestSettings.settings.set_match_num(cur_match_num-1);
cur_match_num -= 1;
update_match_num();
update_scouting_data();
});
// binding.middleButton.setOnClickListener(v -> {
// if(edited) save();
// });
latest_values = values[values.length-1];
transferValues = transferType.get_transfer_values(values);
create_fields();
update_scouting_data();
}
private int default_text_color = 0;
private void create_fields(){
if(asm.isRunning){
asm.stop();
}
titles = new TextView[latest_values.length];
for(int i = 0 ; i < latest_values.length; i++) {
final TextView tv = new TextView(getContext());
tv.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
tv.setText(latest_values[i].name);
tv.setPadding(8,8,8,8);
tv.setTextSize(24);
titles[i] = tv;
default_text_color = tv.getCurrentTextColor();
final View v = latest_values[i].createView(getContext(), new Function<dataType, Integer>() {
@Override
public Integer apply(dataType dataType) {
// edited = true;
if(asm.isRunning)
update_asm();
return 0;
}
});
binding.MatchScoutArea.addView(tv);
int fi = i;
tv.setOnClickListener(p -> {
// boolean blank = !latest_values[fi].getViewValue().isNull();
// System.out.println(blank);
asm.update();
if(!latest_values[fi].isBlank){
tv.setBackgroundColor(0xffff0000);
tv.setTextColor(0xff000000);
latest_values[fi].nullify();
}else{
tv.setBackgroundColor(0x00000000);
tv.setTextColor(default_text_color);
latest_values[fi].setViewValue(latest_values[fi].default_value);
}
});
binding.MatchScoutArea.addView(v);
}
}
private void update_match_num(){
//public class matchScoutingView extends ConstraintLayout {
// public matchScoutingView(Context context) {
// super(context);
// }
// public matchScoutingView(Context context, AttributeSet attributeSet){
// super(context, attributeSet);
// }
//
// private static final int unsaved_color = 0x60ff0000;
// private static final int saved_color = 0x6000ff00;
//
// FragmentScoutingBinding binding;
// String alliance_position;
// String evcode;
// int cur_match_num;
// frcEvent event;
// String filename;
// String username;
//
// boolean edited = false;
//
// TextView[] titles;
// inputType[][] values;
// inputType[] latest_values;
// transferType[][] transferValues;
//
// AutoSaveManager asm = new AutoSaveManager(this::save);
//
// ArrayList<dataType> dataTypes;
//
//
//
// public void save(){
// System.out.println("Saved!");
// edited = false;
// set_indicator_color(saved_color);
//// fileEditor.createFile(filename);
// save_fields();
// }
//
// public void set_indicator_color(int color){
// binding.fileIndicator.setBackgroundColor(color);
// }
//
// public void update_asm(){
//// v.getBackground().setColorFilter(Color.parseColor("#00ff00"), PorterDuff.Mode.DARKEN);
// edited = true;
// set_indicator_color(unsaved_color);
// asm.update();
// }
//
//
// public void clear_fields(){
// int childCount = binding.MatchScoutArea.getChildCount();
// View[] views = new View[childCount];
//
// for(int i = 0; i < childCount; i++){
// views[i] = binding.MatchScoutArea.getChildAt(i);
// }
//
// for(int i = 0; i < childCount; i++){
// if(!views[i].isShown()) continue;
// binding.MatchScoutArea.removeView(views[i]);
// }
// }
//
//
// public void init(FragmentScoutingBinding tmp_binding, frcEvent event){
// binding = tmp_binding;
//
// alliance_position = latestSettings.settings.get_alliance_pos();
// evcode = event.eventCode;
// this.event = event;
// username = latestSettings.settings.get_username();
//
// binding.eventcode.setText(evcode);
// binding.alliancePosText.setText(alliance_position);
//
// binding.teamDescription.setVisibility(View.GONE);
// binding.teamName.setVisibility(View.GONE);
// clear_fields();
// binding.teamDescription.setVisibility(View.VISIBLE);
// binding.teamName.setVisibility(View.VISIBLE);
//
//
// values = fields.load(fields.matchFieldsFilename);
//
// if(values == null || values.length == 0){
// TextView tv = new TextView(getContext());
// tv.setText("Failed to load fields.\nTry to either download or create match scouting fields.");
// tv.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
// binding.MatchScoutArea.addView(tv);
// return;
// }
//
// cur_match_num = latestSettings.settings.get_match_num();
edited = false;
binding.matchnum.setText(String.valueOf(cur_match_num+1));
if(cur_match_num <= 0){
binding.backButton.setVisibility(View.GONE);
}else{
binding.backButton.setVisibility(View.VISIBLE);
}
if(cur_match_num >= event.matches.size()-1){
binding.nextButton.setVisibility(View.GONE);
}else{
binding.nextButton.setVisibility(View.VISIBLE);
}
}
private frcTeam get_team(frcMatch match){
// Get team number
String[] split = alliance_position.split("-");
Integer team_num = null;
switch (split[0]){
case "red":
team_num = match.redAlliance[Integer.parseInt(split[1])-1];
break;
case "blue":
team_num = match.blueAlliance[Integer.parseInt(split[1])-1];
break;
}
binding.barTeamNum.setText(String.valueOf(team_num));
frcTeam team = null;
for(int i=0; i < event.teams.size(); i++){
frcTeam tmpteam = event.teams.get(i);
if(tmpteam.teamNumber == team_num){
team = tmpteam;
break;
}
}
filename = evcode + "-" + (cur_match_num+1) + "-" + alliance_position + "-" + team_num + ".matchscoutdata";
return team;
}
public void update_scouting_data(){
frcMatch match = event.matches.get(cur_match_num);
frcTeam team = get_team(match);
binding.teamName.setText(team.teamName);
binding.teamDescription.setText(team.getDescription());
boolean new_file = !fileEditor.fileExist(filename);
if(asm.isRunning){
asm.stop();
}
if(new_file){
default_fields();
set_indicator_color(unsaved_color);
}else{
get_fields();
set_indicator_color(saved_color);
}
asm.start();
}
public void default_fields(){
for(int i = 0; i < latest_values.length; i++){
inputType input = latest_values[i];
input.setViewValue(input.default_value);
titles[i].setBackgroundColor(0x00000000);
titles[i].setTextColor(default_text_color);
}
}
public void get_fields(){
ScoutingDataWriter.ParsedScoutingDataResult psdr = ScoutingDataWriter.load(filename, values, transferValues);
dataType[] types = psdr.data.array;
for(int i = 0; i < latest_values.length; i++){
// update_match_num();
//
// binding.nextButton.setOnClickListener(v -> {
// if(edited) save();
// latestSettings.settings.set_match_num(cur_match_num+1);
// cur_match_num += 1;
// update_match_num();
// update_scouting_data();
// });
//
// binding.backButton.setOnClickListener(v -> {
// if(edited) save();
// latestSettings.settings.set_match_num(cur_match_num-1);
// cur_match_num -= 1;
// update_match_num();
// update_scouting_data();
// });
//
//// binding.middleButton.setOnClickListener(v -> {
//// if(edited) save();
//// });
//
// latest_values = values[values.length-1];
// transferValues = transferType.get_transfer_values(values);
//
// create_fields();
// update_scouting_data();
// }
//
// private int default_text_color = 0;
//
// private void create_fields(){
// if(asm.isRunning){
// asm.stop();
// }
//
// titles = new TextView[latest_values.length];
//
// for(int i = 0 ; i < latest_values.length; i++) {
// final TextView tv = new TextView(getContext());
// tv.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
// tv.setText(latest_values[i].name);
// tv.setPadding(8,8,8,8);
// tv.setTextSize(24);
// titles[i] = tv;
//
// default_text_color = tv.getCurrentTextColor();
//
// final View v = latest_values[i].createView(getContext(), new Function<dataType, Integer>() {
// @Override
// public Integer apply(dataType dataType) {
//// edited = true;
// if(asm.isRunning)
// update_asm();
// return 0;
// }
// });
//
// binding.MatchScoutArea.addView(tv);
// int fi = i;
// tv.setOnClickListener(p -> {
//// boolean blank = !latest_values[fi].getViewValue().isNull();
//
//// System.out.println(blank);
//
// asm.update();
//
// if(!latest_values[fi].isBlank){
// tv.setBackgroundColor(0xffff0000);
// tv.setTextColor(0xff000000);
// latest_values[fi].nullify();
// }else{
// tv.setBackgroundColor(0x00000000);
// tv.setTextColor(default_text_color);
// latest_values[fi].setViewValue(latest_values[fi].default_value);
// }
// });
//
// binding.MatchScoutArea.addView(v);
// }
// }
//
//
//
//
// private void update_match_num(){
//// cur_match_num = latestSettings.settings.get_match_num();
//
// edited = false;
//
// binding.matchnum.setText(String.valueOf(cur_match_num+1));
//
// if(cur_match_num <= 0){
// binding.backButton.setVisibility(View.GONE);
// }else{
// binding.backButton.setVisibility(View.VISIBLE);
// }
//
// if(cur_match_num >= event.matches.size()-1){
// binding.nextButton.setVisibility(View.GONE);
// }else{
// binding.nextButton.setVisibility(View.VISIBLE);
// }
// }
//
//
//
//
// private frcTeam get_team(frcMatch match){
//
// // Get team number
// String[] split = alliance_position.split("-");
// Integer team_num = null;
//
// switch (split[0]){
// case "red":
// team_num = match.redAlliance[Integer.parseInt(split[1])-1];
// break;
// case "blue":
// team_num = match.blueAlliance[Integer.parseInt(split[1])-1];
// break;
// }
//
// binding.barTeamNum.setText(String.valueOf(team_num));
//
// frcTeam team = null;
// for(int i=0; i < event.teams.size(); i++){
// frcTeam tmpteam = event.teams.get(i);
// if(tmpteam.teamNumber == team_num){
// team = tmpteam;
// break;
// }
// }
//
// filename = evcode + "-" + (cur_match_num+1) + "-" + alliance_position + "-" + team_num + ".matchscoutdata";
//
// return team;
// }
//
//
//
//
// public void update_scouting_data(){
//
// frcMatch match = event.matches.get(cur_match_num);
// frcTeam team = get_team(match);
//
// binding.teamName.setText(team.teamName);
// binding.teamDescription.setText(team.getDescription());
//
// boolean new_file = !fileEditor.fileExist(filename);
//
// if(asm.isRunning){
// asm.stop();
// }
//
// if(new_file){
// default_fields();
// set_indicator_color(unsaved_color);
// }else{
// get_fields();
// set_indicator_color(saved_color);
// }
//
// asm.start();
//
// }
//
//
//
// public void default_fields(){
// for(int i = 0; i < latest_values.length; i++){
// inputType input = latest_values[i];
// input.setViewValue(input.default_value);
//
// titles[i].setBackgroundColor(0x00000000);
// titles[i].setTextColor(default_text_color);
// }
// }
//
//
//
// public void get_fields(){
//
// ScoutingDataWriter.ParsedScoutingDataResult psdr = ScoutingDataWriter.load(filename, values, transferValues);
// dataType[] types = psdr.data.array;
//
// for(int i = 0; i < latest_values.length; i++){
//// types[i] = latest_values[i].getViewValue();
// latest_values[i].setViewValue(types[i]);
//
// if(latest_values[i].isBlank){
// titles[i].setBackgroundColor(0xffff0000);
// titles[i].setTextColor(0xff000000);
// }else{
// titles[i].setBackgroundColor(0x00000000);
// titles[i].setTextColor(default_text_color);
// }
// }
// }
//
//
//
// public void save_fields(){
//
// dataType[] types = new dataType[latest_values.length];
//
// for(int i = 0; i < latest_values.length; i++){
// types[i] = latest_values[i].getViewValue();
latest_values[i].setViewValue(types[i]);
if(latest_values[i].isBlank){
titles[i].setBackgroundColor(0xffff0000);
titles[i].setTextColor(0xff000000);
}else{
titles[i].setBackgroundColor(0x00000000);
titles[i].setTextColor(default_text_color);
}
}
}
public void save_fields(){
dataType[] types = new dataType[latest_values.length];
for(int i = 0; i < latest_values.length; i++){
types[i] = latest_values[i].getViewValue();
}
if(ScoutingDataWriter.save(values.length-1, username, filename, types))
System.out.println("Saved!");
else
System.out.println("Error saving");
}
}
// }
//
// if(ScoutingDataWriter.save(values.length-1, username, filename, types))
// System.out.println("Saved!");
// else
// System.out.println("Error saving");
// }
//}
@@ -1,17 +1,22 @@
package com.astatin3.scoutingapp2025.ui.scouting;
import android.content.Context;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import com.astatin3.scoutingapp2025.SettingsVersionStack.latestSettings;
import com.astatin3.scoutingapp2025.databinding.FragmentPitScoutingBinding;
import com.astatin3.scoutingapp2025.databinding.FragmentScoutingBinding;
import com.astatin3.scoutingapp2025.databinding.FragmentTeamSelectorBinding;
import com.astatin3.scoutingapp2025.scoutingData.ScoutingDataWriter;
import com.astatin3.scoutingapp2025.scoutingData.fields;
import com.astatin3.scoutingapp2025.scoutingData.transfer.transferType;
@@ -23,27 +28,33 @@ import com.astatin3.scoutingapp2025.utility.AutoSaveManager;
import com.astatin3.scoutingapp2025.utility.fileEditor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.function.Function;
public class pitScoutingView extends ConstraintLayout {
public pitScoutingView(Context context) {
super(context);
}
public pitScoutingView(Context context, AttributeSet attributeSet){
super(context, attributeSet);
public class pitScoutingFragment extends Fragment {
FragmentPitScoutingBinding binding;
private static frcTeam team;
public static void setTeam(frcTeam tmpteam){
team = tmpteam;
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
binding = FragmentPitScoutingBinding.inflate(inflater, container, false);
loadTeam();
return binding.getRoot();
}
private static final int unsaved_color = 0x60ff0000;
private static final int saved_color = 0x6000ff00;
boolean edited = false;
FragmentScoutingBinding binding;
String alliance_position;
String evcode;
frcEvent event;
String filename;
String username;
@@ -84,122 +95,52 @@ public class pitScoutingView extends ConstraintLayout {
}
public void init(FragmentScoutingBinding tmp_binding, frcEvent event){
binding = tmp_binding;
// public void init(frcEvent event){
//
// evcode = event.eventCode;
// this.event = event;
// username = latestSettings.settings.get_username();
//
//// binding.eventcode.setText(evcode);
//
// binding.pitBackButton.setOnClickListener(view -> {
// if(edited) save();
// binding.pitTeamName.setVisibility(View.GONE);
// binding.pitTeamDescription.setVisibility(View.GONE);
// clear_fields();
// load_teams();
// });
//
// values = fields.load(fields.pitsFieldsFilename);
//
// if(values == null || values.length == 0){
// TextView tv = new TextView(getContext());
// tv.setText("Failed to load fields.\nTry to either download or create pit scouting fields.");
// tv.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
// binding.pitScoutArea.addView(tv);
// return;
// }
//
// latest_values = values[values.length-1];
// transferValues = transferType.get_transfer_values(values);
// }
//
// public void clear_fields(){
// int childCount = binding.pitScoutArea.getChildCount();
// View[] views = new View[childCount];
//
// for(int i = 0; i < childCount; i++){
// views[i] = binding.pitScoutArea.getChildAt(i);
// }
//
// for(int i = 0; i < childCount; i++){
// if(!views[i].isShown()) continue;
// binding.pitScoutArea.removeView(views[i]);
// }
// }
evcode = event.eventCode;
this.event = event;
username = latestSettings.settings.get_username();
binding.eventcode.setText(evcode);
binding.pitBackButton.setOnClickListener(view -> {
if(edited) save();
binding.pitTeamName.setVisibility(View.GONE);
binding.pitTeamDescription.setVisibility(View.GONE);
clear_fields();
load_teams();
});
values = fields.load(fields.pitsFieldsFilename);
if(values == null || values.length == 0){
TextView tv = new TextView(getContext());
tv.setText("Failed to load fields.\nTry to either download or create pit scouting fields.");
tv.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
binding.pitScoutArea.addView(tv);
return;
}
latest_values = values[values.length-1];
transferValues = transferType.get_transfer_values(values);
// create_fields();
// update_scouting_data();
load_teams();
}
public void clear_fields(){
int childCount = binding.pitScoutArea.getChildCount();
View[] views = new View[childCount];
for(int i = 0; i < childCount; i++){
views[i] = binding.pitScoutArea.getChildAt(i);
}
for(int i = 0; i < childCount; i++){
if(!views[i].isShown()) continue;
binding.pitScoutArea.removeView(views[i]);
}
}
public void load_teams(){
binding.pitFileIndicator.setVisibility(View.GONE);
binding.pitTeamName.setVisibility(View.GONE);
binding.pitTeamDescription.setVisibility(View.GONE);
clear_fields();
int[] teamNums = new int[event.teams.size()];
for(int i = 0 ; i < event.teams.size(); i++){
teamNums[i] = event.teams.get(i).teamNumber;
}
Arrays.sort(teamNums);
TableLayout table = new TableLayout(getContext());
table.setStretchAllColumns(true);
binding.pitScoutArea.addView(table);
for(int i = 0; i < event.teams.size(); i++){
frcTeam team = null;
for(int a = 0 ; a < event.teams.size(); a++){
if(event.teams.get(a).teamNumber == teamNums[i]){
team = event.teams.get(a);
break;
}
}
TableRow tr = new TableRow(getContext());
TableLayout.LayoutParams rowParams = new TableLayout.LayoutParams(
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT
);
rowParams.setMargins(20,20,20,20);
tr.setLayoutParams(rowParams);
tr.setPadding(20,20,20,20);
table.addView(tr);
if(fileEditor.fileExist(evcode + "-" + team.teamNumber + ".pitscoutdata")){
tr.setBackgroundColor(0x3000FF00);
}else{
tr.setBackgroundColor(0x30FF0000);
}
TextView tv = new TextView(getContext());
tv.setText(String.valueOf(team.teamNumber));
tv.setTextSize(20);
tr.addView(tv);
tv = new TextView(getContext());
tv.setText(team.teamName);
tv.setTextSize(16);
tr.addView(tv);
frcTeam finalTeam = team;
tr.setOnClickListener(v -> {
// binding.pitScoutArea.removeView(table);
loadTeam(finalTeam);
});
}
}
public void loadTeam(frcTeam team){
clear_fields();
public void loadTeam(){
// clear_fields();
binding.pitFileIndicator.setVisibility(View.VISIBLE);
binding.pitTeamName.setVisibility(View.VISIBLE);
@@ -209,8 +150,8 @@ public class pitScoutingView extends ConstraintLayout {
binding.pitTeamDescription.setText(team.getDescription());
binding.pitBarTeamNum.setText(String.valueOf(team.teamNumber));
binding.teamName.setText(team.teamName);
binding.teamDescription.setText(team.getDescription());
// binding.teamName.setText(team.teamName);
// binding.teamDescription.setText(team.getDescription());
filename = evcode + "-" + team.teamNumber + ".pitscoutdata";
@@ -1,5 +1,7 @@
package com.astatin3.scoutingapp2025.ui.scouting;
import static androidx.navigation.fragment.FragmentKt.findNavController;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@@ -11,9 +13,12 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.astatin3.scoutingapp2025.R;
import com.astatin3.scoutingapp2025.SettingsVersionStack.latestSettings;
import com.astatin3.scoutingapp2025.databinding.FragmentScoutingBinding;
import com.astatin3.scoutingapp2025.types.frcEvent;
import com.astatin3.scoutingapp2025.types.frcTeam;
import com.astatin3.scoutingapp2025.ui.TeamSelectorFragment;
import com.astatin3.scoutingapp2025.ui.data.sentimentAnalysis;
import com.astatin3.scoutingapp2025.utility.fileEditor;
@@ -26,11 +31,8 @@ public class scoutingFragment extends Fragment {
@Nullable Bundle savedInstanceState) {
binding = FragmentScoutingBinding.inflate(inflater, container, false);
View root = binding.getRoot();
binding.buttons.setVisibility(View.VISIBLE);
binding.matchScoutingView.setVisibility(View.GONE);
binding.pitScoutingView.setVisibility(View.GONE);
String evcode = latestSettings.settings.get_evcode();
@@ -38,7 +40,7 @@ public class scoutingFragment extends Fragment {
binding.noEventError.setVisibility(View.VISIBLE);
binding.buttons.setVisibility(View.GONE);
is_main_page = false;
return root;
return binding.getRoot();
}
frcEvent event = frcEvent.decode(fileEditor.readFile(evcode + ".eventdata"));
@@ -47,21 +49,30 @@ public class scoutingFragment extends Fragment {
binding.matchScoutingButton.setVisibility(View.GONE);
binding.matchScoutingButton.setOnClickListener(v -> {
binding.buttons.setVisibility(View.GONE);
binding.matchScoutingView.setVisibility(View.VISIBLE);
binding.matchScoutingView.init(binding, event);
// binding.buttons.setVisibility(View.GONE);
findNavController(this).navigate(R.id.action_navigation_scouting_to_navigation_match_scouting);
// binding.init(binding, event);
is_main_page = false;
});
binding.pitScoutingButton.setOnClickListener(v -> {
binding.pitScoutingView.setVisibility(View.VISIBLE);
binding.buttons.setVisibility(View.GONE);
// binding.pitScoutingView.setVisibility(View.VISIBLE);
// binding.buttons.setVisibility(View.GONE);
// binding.pitScoutArea.setVisibility(View.VISIBLE);
binding.pitScoutingView.init(binding, event);
// binding.pitScoutingView.init(binding, event);
TeamSelectorFragment.setOnSelect(new TeamSelectorFragment.onTeamSelected() {
@Override
public void onSelect(TeamSelectorFragment self, frcTeam team) {
findNavController(self).navigate(R.id.action_navigation_scouting_to_navigation_team_selector);
}
});
findNavController(this).navigate(R.id.action_navigation_scouting_to_navigation_team_selector);
is_main_page = false;
});
return root;
return binding.getRoot();
}
@Override
@@ -82,9 +93,9 @@ public class scoutingFragment extends Fragment {
&& keyCode == KeyEvent.KEYCODE_BACK
&& !is_main_page){
binding.buttons.setVisibility(View.VISIBLE);
binding.matchScoutingView.setVisibility(View.GONE);
binding.pitScoutingView.setVisibility(View.GONE);
// binding.buttons.setVisibility(View.VISIBLE);
// binding.matchScoutingView.setVisibility(View.GONE);
// binding.pitScoutingView.setVisibility(View.GONE);
is_main_page = true;
return true;
@@ -1,39 +1,22 @@
package com.astatin3.scoutingapp2025.utility;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.widget.TableLayout;
import android.widget.TableRow;
import java.util.ArrayList;
import java.util.List;
public class ReorderableTableLayout extends TableLayout {
private boolean reorderingEnabled = false;
private int draggedRowIndex = -1;
private float lastY;
private List<View> originalRows;
private List<View> rows;
private List<Integer> reorderedIndices;
private int rowHeight;
public ReorderableTableLayout(Context context) {
@@ -47,7 +30,8 @@ public class ReorderableTableLayout extends TableLayout {
}
private void init() {
originalRows = new ArrayList<>();
rows = new ArrayList<>();
reorderedIndices = new ArrayList<>();
}
@Override
@@ -71,16 +55,32 @@ public class ReorderableTableLayout extends TableLayout {
return super.onInterceptTouchEvent(ev);
}
@Override
public void addView(View child) {
super.addView(child);
reorderedIndices.add(reorderedIndices.size());
}
@Override
public void removeAllViews() {
super.removeAllViews();
reorderedIndices.clear();
}
@Override
public boolean onTouchEvent(MotionEvent event) {
if (!reorderingEnabled || draggedRowIndex == -1) {
return super.onTouchEvent(event);
}
float currentY = event.getY();
int targetIndex = getRowIndexAtY(currentY);
View child = getChildAt(targetIndex);
if(child != null)
getChildAt(targetIndex).callOnClick();
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE:
float currentY = event.getY();
int targetIndex = getRowIndexAtY(currentY);
if (targetIndex != -1 && targetIndex != draggedRowIndex) {
updateRowOrder(draggedRowIndex, targetIndex);
draggedRowIndex = targetIndex;
@@ -106,25 +106,27 @@ public class ReorderableTableLayout extends TableLayout {
}
private void saveOriginalOrder() {
originalRows.clear();
rows.clear();
for (int i = 0; i < getChildCount(); i++) {
originalRows.add(getChildAt(i));
rows.add(getChildAt(i));
}
}
private void updateRowOrder(int fromIndex, int toIndex) {
if (fromIndex < toIndex) {
for (int i = fromIndex; i < toIndex; i++) {
Collections.swap(originalRows, i, i + 1);
Collections.swap(rows, i, i + 1);
Collections.swap(reorderedIndices, i, i + 1);
}
} else {
for (int i = fromIndex; i > toIndex; i--) {
Collections.swap(originalRows, i, i - 1);
Collections.swap(rows, i, i - 1);
Collections.swap(reorderedIndices, i, i - 1);
}
}
removeAllViewsInLayout();
for (View view : originalRows) {
for (View view : rows) {
addViewInLayout(view, -1, view.getLayoutParams(), true);
}
requestLayout();
@@ -136,10 +138,6 @@ public class ReorderableTableLayout extends TableLayout {
}
public List<Integer> getReorderedIndexes() {
List<Integer> reorderedIndexes = new ArrayList<>();
for (View view : originalRows) {
reorderedIndexes.add(indexOfChild(view));
}
return reorderedIndexes;
return reorderedIndices;
}
}
+3 -1
View File
@@ -28,6 +28,8 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/mobile_navigation" />
app:navGraph="@navigation/mobile_navigation">
</fragment>
</androidx.constraintlayout.widget.ConstraintLayout>
+4 -3
View File
@@ -113,7 +113,8 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toTopOf="parent"
tools:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
@@ -143,12 +144,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="60dp"
android:visibility="gone"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="gone">
tools:visibility="visible">
<Button
android:id="@+id/add_button"
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/back_button">
<LinearLayout
android:id="@+id/MatchScoutArea"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="48dp">
<TextView
android:id="@+id/team_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView"
android:textAlignment="center"
android:textSize="24sp" />
<TextView
android:id="@+id/team_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:text="TextView"
android:textAlignment="center" />
</LinearLayout>
</ScrollView>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/file_indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#60ff0000"
app:layout_constraintBottom_toBottomOf="@id/back_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/back_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Back"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/alliance_pos_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Temp"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/matchnum"
app:layout_constraintStart_toEndOf="@+id/back_button"
app:layout_constraintTop_toBottomOf="@id/eventcode" />
<TextView
android:id="@+id/eventcode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Temp"
android:textAlignment="center"
app:layout_constraintEnd_toStartOf="@+id/matchnum"
app:layout_constraintStart_toEndOf="@+id/back_button"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/matchnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Temp"
android:textAlignment="center"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/bar_team_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Temp"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/next_button"
app:layout_constraintStart_toEndOf="@+id/matchnum"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/pit_file_indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#60ff0000"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/pit_back_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/pit_bar_team_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAlignment="center"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/pit_bar_team_num"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<LinearLayout
android:id="@+id/pitScoutArea"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="48dp">
<TextView
android:id="@+id/pit_team_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=""
android:textAlignment="center"
android:textSize="24sp" />
<TextView
android:id="@+id/pit_team_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:text=""
android:textAlignment="center" />
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
+3 -246
View File
@@ -14,7 +14,7 @@
android:id="@+id/no_event_error"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="No event has been specified\nPlease select one"
android:text="@string/no_event_has_been_specified_nplease_select_one"
android:textAlignment="center"
android:textSize="20sp"
android:visibility="gone"
@@ -37,7 +37,7 @@
android:id="@+id/matchScoutingButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Match\n scouting"
android:text="@string/match_n_scouting"
android:textSize="34sp"
app:layout_constraintBottom_toTopOf="@id/pitScoutingButton"
app:layout_constraintEnd_toEndOf="parent"
@@ -48,7 +48,7 @@
android:id="@+id/pitScoutingButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pit\n Scouting"
android:text="@string/pit_n_scouting"
android:textSize="34sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@@ -57,249 +57,6 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<com.astatin3.scoutingapp2025.ui.scouting.matchScoutingView
android:id="@+id/matchScoutingView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="48dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0"
tools:visibility="gone">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/back_button">
<LinearLayout
android:id="@+id/MatchScoutArea"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="48dp">
<TextView
android:id="@+id/team_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView"
android:textAlignment="center"
android:textSize="24sp" />
<TextView
android:id="@+id/team_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:text="TextView"
android:textAlignment="center" />
</LinearLayout>
</ScrollView>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/file_indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#60ff0000"
app:layout_constraintBottom_toBottomOf="@id/back_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/back_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Back"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/next_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Next"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/alliance_pos_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Temp"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/matchnum"
app:layout_constraintStart_toEndOf="@+id/back_button"
app:layout_constraintTop_toBottomOf="@id/eventcode" />
<TextView
android:id="@+id/eventcode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Temp"
android:textAlignment="center"
app:layout_constraintEnd_toStartOf="@+id/matchnum"
app:layout_constraintStart_toEndOf="@+id/back_button"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/matchnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Temp"
android:textAlignment="center"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/bar_team_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Temp"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/next_button"
app:layout_constraintStart_toEndOf="@+id/matchnum"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- <Button-->
<!-- android:id="@+id/middle_button"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="Save"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent" />-->
</com.astatin3.scoutingapp2025.ui.scouting.matchScoutingView>
<com.astatin3.scoutingapp2025.ui.scouting.pitScoutingView
android:id="@+id/pitScoutingView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="60dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0"
tools:visibility="gone">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/back_button">
<LinearLayout
android:id="@+id/pitScoutArea"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="48dp">
<TextView
android:id="@+id/pit_team_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView"
android:textAlignment="center"
android:textSize="24sp" />
<TextView
android:id="@+id/pit_team_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:text="TextView"
android:textAlignment="center" />
</LinearLayout>
</ScrollView>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/pit_file_indicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#60ff0000"
app:layout_constraintBottom_toBottomOf="@id/back_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/pit_back_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/pit_bar_team_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="4388"
android:textAlignment="center"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2025code"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/pit_bar_team_num"
app:layout_constraintTop_toTopOf="parent" />
<!-- <TextView-->
<!-- android:id="@+id/pit_bar_team_num"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="Temp"-->
<!-- android:textSize="24sp"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintEnd_toStartOf="parent"-->
<!-- app:layout_constraintStart_toEndOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- <Button-->
<!-- android:id="@+id/middle_button"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="Save"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent" />-->
</com.astatin3.scoutingapp2025.ui.scouting.pitScoutingView>
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<LinearLayout
android:id="@+id/teams"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="48dp" />
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -9,27 +9,72 @@
android:id="@+id/navigation_scouting"
android:name="com.astatin3.scoutingapp2025.ui.scouting.scoutingFragment"
android:label="@string/title_scouting"
tools:layout="@layout/fragment_scouting" >
tools:layout="@layout/fragment_scouting">
<action
android:id="@+id/action_navigation_scouting_to_navigation_match_scouting"
app:destination="@id/navigation_match_scouting" />
<action
android:id="@+id/action_navigation_scouting_to_navigation_team_selector"
app:destination="@id/navigation_team_selector" />
</fragment>
<fragment
android:id="@+id/navigation_match_scouting"
android:name="com.astatin3.scoutingapp2025.ui.scouting.matchScoutDataEnterFragment"
tools:layout="@layout/fragment_match_scout_data_enter">
</fragment>
<fragment
android:id="@+id/navigation_team_selector"
android:name="com.astatin3.scoutingapp2025.ui.TeamSelectorFragment"
tools:layout="@layout/fragment_team_selector">
<action
android:id="@+id/action_navigation_team_selector_to_navigation_pit_scouting"
app:destination="@id/navigation_pit_scouting" />
</fragment>
<fragment
android:id="@+id/navigation_pit_scouting"
android:name="com.astatin3.scoutingapp2025.ui.scouting.pitScoutingFragment"
tools:layout="@layout/fragment_pit_scouting">
</fragment>
<fragment
android:id="@+id/navigation_data"
android:name="com.astatin3.scoutingapp2025.ui.data.dataFragment"
android:label="@string/title_data"
tools:layout="@layout/fragment_data" >
tools:layout="@layout/fragment_data">
</fragment>
<fragment
android:id="@+id/navigation_settings"
android:name="com.astatin3.scoutingapp2025.ui.settings.settingsFragment"
android:label="@string/title_settings"
tools:layout="@layout/fragment_settings" >
tools:layout="@layout/fragment_settings">
</fragment>
<fragment
android:id="@+id/navigation_transfer"
android:name="com.astatin3.scoutingapp2025.ui.transfer.TransferFragment"
android:label="@string/title_transfer"
tools:layout="@layout/fragment_transfer" />
tools:layout="@layout/fragment_transfer">
</fragment>
</navigation>
+4
View File
@@ -4,4 +4,8 @@
<string name="title_data">Data</string>
<string name="title_transfer">Transfer</string>
<string name="title_settings">Settings</string>
<string name="match_n_scouting">Match\n scouting</string>
<string name="pit_n_scouting">Pit\n Scouting</string>
<string name="back">back</string>
<string name="no_event_has_been_specified_nplease_select_one">No event has been specified\nPlease select one</string>
</resources>