mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-09 00:37:59 -06:00
Make everything use fragments
This commit is contained in:
@@ -21,7 +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
|
||||
- Fix navigation crashes.
|
||||
- Make pit and match data field builder UIs. I don't want to have to keep editing a variable
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ Ridgebotics 2025 scouting app in Android
|
||||
- Add "history" view type to the teams view menu.
|
||||
- Sentiment analysis of text input type
|
||||
#### Functionality:
|
||||
- Make everything use Fragments instead of views that toggle visibility
|
||||
- Make the file browser UI
|
||||
- Bluetooth data sync
|
||||
- Formalize error messages & stacktraces
|
||||
@@ -3,13 +3,16 @@ package com.astatin3.scoutingapp2025;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.astatin3.scoutingapp2025.scoutingData.fields;
|
||||
import com.astatin3.scoutingapp2025.ui.data.sentimentAnalysis;
|
||||
import com.astatin3.scoutingapp2025.utility.SentimentAnalysis;
|
||||
import com.astatin3.scoutingapp2025.utility.AlertManager;
|
||||
import com.astatin3.scoutingapp2025.utility.fileEditor;
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.navigation.NavController;
|
||||
import androidx.navigation.NavDestination;
|
||||
import androidx.navigation.Navigation;
|
||||
import androidx.navigation.ui.AppBarConfiguration;
|
||||
import androidx.navigation.ui.NavigationUI;
|
||||
@@ -26,6 +29,9 @@ public class MainActivity extends AppCompatActivity {
|
||||
private ActivityMainBinding binding;
|
||||
private BottomNavigationView navView;
|
||||
|
||||
private AppBarConfiguration appBarConfiguration;
|
||||
private NavController navController;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -41,24 +47,64 @@ public class MainActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
AlertManager.init(this);
|
||||
sentimentAnalysis.init(this);
|
||||
SentimentAnalysis.init(this);
|
||||
|
||||
Objects.requireNonNull(getSupportActionBar()).hide();
|
||||
|
||||
|
||||
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
binding = ActivityMainBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
// try()
|
||||
|
||||
|
||||
|
||||
|
||||
navView = findViewById(R.id.nav_view);
|
||||
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
|
||||
R.id.navigation_scouting, R.id.navigation_transfer, R.id.navigation_settings)
|
||||
// appBarConfiguration = new AppBarConfiguration.Builder(
|
||||
// R.id.navigation_scouting,
|
||||
// R.id.navigation_match_scouting,
|
||||
// R.id.navigation_team_selector,
|
||||
// R.id.navigation_pit_scouting,
|
||||
//
|
||||
// R.id.navigation_data,
|
||||
// R.id.navigation_data_status,
|
||||
// R.id.navigation_data_teams,
|
||||
// R.id.navigation_data_compile,
|
||||
// R.id.navigation_data_fields_chooser,
|
||||
// R.id.navigation_data_fields,
|
||||
//
|
||||
// R.id.navigation_transfer,
|
||||
// R.id.navigation_file_selector,
|
||||
// R.id.navigation_transfer_selector,
|
||||
// R.id.navigation_code_generator,
|
||||
// R.id.navigation_code_scanner,
|
||||
// R.id.navigation_bluetooth_sender,
|
||||
// R.id.navigation_bluetooth_receiver,
|
||||
// R.id.navigation_tba,
|
||||
//
|
||||
// R.id.navigation_settings)
|
||||
// .build();
|
||||
|
||||
appBarConfiguration = new AppBarConfiguration.Builder(
|
||||
R.id.navigation_scouting,
|
||||
R.id.navigation_data,
|
||||
R.id.navigation_transfer,
|
||||
R.id.navigation_settings)
|
||||
.build();
|
||||
|
||||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_activity_main);
|
||||
navController = Navigation.findNavController(this, R.id.nav_host_fragment_activity_main);
|
||||
|
||||
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
|
||||
NavigationUI.setupWithNavController(binding.navView, navController);
|
||||
NavigationUI.setupWithNavController(navView, navController);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp() {
|
||||
return navController.navigateUp() || super.onSupportNavigateUp();
|
||||
}
|
||||
}
|
||||
@@ -11,11 +11,8 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.astatin3.scoutingapp2025.R;
|
||||
import com.astatin3.scoutingapp2025.types.data.dataType;
|
||||
import com.astatin3.scoutingapp2025.types.data.intType;
|
||||
import com.astatin3.scoutingapp2025.types.data.stringType;
|
||||
import com.astatin3.scoutingapp2025.ui.data.sentimentAnalysis;
|
||||
import com.astatin3.scoutingapp2025.utility.BuiltByteParser;
|
||||
import com.astatin3.scoutingapp2025.utility.ByteBuilder;
|
||||
import com.github.mikephil.charting.charts.LineChart;
|
||||
@@ -27,7 +24,6 @@ import com.github.mikephil.charting.data.LineDataSet;
|
||||
import com.github.mikephil.charting.data.PieData;
|
||||
import com.github.mikephil.charting.data.PieDataSet;
|
||||
import com.github.mikephil.charting.data.PieEntry;
|
||||
import com.github.mikephil.charting.interfaces.datasets.IDataSet;
|
||||
import com.skydoves.powerspinner.IconSpinnerAdapter;
|
||||
import com.skydoves.powerspinner.IconSpinnerItem;
|
||||
import com.skydoves.powerspinner.OnSpinnerItemSelectedListener;
|
||||
|
||||
@@ -14,8 +14,7 @@ import android.widget.TextView;
|
||||
|
||||
import com.astatin3.scoutingapp2025.types.data.dataType;
|
||||
import com.astatin3.scoutingapp2025.types.data.stringType;
|
||||
import com.astatin3.scoutingapp2025.ui.data.sentimentAnalysis;
|
||||
import com.astatin3.scoutingapp2025.utility.AlertManager;
|
||||
import com.astatin3.scoutingapp2025.utility.SentimentAnalysis;
|
||||
import com.astatin3.scoutingapp2025.utility.BuiltByteParser;
|
||||
import com.astatin3.scoutingapp2025.utility.ByteBuilder;
|
||||
import com.github.mikephil.charting.charts.LineChart;
|
||||
@@ -156,7 +155,7 @@ public class textType extends inputType {
|
||||
|
||||
for (int i = 0; i < data.length; i++){
|
||||
if (!data[i].isNull()) {
|
||||
sentimentAnalysis.analyse((String) data[i].get(), new sentimentAnalysis.resultCallback() {
|
||||
SentimentAnalysis.analyse((String) data[i].get(), new SentimentAnalysis.resultCallback() {
|
||||
@Override
|
||||
public void onFinish(float sentiment) {
|
||||
positive_mean += sentiment;
|
||||
@@ -187,7 +186,7 @@ public class textType extends inputType {
|
||||
|
||||
entries.add(
|
||||
new Entry(i,
|
||||
sentimentAnalysis.analyse_sync( (String) data[i].get() )
|
||||
SentimentAnalysis.analyse_sync( (String) data[i].get() )
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ 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;
|
||||
@@ -27,7 +26,17 @@ public class TeamSelectorFragment extends Fragment {
|
||||
private FragmentTeamSelectorBinding binding;
|
||||
|
||||
private String evcode;
|
||||
private frcEvent event;
|
||||
|
||||
private static frcEvent event;
|
||||
public static void setEvent(frcEvent tmpevent){
|
||||
event = tmpevent;
|
||||
}
|
||||
|
||||
private static boolean pits_mode;
|
||||
public static void setPits_mode(boolean mode){
|
||||
pits_mode = mode;
|
||||
}
|
||||
|
||||
private static onTeamSelected onSelect = new onTeamSelected() {@Override public void onSelect(TeamSelectorFragment self, frcTeam team) {}};
|
||||
|
||||
public interface onTeamSelected {
|
||||
@@ -96,7 +105,7 @@ public class TeamSelectorFragment extends Fragment {
|
||||
tr.setPadding(20,20,20,20);
|
||||
table.addView(tr);
|
||||
|
||||
if(fileEditor.fileExist(evcode + "-" + team.teamNumber + ".pitscoutdata")){
|
||||
if(!pits_mode || fileEditor.fileExist(evcode + "-" + team.teamNumber + ".pitscoutdata")){
|
||||
tr.setBackgroundColor(0x3000FF00);
|
||||
}else{
|
||||
tr.setBackgroundColor(0x30FF0000);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.astatin3.scoutingapp2025.ui.data;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentDataCompileBinding;
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentPitScoutingBinding;
|
||||
|
||||
public class CompileFragment extends Fragment {
|
||||
FragmentDataCompileBinding binding;
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
|
||||
binding = FragmentDataCompileBinding.inflate(inflater, container, false);
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.astatin3.scoutingapp2025.ui.data;
|
||||
|
||||
import static androidx.navigation.fragment.FragmentKt.findNavController;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.astatin3.scoutingapp2025.R;
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentDataFieldsChooserBinding;
|
||||
import com.astatin3.scoutingapp2025.scoutingData.fields;
|
||||
|
||||
public class FieldsChooserFragment extends Fragment {
|
||||
|
||||
FragmentDataFieldsChooserBinding binding;
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
|
||||
binding = FragmentDataFieldsChooserBinding.inflate(inflater, container, false);
|
||||
|
||||
binding.matchScoutingButton.setOnClickListener(v -> {
|
||||
FieldsFragment.set_filename(fields.matchFieldsFilename);
|
||||
findNavController(this).navigate(R.id.action_navigation_data_fields_chooser_to_navigation_data_fields);
|
||||
});
|
||||
|
||||
binding.pitScoutingButton.setOnClickListener(v -> {
|
||||
FieldsFragment.set_filename(fields.pitsFieldsFilename);
|
||||
findNavController(this).navigate(R.id.action_navigation_data_fields_chooser_to_navigation_data_fields);
|
||||
});
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
}
|
||||
+24
-39
@@ -1,68 +1,53 @@
|
||||
package com.astatin3.scoutingapp2025.ui.data;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
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.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentDataBinding;
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentDataFieldsBinding;
|
||||
import com.astatin3.scoutingapp2025.scoutingData.fields;
|
||||
import com.astatin3.scoutingapp2025.types.input.inputType;
|
||||
|
||||
import java.util.List;
|
||||
public class FieldsFragment extends Fragment {
|
||||
FragmentDataFieldsBinding binding;
|
||||
|
||||
public class fieldsView extends ConstraintLayout {
|
||||
public fieldsView(@NonNull Context context) {
|
||||
super(context);
|
||||
private static String filename;
|
||||
public static void set_filename(String tmpfilename){
|
||||
filename = tmpfilename;
|
||||
}
|
||||
public fieldsView(Context context, AttributeSet attributeSet){
|
||||
super(context, attributeSet);
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
binding = FragmentDataFieldsBinding.inflate(inflater, container, false);
|
||||
|
||||
load_field_menu();
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
FragmentDataBinding binding;
|
||||
String filename;
|
||||
|
||||
private static final int background_color = 0x5000ff00;
|
||||
private static final int unfocused_background_color = 0x2000ff00;
|
||||
|
||||
inputType[][] values;
|
||||
|
||||
public void init(FragmentDataBinding binding) {
|
||||
this.binding = binding;
|
||||
|
||||
binding.fieldsSelectButtons.setVisibility(VISIBLE);
|
||||
binding.addButton.setVisibility(GONE);
|
||||
binding.fieldsArea.setReorderingEnabled(false);
|
||||
binding.fieldsArea.removeAllViews();
|
||||
binding.fieldsArea.setStretchAllColumns(true);
|
||||
binding.fieldsSelectButtons.bringToFront();
|
||||
|
||||
// binding.fieldsArea.setStretchAllColumns(true);
|
||||
|
||||
binding.matchScoutingButton.setOnClickListener(v -> {
|
||||
binding.fieldsSelectButtons.setVisibility(GONE);
|
||||
binding.addButton.setVisibility(VISIBLE);
|
||||
filename = fields.matchFieldsFilename;
|
||||
load_field_menu();
|
||||
});
|
||||
|
||||
binding.pitScoutingButton.setOnClickListener(v -> {
|
||||
binding.fieldsSelectButtons.setVisibility(GONE);
|
||||
binding.addButton.setVisibility(VISIBLE);
|
||||
filename = fields.pitsFieldsFilename;
|
||||
load_field_menu();
|
||||
});
|
||||
|
||||
}
|
||||
private void load_field_menu() {
|
||||
|
||||
values = fields.load(filename);
|
||||
|
||||
binding.fieldsArea.bringToFront();
|
||||
binding.fieldsArea.setStretchAllColumns(true);
|
||||
binding.fieldsArea.removeAllViews();
|
||||
binding.fieldsArea.setReorderingEnabled(false);
|
||||
|
||||
if(values == null) return;
|
||||
|
||||
for(int i = 0; i < values.length; i++){
|
||||
+27
-20
@@ -1,29 +1,42 @@
|
||||
package com.astatin3.scoutingapp2025.ui.data;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.event;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ScrollView;
|
||||
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.databinding.FragmentDataBinding;
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentDataStatusBinding;
|
||||
import com.astatin3.scoutingapp2025.utility.DataManager;
|
||||
import com.astatin3.scoutingapp2025.utility.fileEditor;
|
||||
import com.astatin3.scoutingapp2025.types.frcEvent;
|
||||
import com.astatin3.scoutingapp2025.types.frcMatch;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class statusView extends ScrollView {
|
||||
public statusView(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
public statusView(Context context, AttributeSet attributeSet){
|
||||
super(context, attributeSet);
|
||||
public class StatusFragment extends Fragment {
|
||||
FragmentDataStatusBinding binding;
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
|
||||
binding = FragmentDataStatusBinding.inflate(inflater, container, false);
|
||||
|
||||
DataManager.reload_event();
|
||||
binding.matchTable.removeAllViews();
|
||||
binding.matchTable.setStretchAllColumns(true);
|
||||
add_pit_scouting(event);
|
||||
add_match_scouting(event);
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
public static int color_found = 0x7f00ff00;
|
||||
public static int color_not_found = 0x7f7f0000;
|
||||
@@ -34,16 +47,10 @@ public class statusView extends ScrollView {
|
||||
text.setText(textStr);
|
||||
tr.addView(text);
|
||||
}
|
||||
public void start(FragmentDataBinding binding, frcEvent event) {
|
||||
binding.matchTable.removeAllViews();
|
||||
binding.matchTable.setStretchAllColumns(true);
|
||||
add_pit_scouting(binding, event);
|
||||
add_match_scouting(binding, event);
|
||||
}
|
||||
|
||||
public void add_pit_scouting(FragmentDataBinding binding, frcEvent event){
|
||||
public void add_pit_scouting(frcEvent event){
|
||||
TextView tv = new TextView(getContext());
|
||||
tv.setLayoutParams(new LayoutParams(
|
||||
tv.setLayoutParams(new TableRow.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
@@ -88,10 +95,10 @@ public class statusView extends ScrollView {
|
||||
}
|
||||
|
||||
|
||||
public void add_match_scouting(FragmentDataBinding binding, frcEvent event){
|
||||
public void add_match_scouting(frcEvent event){
|
||||
|
||||
TextView tv = new TextView(getContext());
|
||||
tv.setLayoutParams(new LayoutParams(
|
||||
tv.setLayoutParams(new TableRow.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
+40
-100
@@ -1,30 +1,33 @@
|
||||
package com.astatin3.scoutingapp2025.ui.data;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.evcode;
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.match_latest_values;
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.match_transferValues;
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.match_values;
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.pit_latest_values;
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.pit_transferValues;
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.pit_values;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.TableRow;
|
||||
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.FragmentDataTeamsBinding;
|
||||
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.frcTeam;
|
||||
import com.astatin3.scoutingapp2025.types.input.inputType;
|
||||
import com.astatin3.scoutingapp2025.utility.AlertManager;
|
||||
import com.astatin3.scoutingapp2025.utility.DataManager;
|
||||
import com.astatin3.scoutingapp2025.utility.fileEditor;
|
||||
import com.google.android.material.divider.MaterialDivider;
|
||||
import com.skydoves.powerspinner.IconSpinnerAdapter;
|
||||
@@ -34,102 +37,39 @@ import com.skydoves.powerspinner.PowerSpinnerView;
|
||||
import com.skydoves.powerspinner.SpinnerGravity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class teamsView extends ConstraintLayout {
|
||||
public teamsView(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
public teamsView(Context context, AttributeSet attributeSet){
|
||||
super(context, attributeSet);
|
||||
}
|
||||
public class TeamsFragment extends Fragment {
|
||||
FragmentDataTeamsBinding binding;
|
||||
|
||||
com.astatin3.scoutingapp2025.databinding.FragmentDataBinding binding;
|
||||
private static frcTeam team;
|
||||
public static void setTeam(frcTeam tmpteam){
|
||||
team = tmpteam;
|
||||
}
|
||||
|
||||
private static final int background_color = 0x5000ff00;
|
||||
private static final int unsaved_background_color = 0x2000ff00;
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
|
||||
String evcode;
|
||||
frcEvent event;
|
||||
|
||||
inputType[][] match_values;
|
||||
inputType[] latest_match_values;
|
||||
transferType[][] match_transferValues;
|
||||
inputType[][] pit_values;
|
||||
inputType[] latest_pit_values;
|
||||
transferType[][] pit_transferValues;
|
||||
|
||||
public void init(com.astatin3.scoutingapp2025.databinding.FragmentDataBinding binding, frcEvent event){
|
||||
this.binding = binding;
|
||||
this.evcode = event.eventCode;
|
||||
this.event = event;
|
||||
|
||||
|
||||
match_values = fields.load(fields.matchFieldsFilename);
|
||||
latest_match_values = match_values[match_values.length-1];
|
||||
match_transferValues = transferType.get_transfer_values(match_values);
|
||||
pit_values = fields.load(fields.pitsFieldsFilename);
|
||||
latest_pit_values = pit_values[pit_values.length-1];
|
||||
pit_transferValues = transferType.get_transfer_values(pit_values);
|
||||
|
||||
binding = FragmentDataTeamsBinding.inflate(inflater, container, false);
|
||||
|
||||
binding.teamsArea.removeAllViews();
|
||||
|
||||
DataManager.reload_match_fields();
|
||||
DataManager.reload_pit_fields();
|
||||
|
||||
TableLayout table = new TableLayout(getContext());
|
||||
table.setStretchAllColumns(true);
|
||||
binding.teamsArea.addView(table);
|
||||
|
||||
// binding.searchTable.addView(table);
|
||||
loadTeam(latestSettings.settings.get_data_view_mode());
|
||||
|
||||
int[] teams = new int[event.teams.size()];
|
||||
|
||||
for(int i = 0 ; i < event.teams.size(); i++){
|
||||
teams[i] = event.teams.get(i).teamNumber;
|
||||
}
|
||||
|
||||
Arrays.sort(teams);
|
||||
|
||||
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 == teams[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);
|
||||
|
||||
tr.setBackgroundColor(background_color);
|
||||
|
||||
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 -> {
|
||||
loadTeam(finalTeam, latestSettings.settings.get_data_view_mode());
|
||||
});
|
||||
}
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
public void loadTeam(frcTeam team, int mode) {
|
||||
public void loadTeam(int mode) {
|
||||
binding.teamsArea.removeAllViews();
|
||||
|
||||
LinearLayout ll = new LinearLayout(getContext());
|
||||
@@ -175,7 +115,7 @@ public class teamsView extends ConstraintLayout {
|
||||
IconSpinnerItem newItem) {
|
||||
|
||||
latestSettings.settings.set_data_view_mode(newIndex);
|
||||
loadTeam(team, newIndex);
|
||||
loadTeam(newIndex);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -284,7 +224,7 @@ public class teamsView extends ConstraintLayout {
|
||||
ll.addView(tv);
|
||||
|
||||
|
||||
latest_pit_values[a].add_individual_view(ll, psda.data.array[a]);
|
||||
pit_latest_values[a].add_individual_view(ll, psda.data.array[a]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,7 +316,7 @@ public class teamsView extends ConstraintLayout {
|
||||
ll.addView(tv);
|
||||
|
||||
|
||||
latest_match_values[a].add_individual_view(ll, psda.data.array[a]);
|
||||
match_latest_values[a].add_individual_view(ll, psda.data.array[a]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -387,7 +327,7 @@ public class teamsView extends ConstraintLayout {
|
||||
|
||||
|
||||
public void add_compiled_views(LinearLayout ll, String[] files){
|
||||
dataType[][] data = new dataType[latest_match_values.length][files.length];
|
||||
dataType[][] data = new dataType[match_latest_values.length][files.length];
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
|
||||
ScoutingDataWriter.ParsedScoutingDataResult psda = ScoutingDataWriter.load(files[i], match_values, match_transferValues);
|
||||
@@ -396,7 +336,7 @@ public class teamsView extends ConstraintLayout {
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < latest_match_values.length; i++){
|
||||
for(int i = 0; i < match_latest_values.length; i++){
|
||||
TextView tv = new TextView(getContext());
|
||||
tv.setLayoutParams(new FrameLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
@@ -404,11 +344,11 @@ public class teamsView extends ConstraintLayout {
|
||||
));
|
||||
tv.setPadding(0, 20, 0, 5);
|
||||
tv.setGravity(Gravity.CENTER_HORIZONTAL);
|
||||
tv.setText(latest_match_values[i].name);
|
||||
tv.setText(match_latest_values[i].name);
|
||||
tv.setTextSize(30);
|
||||
ll.addView(tv);
|
||||
|
||||
latest_match_values[i].add_compiled_view(ll, data[i]);
|
||||
match_latest_values[i].add_compiled_view(ll, data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,7 +357,7 @@ public class teamsView extends ConstraintLayout {
|
||||
|
||||
|
||||
public void add_history_views(LinearLayout ll, String[] files){
|
||||
dataType[][] data = new dataType[latest_match_values.length][files.length];
|
||||
dataType[][] data = new dataType[match_latest_values.length][files.length];
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
|
||||
ScoutingDataWriter.ParsedScoutingDataResult psda = ScoutingDataWriter.load(files[i], match_values, match_transferValues);
|
||||
@@ -426,7 +366,7 @@ public class teamsView extends ConstraintLayout {
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < latest_match_values.length; i++){
|
||||
for(int i = 0; i < match_latest_values.length; i++){
|
||||
TextView tv = new TextView(getContext());
|
||||
tv.setLayoutParams(new FrameLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
@@ -434,11 +374,11 @@ public class teamsView extends ConstraintLayout {
|
||||
));
|
||||
tv.setPadding(0, 20, 0, 5);
|
||||
tv.setGravity(Gravity.CENTER_HORIZONTAL);
|
||||
tv.setText(latest_match_values[i].name);
|
||||
tv.setText(match_latest_values[i].name);
|
||||
tv.setTextSize(30);
|
||||
ll.addView(tv);
|
||||
|
||||
latest_match_values[i].add_history_view(ll, data[i]);
|
||||
match_latest_values[i].add_history_view(ll, data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.astatin3.scoutingapp2025.ui.data;
|
||||
|
||||
|
||||
import static androidx.navigation.fragment.FragmentKt.findNavController;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import android.view.View;
|
||||
@@ -12,10 +13,11 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.astatin3.scoutingapp2025.MainActivity;
|
||||
import com.astatin3.scoutingapp2025.R;
|
||||
import com.astatin3.scoutingapp2025.SettingsVersionStack.latestSettings;
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentDataBinding;
|
||||
import com.astatin3.scoutingapp2025.types.frcTeam;
|
||||
import com.astatin3.scoutingapp2025.ui.TeamSelectorFragment;
|
||||
import com.astatin3.scoutingapp2025.utility.fileEditor;
|
||||
import com.astatin3.scoutingapp2025.types.frcEvent;
|
||||
|
||||
@@ -45,79 +47,36 @@ public class dataFragment extends Fragment {
|
||||
binding.fieldsButton.setVisibility(View.VISIBLE);
|
||||
|
||||
|
||||
binding.matchTable.setVisibility(View.GONE);
|
||||
return root;
|
||||
}
|
||||
|
||||
frcEvent event = frcEvent.decode(fileEditor.readFile(evcode + ".eventdata"));
|
||||
|
||||
binding.statusButton.setOnClickListener(v -> {
|
||||
binding.buttons.setVisibility(View.GONE);
|
||||
binding.statusView.setVisibility(View.VISIBLE);
|
||||
binding.statusView.start(binding, event);
|
||||
submenu = true;
|
||||
findNavController(this).navigate(R.id.action_navigation_data_to_navigation_data_status);
|
||||
});
|
||||
|
||||
binding.teamsButton.setOnClickListener(v -> {
|
||||
binding.buttons.setVisibility(View.GONE);
|
||||
binding.teamsView.setVisibility(View.VISIBLE);
|
||||
binding.teamsView.init(binding, event);
|
||||
submenu = true;
|
||||
TeamSelectorFragment.setEvent(event);
|
||||
TeamSelectorFragment.setPits_mode(false);
|
||||
TeamSelectorFragment.setOnSelect(new TeamSelectorFragment.onTeamSelected() {
|
||||
@Override
|
||||
public void onSelect(TeamSelectorFragment self, frcTeam team) {
|
||||
TeamsFragment.setTeam(team);
|
||||
findNavController(self).navigate(R.id.action_navigation_team_selector_to_navigation_data_teams);
|
||||
}
|
||||
});
|
||||
findNavController(this).navigate(R.id.action_navigation_data_to_navigation_team_selector);
|
||||
});
|
||||
|
||||
|
||||
|
||||
binding.compileButton.setOnClickListener(v -> {
|
||||
// binding.buttons.setVisibility(View.GONE);
|
||||
// binding.teamsView.setVisibility(View.VISIBLE);
|
||||
// binding.teamsView.init(binding, event);
|
||||
// submenu = true;
|
||||
|
||||
findNavController(this).navigate(R.id.action_navigation_data_to_navigation_data_compile);
|
||||
});
|
||||
|
||||
binding.fieldsButton.setOnClickListener(v -> {
|
||||
binding.buttons.setVisibility(View.GONE);
|
||||
binding.fieldsView.setVisibility(View.VISIBLE);
|
||||
binding.fieldsView.init(binding);
|
||||
submenu = true;
|
||||
findNavController(this).navigate(R.id.action_navigation_data_to_navigation_data_fields_chooser);
|
||||
});
|
||||
|
||||
show_ui();
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
public void show_ui(){
|
||||
binding.buttons.setVisibility(View.VISIBLE);
|
||||
binding.statusView.setVisibility(View.GONE);
|
||||
binding.teamsView.setVisibility(View.GONE);
|
||||
binding.fieldsView.setVisibility(View.GONE);
|
||||
submenu = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if(getView() == null){
|
||||
return;
|
||||
}
|
||||
|
||||
getView().setFocusableInTouchMode(true);
|
||||
getView().requestFocus();
|
||||
getView().setOnKeyListener(new View.OnKeyListener() {
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
|
||||
if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK && submenu){
|
||||
// handle back button's click listener
|
||||
|
||||
show_ui();
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
+29
-37
@@ -1,5 +1,8 @@
|
||||
package com.astatin3.scoutingapp2025.ui.scouting;
|
||||
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.evcode;
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.event;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -11,32 +14,31 @@ 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.FragmentMatchScoutingBinding;
|
||||
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.DataManager;
|
||||
import com.astatin3.scoutingapp2025.utility.fileEditor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class matchScoutDataEnterFragment extends Fragment {
|
||||
public class MatchScoutingFragment extends Fragment {
|
||||
|
||||
private FragmentMatchScoutDataEnterBinding binding;
|
||||
private FragmentMatchScoutingBinding binding;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
binding = FragmentMatchScoutDataEnterBinding.inflate(inflater, container, false);
|
||||
binding = FragmentMatchScoutingBinding.inflate(inflater, container, false);
|
||||
|
||||
DataManager.reload_match_fields();
|
||||
|
||||
alliance_position = latestSettings.settings.get_alliance_pos();
|
||||
evcode = event.eventCode;
|
||||
username = latestSettings.settings.get_username();
|
||||
|
||||
binding.eventcode.setText(evcode);
|
||||
@@ -48,7 +50,7 @@ public class matchScoutDataEnterFragment extends Fragment {
|
||||
binding.teamDescription.setVisibility(View.VISIBLE);
|
||||
binding.teamName.setVisibility(View.VISIBLE);
|
||||
|
||||
if(values == null || values.length == 0){
|
||||
if(DataManager.match_values == null || DataManager.match_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);
|
||||
@@ -56,12 +58,7 @@ public class matchScoutDataEnterFragment extends Fragment {
|
||||
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();
|
||||
@@ -98,18 +95,13 @@ public class matchScoutDataEnterFragment extends Fragment {
|
||||
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);
|
||||
|
||||
@@ -158,19 +150,19 @@ public class matchScoutDataEnterFragment extends Fragment {
|
||||
asm.stop();
|
||||
}
|
||||
|
||||
titles = new TextView[latest_values.length];
|
||||
titles = new TextView[DataManager.match_latest_values.length];
|
||||
|
||||
for(int i = 0 ; i < latest_values.length; i++) {
|
||||
for(int i = 0 ; i < DataManager.match_latest_values.length; i++) {
|
||||
final TextView tv = new TextView(getContext());
|
||||
tv.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
|
||||
tv.setText(latest_values[i].name);
|
||||
tv.setText(DataManager.match_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>() {
|
||||
final View v = DataManager.match_latest_values[i].createView(getContext(), new Function<dataType, Integer>() {
|
||||
@Override
|
||||
public Integer apply(dataType dataType) {
|
||||
// edited = true;
|
||||
@@ -189,14 +181,14 @@ public class matchScoutDataEnterFragment extends Fragment {
|
||||
|
||||
asm.update();
|
||||
|
||||
if(!latest_values[fi].isBlank){
|
||||
if(!DataManager.match_latest_values[fi].isBlank){
|
||||
tv.setBackgroundColor(0xffff0000);
|
||||
tv.setTextColor(0xff000000);
|
||||
latest_values[fi].nullify();
|
||||
DataManager.match_latest_values[fi].nullify();
|
||||
}else{
|
||||
tv.setBackgroundColor(0x00000000);
|
||||
tv.setTextColor(default_text_color);
|
||||
latest_values[fi].setViewValue(latest_values[fi].default_value);
|
||||
DataManager.match_latest_values[fi].setViewValue(DataManager.match_latest_values[fi].default_value);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -293,8 +285,8 @@ public class matchScoutDataEnterFragment extends Fragment {
|
||||
|
||||
|
||||
public void default_fields(){
|
||||
for(int i = 0; i < latest_values.length; i++){
|
||||
inputType input = latest_values[i];
|
||||
for(int i = 0; i < DataManager.match_latest_values.length; i++){
|
||||
inputType input = DataManager.match_latest_values[i];
|
||||
input.setViewValue(input.default_value);
|
||||
|
||||
titles[i].setBackgroundColor(0x00000000);
|
||||
@@ -306,14 +298,14 @@ public class matchScoutDataEnterFragment extends Fragment {
|
||||
|
||||
public void get_fields(){
|
||||
|
||||
ScoutingDataWriter.ParsedScoutingDataResult psdr = ScoutingDataWriter.load(filename, values, transferValues);
|
||||
ScoutingDataWriter.ParsedScoutingDataResult psdr = ScoutingDataWriter.load(filename, DataManager.match_values, DataManager.match_transferValues);
|
||||
dataType[] types = psdr.data.array;
|
||||
|
||||
for(int i = 0; i < latest_values.length; i++){
|
||||
for(int i = 0; i < DataManager.match_latest_values.length; i++){
|
||||
// types[i] = latest_values[i].getViewValue();
|
||||
latest_values[i].setViewValue(types[i]);
|
||||
DataManager.match_latest_values[i].setViewValue(types[i]);
|
||||
|
||||
if(latest_values[i].isBlank){
|
||||
if(DataManager.match_latest_values[i].isBlank){
|
||||
titles[i].setBackgroundColor(0xffff0000);
|
||||
titles[i].setTextColor(0xff000000);
|
||||
}else{
|
||||
@@ -327,13 +319,13 @@ public class matchScoutDataEnterFragment extends Fragment {
|
||||
|
||||
public void save_fields(){
|
||||
|
||||
dataType[] types = new dataType[latest_values.length];
|
||||
dataType[] types = new dataType[DataManager.match_latest_values.length];
|
||||
|
||||
for(int i = 0; i < latest_values.length; i++){
|
||||
types[i] = latest_values[i].getViewValue();
|
||||
for(int i = 0; i < DataManager.match_latest_values.length; i++){
|
||||
types[i] = DataManager.match_latest_values[i].getViewValue();
|
||||
}
|
||||
|
||||
if(ScoutingDataWriter.save(values.length-1, username, filename, types))
|
||||
if(ScoutingDataWriter.save(DataManager.match_values.length-1, username, filename, types))
|
||||
System.out.println("Saved!");
|
||||
else
|
||||
System.out.println("Error saving");
|
||||
+26
-29
@@ -1,8 +1,10 @@
|
||||
package com.astatin3.scoutingapp2025.ui.scouting;
|
||||
|
||||
import android.content.Context;
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.pit_latest_values;
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.pit_transferValues;
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.pit_values;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -10,27 +12,22 @@ 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;
|
||||
import com.astatin3.scoutingapp2025.types.data.dataType;
|
||||
import com.astatin3.scoutingapp2025.types.frcEvent;
|
||||
import com.astatin3.scoutingapp2025.types.frcTeam;
|
||||
import com.astatin3.scoutingapp2025.types.input.inputType;
|
||||
import com.astatin3.scoutingapp2025.utility.AutoSaveManager;
|
||||
import com.astatin3.scoutingapp2025.utility.DataManager;
|
||||
import com.astatin3.scoutingapp2025.utility.fileEditor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class pitScoutingFragment extends Fragment {
|
||||
public class PitScoutingFragment extends Fragment {
|
||||
|
||||
FragmentPitScoutingBinding binding;
|
||||
|
||||
@@ -45,6 +42,9 @@ public class pitScoutingFragment extends Fragment {
|
||||
|
||||
binding = FragmentPitScoutingBinding.inflate(inflater, container, false);
|
||||
|
||||
username = latestSettings.settings.get_username();
|
||||
DataManager.reload_pit_fields();
|
||||
|
||||
loadTeam();
|
||||
|
||||
return binding.getRoot();
|
||||
@@ -59,9 +59,6 @@ public class pitScoutingFragment extends Fragment {
|
||||
String username;
|
||||
|
||||
TextView[] titles;
|
||||
inputType[][] values;
|
||||
inputType[] latest_values;
|
||||
transferType[][] transferValues;
|
||||
|
||||
AutoSaveManager asm = new AutoSaveManager(this::save);
|
||||
|
||||
@@ -71,13 +68,13 @@ public class pitScoutingFragment extends Fragment {
|
||||
edited = false;
|
||||
set_indicator_color(saved_color);
|
||||
|
||||
dataType[] types = new dataType[latest_values.length];
|
||||
dataType[] types = new dataType[pit_latest_values.length];
|
||||
|
||||
for(int i = 0; i < latest_values.length; i++){
|
||||
types[i] = latest_values[i].getViewValue();
|
||||
for(int i = 0; i < pit_latest_values.length; i++){
|
||||
types[i] = pit_latest_values[i].getViewValue();
|
||||
}
|
||||
|
||||
if(ScoutingDataWriter.save(values.length-1, username, filename, types))
|
||||
if(ScoutingDataWriter.save(pit_values.length-1, username, filename, types))
|
||||
System.out.println("Saved!");
|
||||
else
|
||||
System.out.println("Error saving");
|
||||
@@ -183,12 +180,12 @@ public class pitScoutingFragment extends Fragment {
|
||||
asm.stop();
|
||||
}
|
||||
|
||||
titles = new TextView[latest_values.length];
|
||||
titles = new TextView[pit_latest_values.length];
|
||||
|
||||
for(int i = 0 ; i < latest_values.length; i++) {
|
||||
for(int i = 0 ; i < pit_latest_values.length; i++) {
|
||||
TextView tv = new TextView(getContext());
|
||||
tv.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
|
||||
tv.setText(latest_values[i].name);
|
||||
tv.setText(pit_latest_values[i].name);
|
||||
tv.setTextSize(24);
|
||||
tv.setPadding(8,8,8,8);
|
||||
titles[i] = tv;
|
||||
@@ -204,18 +201,18 @@ public class pitScoutingFragment extends Fragment {
|
||||
|
||||
asm.update();
|
||||
|
||||
if(!latest_values[fi].isBlank){
|
||||
if(!pit_latest_values[fi].isBlank){
|
||||
tv.setBackgroundColor(0xffff0000);
|
||||
tv.setTextColor(0xff000000);
|
||||
latest_values[fi].nullify();
|
||||
pit_latest_values[fi].nullify();
|
||||
}else{
|
||||
tv.setBackgroundColor(0x00000000);
|
||||
tv.setTextColor(default_text_color);
|
||||
latest_values[fi].setViewValue(latest_values[fi].default_value);
|
||||
pit_latest_values[fi].setViewValue(pit_latest_values[fi].default_value);
|
||||
}
|
||||
});
|
||||
|
||||
View v = latest_values[i].createView(getContext(), new Function<dataType, Integer>() {
|
||||
View v = pit_latest_values[i].createView(getContext(), new Function<dataType, Integer>() {
|
||||
@Override
|
||||
public Integer apply(dataType dataType) {
|
||||
// edited = true;
|
||||
@@ -230,8 +227,8 @@ public class pitScoutingFragment extends Fragment {
|
||||
}
|
||||
|
||||
public void default_fields(){
|
||||
for(int i = 0; i < latest_values.length; i++){
|
||||
inputType input = latest_values[i];
|
||||
for(int i = 0; i < pit_latest_values.length; i++){
|
||||
inputType input = pit_latest_values[i];
|
||||
input.setViewValue(input.default_value);
|
||||
|
||||
titles[i].setBackgroundColor(0x00000000);
|
||||
@@ -241,14 +238,14 @@ public class pitScoutingFragment extends Fragment {
|
||||
|
||||
public void get_fields(){
|
||||
|
||||
ScoutingDataWriter.ParsedScoutingDataResult psdr = ScoutingDataWriter.load(filename, values, transferValues);
|
||||
ScoutingDataWriter.ParsedScoutingDataResult psdr = ScoutingDataWriter.load(filename, pit_values, pit_transferValues);
|
||||
dataType[] types = psdr.data.array;
|
||||
|
||||
for(int i = 0; i < latest_values.length; i++){
|
||||
for(int i = 0; i < pit_latest_values.length; i++){
|
||||
// types[i] = latest_values[i].getViewValue();
|
||||
latest_values[i].setViewValue(types[i]);
|
||||
pit_latest_values[i].setViewValue(types[i]);
|
||||
|
||||
if(latest_values[i].isBlank){
|
||||
if(pit_latest_values[i].isBlank){
|
||||
titles[i].setBackgroundColor(0xffff0000);
|
||||
titles[i].setTextColor(0xff000000);
|
||||
}else{
|
||||
+9
-16
@@ -2,6 +2,8 @@ package com.astatin3.scoutingapp2025.ui.scouting;
|
||||
|
||||
import static androidx.navigation.fragment.FragmentKt.findNavController;
|
||||
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.event;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -16,13 +18,11 @@ 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;
|
||||
import com.astatin3.scoutingapp2025.utility.DataManager;
|
||||
|
||||
public class scoutingFragment extends Fragment {
|
||||
public class ScoutingFragment extends Fragment {
|
||||
|
||||
private FragmentScoutingBinding binding;
|
||||
private boolean is_main_page = true;
|
||||
@@ -43,33 +43,26 @@ public class scoutingFragment extends Fragment {
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
frcEvent event = frcEvent.decode(fileEditor.readFile(evcode + ".eventdata"));
|
||||
DataManager.reload_event();
|
||||
|
||||
if(event.matches.isEmpty())
|
||||
binding.matchScoutingButton.setVisibility(View.GONE);
|
||||
|
||||
binding.matchScoutingButton.setOnClickListener(v -> {
|
||||
// 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.pitScoutArea.setVisibility(View.VISIBLE);
|
||||
// binding.pitScoutingView.init(binding, event);
|
||||
|
||||
TeamSelectorFragment.setEvent(event);
|
||||
TeamSelectorFragment.setPits_mode(true);
|
||||
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);
|
||||
PitScoutingFragment.setTeam(team);
|
||||
findNavController(self).navigate(R.id.action_navigation_team_selector_to_navigation_pit_scouting);
|
||||
}
|
||||
});
|
||||
findNavController(this).navigate(R.id.action_navigation_scouting_to_navigation_team_selector);
|
||||
|
||||
is_main_page = false;
|
||||
});
|
||||
|
||||
return binding.getRoot();
|
||||
@@ -1,343 +0,0 @@
|
||||
package com.astatin3.scoutingapp2025.ui.scouting;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.astatin3.scoutingapp2025.scoutingData.ScoutingDataWriter;
|
||||
import com.astatin3.scoutingapp2025.scoutingData.fields;
|
||||
import com.astatin3.scoutingapp2025.SettingsVersionStack.latestSettings;
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentScoutingBinding;
|
||||
import com.astatin3.scoutingapp2025.scoutingData.transfer.transferType;
|
||||
import com.astatin3.scoutingapp2025.types.data.dataType;
|
||||
import com.astatin3.scoutingapp2025.types.data.intType;
|
||||
import com.astatin3.scoutingapp2025.types.input.inputType;
|
||||
import com.astatin3.scoutingapp2025.utility.fileEditor;
|
||||
import com.astatin3.scoutingapp2025.types.frcEvent;
|
||||
import com.astatin3.scoutingapp2025.types.frcMatch;
|
||||
import com.astatin3.scoutingapp2025.types.frcTeam;
|
||||
import com.astatin3.scoutingapp2025.utility.AutoSaveManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class matchScoutingView {}
|
||||
|
||||
//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();
|
||||
// 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();
|
||||
// }
|
||||
//
|
||||
// if(ScoutingDataWriter.save(values.length-1, username, filename, types))
|
||||
// System.out.println("Saved!");
|
||||
// else
|
||||
// System.out.println("Error saving");
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,189 @@
|
||||
package com.astatin3.scoutingapp2025.ui.transfer;
|
||||
|
||||
import static com.astatin3.scoutingapp2025.utility.DataManager.evcode;
|
||||
|
||||
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.databinding.FragmentTransferFileSelectorBinding;
|
||||
import com.astatin3.scoutingapp2025.types.file;
|
||||
import com.astatin3.scoutingapp2025.utility.AlertManager;
|
||||
import com.astatin3.scoutingapp2025.utility.ByteBuilder;
|
||||
import com.astatin3.scoutingapp2025.utility.fileEditor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class FileSelectorFragment extends Fragment {
|
||||
private static final int background_color = 0x5000ff00;
|
||||
private static final int unselected_background_color = 0x2000ff00;
|
||||
|
||||
private static on_file_select onSelect = files -> {};
|
||||
|
||||
public static void setOnSelect(on_file_select tmp){onSelect = tmp;}
|
||||
|
||||
public interface on_file_select {
|
||||
void onSelect(byte[] data);
|
||||
}
|
||||
|
||||
FragmentTransferFileSelectorBinding binding;
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
binding = FragmentTransferFileSelectorBinding.inflate(inflater, container, false);
|
||||
|
||||
|
||||
meta_string_array = new String[]{
|
||||
"matches.fields",
|
||||
"pits.fields",
|
||||
evcode+".eventdata"
|
||||
};
|
||||
|
||||
String[] files = fileEditor.getEventFiles(evcode);
|
||||
|
||||
Boolean[] selected_arr = new Boolean[files.length];
|
||||
Arrays.fill(selected_arr, Boolean.TRUE);
|
||||
|
||||
for(int i = 0; i < files.length; i++){
|
||||
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);
|
||||
binding.fileSelectorTable.addView(tr);
|
||||
|
||||
tr.setBackgroundColor(background_color);
|
||||
|
||||
TextView tv = new TextView(getContext());
|
||||
tv.setText(String.valueOf(files[i]));
|
||||
tv.setTextSize(20);
|
||||
tr.addView(tv);
|
||||
|
||||
final int fi = i;
|
||||
tr.setOnClickListener(view -> {
|
||||
boolean sel = !selected_arr[fi];
|
||||
selected_arr[fi] = sel;
|
||||
|
||||
tr.setBackgroundColor(sel ? background_color : unselected_background_color);
|
||||
});
|
||||
}
|
||||
|
||||
binding.fileSelectorSearchbar.setOnKeyListener((view, a, keyEvent) -> {
|
||||
|
||||
String search_param = binding.fileSelectorSearchbar.getText().toString();
|
||||
List<Integer> match_num_nums = get_matches_from_search_params(search_param);
|
||||
|
||||
Arrays.fill(selected_arr, Boolean.TRUE);
|
||||
|
||||
for(int i = 0; i < files.length; i++){
|
||||
View child = binding.fileSelectorTable.getChildAt(i);
|
||||
child.setBackgroundColor(background_color);
|
||||
child.setVisibility(is_in_search_param(files[i], search_param, match_num_nums) ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
binding.fileSelectorButton.setText("Send");
|
||||
binding.fileSelectorButton.setOnClickListener(view -> {
|
||||
List<String> filenames = new ArrayList<>();
|
||||
for(int i = 0; i < files.length; i++){
|
||||
View child = binding.fileSelectorTable.getChildAt(i);
|
||||
if(child.getVisibility() == View.VISIBLE && selected_arr[i])
|
||||
filenames.add(files[i]);
|
||||
}
|
||||
onSelect.onSelect(get_bytes_of_filenames(filenames));
|
||||
});
|
||||
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static String[] meta_string_array;
|
||||
|
||||
private boolean is_in_search_param(String filename, String search_param, List<Integer> nums){
|
||||
return
|
||||
("meta".contains(search_param) && Arrays.asList(meta_string_array).contains(filename)) ||
|
||||
filename.contains(search_param) ||
|
||||
match_file_is_match_num(filename, nums);
|
||||
}
|
||||
|
||||
|
||||
private boolean match_file_is_match_num(String filename, List<Integer> nums){
|
||||
if(!filename.endsWith(".matchscoutdata")) return false;
|
||||
String[] dash_split = filename.split("-");
|
||||
if(dash_split.length != 5) return false;
|
||||
String s = dash_split[1];
|
||||
if(!is_int(s)) return false;
|
||||
int n = Integer.parseInt(s);
|
||||
return nums.contains(n);
|
||||
}
|
||||
|
||||
private List<Integer> get_matches_from_search_params(String search_param){
|
||||
List<Integer> nums = new ArrayList<>();
|
||||
String[] comma_split = search_param.split(",");
|
||||
|
||||
for(int i = 0; i < comma_split.length; i++){
|
||||
if(comma_split[i].contains("-")){
|
||||
|
||||
String[] dash_split = comma_split[i].split("-");
|
||||
if(dash_split.length != 2) continue;
|
||||
String stra = dash_split[0];
|
||||
String strb = dash_split[1];
|
||||
|
||||
if(!(is_int(stra) && is_int(strb))) continue;
|
||||
|
||||
int a = Integer.parseUnsignedInt(stra);
|
||||
int b = Integer.parseUnsignedInt(strb);
|
||||
|
||||
for(int x = a; x <= b; x++)
|
||||
nums.add(x);
|
||||
} else if(is_int(comma_split[i]))
|
||||
nums.add(Integer.parseUnsignedInt(comma_split[i]));
|
||||
}
|
||||
|
||||
return nums;
|
||||
}
|
||||
|
||||
private boolean is_int(String num){
|
||||
try {
|
||||
Integer.parseUnsignedInt(num);
|
||||
return true;
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static byte[] get_bytes_of_filenames(List<String> filenames){
|
||||
try {
|
||||
ByteBuilder b = new ByteBuilder();
|
||||
|
||||
for(int i = 0; i < filenames.size(); i++){
|
||||
file f = new file(filenames.get(i));
|
||||
b.addRaw(file.typecode, f.encode());
|
||||
}
|
||||
|
||||
return b.build();
|
||||
} catch (ByteBuilder.buildingException e){
|
||||
AlertManager.error(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,10 @@ package com.astatin3.scoutingapp2025.ui.transfer;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
@@ -12,6 +14,12 @@ 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.databinding.FragmentDataCompileBinding;
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentTransferTbaBinding;
|
||||
import com.astatin3.scoutingapp2025.utility.AlertManager;
|
||||
import com.astatin3.scoutingapp2025.utility.RequestTask;
|
||||
import com.astatin3.scoutingapp2025.types.frcEvent;
|
||||
@@ -33,21 +41,19 @@ import java.util.Calendar;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
|
||||
public class TBAView extends ScrollView {
|
||||
public class TBAView extends Fragment {
|
||||
private final String TBAAddress = "https://www.thebluealliance.com/api/v3/";
|
||||
private final String TBAHeader = "X-TBA-Auth-Key: tjEKSZojAU2pgbs2mBt06SKyOakVhLutj3NwuxLTxPKQPLih11aCIwRIVFXKzY4e";
|
||||
|
||||
private android.widget.TableLayout Table;
|
||||
private FragmentTransferTbaBinding binding;
|
||||
|
||||
public TBAView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
private static final int year = 2024;
|
||||
|
||||
public TBAView(Context context, AttributeSet attributeSet){
|
||||
super(context, attributeSet);
|
||||
}
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
|
||||
public void start(FragmentTransferBinding binding, String yearStr) {
|
||||
binding = FragmentTransferTbaBinding.inflate(inflater, container, false);
|
||||
|
||||
Table = binding.matchTable;
|
||||
|
||||
@@ -62,8 +68,9 @@ public class TBAView extends ScrollView {
|
||||
eventTable(s);
|
||||
return null;
|
||||
});
|
||||
rq.execute(TBAAddress + "events/"+yearStr, TBAHeader);
|
||||
rq.execute(TBAAddress + "events/"+year, TBAHeader);
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
private void addTableText(TableRow tr, String textStr){
|
||||
@@ -92,8 +99,8 @@ public class TBAView extends ScrollView {
|
||||
for(int i=0;i<data.length();i++){
|
||||
TableRow tr = new TableRow(getContext());
|
||||
TableLayout.LayoutParams rowParams = new TableLayout.LayoutParams(
|
||||
LayoutParams.WRAP_CONTENT,
|
||||
LayoutParams.WRAP_CONTENT
|
||||
TableRow.LayoutParams.WRAP_CONTENT,
|
||||
TableRow.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
rowParams.setMargins(20,20,20,20);
|
||||
tr.setLayoutParams(rowParams);
|
||||
@@ -209,7 +216,7 @@ public class TBAView extends ScrollView {
|
||||
|
||||
// Event code at top
|
||||
TextView tv = new TextView(getContext());
|
||||
tv.setLayoutParams(new LayoutParams(
|
||||
tv.setLayoutParams(new TableRow.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
@@ -219,7 +226,7 @@ public class TBAView extends ScrollView {
|
||||
|
||||
// Event Name
|
||||
tv = new TextView(getContext());
|
||||
tv.setLayoutParams(new LayoutParams(
|
||||
tv.setLayoutParams(new TableRow.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
@@ -234,7 +241,7 @@ public class TBAView extends ScrollView {
|
||||
Button btn = new Button(getContext());
|
||||
btn.setText("Save");
|
||||
btn.setTextSize(18);
|
||||
btn.setLayoutParams(new LayoutParams(
|
||||
btn.setLayoutParams(new TableRow.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
@@ -245,7 +252,7 @@ public class TBAView extends ScrollView {
|
||||
|
||||
if(teamData.length() == 0){
|
||||
tv = new TextView(getContext());
|
||||
tv.setLayoutParams(new LayoutParams(
|
||||
tv.setLayoutParams(new TableRow.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
@@ -255,7 +262,7 @@ public class TBAView extends ScrollView {
|
||||
Table.addView(tv);
|
||||
|
||||
tv = new TextView(getContext());
|
||||
tv.setLayoutParams(new LayoutParams(
|
||||
tv.setLayoutParams(new TableRow.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
@@ -268,7 +275,7 @@ public class TBAView extends ScrollView {
|
||||
return;
|
||||
}else if(matchData.length() == 0){
|
||||
tv = new TextView(getContext());
|
||||
tv.setLayoutParams(new LayoutParams(
|
||||
tv.setLayoutParams(new TableRow.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
@@ -278,7 +285,7 @@ public class TBAView extends ScrollView {
|
||||
Table.addView(tv);
|
||||
|
||||
tv = new TextView(getContext());
|
||||
tv.setLayoutParams(new LayoutParams(
|
||||
tv.setLayoutParams(new TableRow.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
@@ -291,7 +298,7 @@ public class TBAView extends ScrollView {
|
||||
|
||||
|
||||
tv = new TextView(getContext());
|
||||
tv.setLayoutParams(new LayoutParams(
|
||||
tv.setLayoutParams(new TableRow.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
@@ -352,7 +359,7 @@ public class TBAView extends ScrollView {
|
||||
|
||||
|
||||
tv = new TextView(getContext());
|
||||
tv.setLayoutParams(new LayoutParams(
|
||||
tv.setLayoutParams(new TableRow.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.astatin3.scoutingapp2025.ui.transfer;
|
||||
|
||||
import static androidx.navigation.fragment.FragmentKt.findNavController;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
@@ -14,10 +16,15 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.navigation.Navigation;
|
||||
|
||||
import com.astatin3.scoutingapp2025.R;
|
||||
import com.astatin3.scoutingapp2025.SettingsVersionStack.latestSettings;
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentTransferBinding;
|
||||
import com.astatin3.scoutingapp2025.types.file;
|
||||
import com.astatin3.scoutingapp2025.ui.transfer.bluetooth.BluetoothSenderFragment;
|
||||
import com.astatin3.scoutingapp2025.ui.transfer.codes.CodeGeneratorView;
|
||||
import com.astatin3.scoutingapp2025.ui.transfer.codes.CodeOverlayView;
|
||||
import com.astatin3.scoutingapp2025.utility.ByteBuilder;
|
||||
import com.astatin3.scoutingapp2025.utility.fileEditor;
|
||||
|
||||
@@ -50,15 +57,11 @@ public class TransferFragment extends Fragment {
|
||||
|
||||
|
||||
binding = FragmentTransferBinding.inflate(inflater, container, false);
|
||||
View root = binding.getRoot();
|
||||
|
||||
show_ui();
|
||||
|
||||
evcode = latestSettings.settings.get_evcode();
|
||||
|
||||
binding.downloadButton.setOnClickListener(v -> {
|
||||
start_download();
|
||||
submenu = true;
|
||||
});
|
||||
|
||||
binding.TBAButton.setOnClickListener(v -> {
|
||||
@@ -69,10 +72,7 @@ public class TransferFragment extends Fragment {
|
||||
alert.setCancelable(true);
|
||||
|
||||
alert.setPositiveButton("Ok", (dialog, which) -> {
|
||||
binding.mainSelectLayout.setVisibility(View.GONE);
|
||||
binding.TBAView.setVisibility(View.VISIBLE);
|
||||
binding.TBAView.start(binding, "2024");
|
||||
submenu = true;
|
||||
findNavController(this).navigate(R.id.action_navigation_transfer_to_navigation_tba);
|
||||
});
|
||||
|
||||
alert.setNegativeButton("Cancel", null);
|
||||
@@ -83,284 +83,61 @@ public class TransferFragment extends Fragment {
|
||||
binding.noEventError.setVisibility(View.VISIBLE);
|
||||
binding.uploadButton.setVisibility(View.GONE);
|
||||
binding.downloadButton.setVisibility(View.VISIBLE);
|
||||
return root;
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
binding.uploadButton.setOnClickListener(v -> {
|
||||
filePicker();
|
||||
submenu = true;
|
||||
start_upload();
|
||||
});
|
||||
|
||||
if(!latestSettings.settings.get_wifi_mode())
|
||||
binding.TBAButton.setVisibility(View.GONE);
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
public void show_ui(){
|
||||
binding.mainSelectLayout.setVisibility(View.VISIBLE);
|
||||
binding.noEventError.setVisibility(View.GONE);
|
||||
binding.loadSelectLayout.setVisibility(View.GONE);
|
||||
|
||||
binding.bluetoothSenderView.setVisibility(View.GONE);
|
||||
binding.bluetoothReceiverView.setVisibility(View.GONE);
|
||||
|
||||
binding.generatorLayout.setVisibility(View.GONE);
|
||||
binding.scannerLayout.setVisibility(View.GONE);
|
||||
|
||||
binding.fileSelectorLayout.setVisibility(View.GONE);
|
||||
binding.TBAView.setVisibility(View.GONE);
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void filePicker(){
|
||||
binding.mainSelectLayout.setVisibility(View.GONE);
|
||||
binding.fileSelectorLayout.setVisibility(View.VISIBLE);
|
||||
binding.fileSelectorTable.removeAllViews();
|
||||
binding.fileSelectorSearchbar.bringToFront();
|
||||
|
||||
meta_string_array = new String[]{
|
||||
"matches.fields",
|
||||
"pits.fields",
|
||||
evcode+".eventdata"
|
||||
};
|
||||
|
||||
String[] files = fileEditor.getEventFiles(evcode);
|
||||
|
||||
Boolean[] selected_arr = new Boolean[files.length];
|
||||
Arrays.fill(selected_arr, Boolean.TRUE);
|
||||
|
||||
for(int i = 0; i < files.length; i++){
|
||||
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);
|
||||
binding.fileSelectorTable.addView(tr);
|
||||
|
||||
tr.setBackgroundColor(background_color);
|
||||
|
||||
TextView tv = new TextView(getContext());
|
||||
tv.setText(String.valueOf(files[i]));
|
||||
tv.setTextSize(20);
|
||||
tr.addView(tv);
|
||||
|
||||
final int fi = i;
|
||||
tr.setOnClickListener(view -> {
|
||||
boolean sel = !selected_arr[fi];
|
||||
selected_arr[fi] = sel;
|
||||
|
||||
tr.setBackgroundColor(sel ? background_color : unselected_background_color);
|
||||
});
|
||||
}
|
||||
|
||||
binding.fileSelectorSearchbar.setOnKeyListener(new View.OnKeyListener() {
|
||||
@Override
|
||||
public boolean onKey(View view, int a, KeyEvent keyEvent) {
|
||||
|
||||
String search_param = binding.fileSelectorSearchbar.getText().toString();
|
||||
List<Integer> match_num_nums = get_matches_from_search_params(search_param);
|
||||
|
||||
Arrays.fill(selected_arr, Boolean.TRUE);
|
||||
|
||||
for(int i = 0; i < files.length; i++){
|
||||
View child = binding.fileSelectorTable.getChildAt(i);
|
||||
child.setBackgroundColor(background_color);
|
||||
child.setVisibility(is_in_search_param(files[i], search_param, match_num_nums) ? View.VISIBLE : View.GONE);
|
||||
private void start_upload() {
|
||||
FileSelectorFragment.setOnSelect(data -> {
|
||||
CodeGeneratorView.setData(data);
|
||||
BluetoothSenderFragment.set_data(data);
|
||||
TransferSelector.setOnSelect(new TransferSelector.onSelect() {
|
||||
@Override
|
||||
public void onSelectCodes(TransferSelector self) {
|
||||
findNavController(self).navigate(R.id.action_navigation_transfer_selector_to_navigation_code_generator);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
binding.fileSelectorButton.setText("Send");
|
||||
binding.fileSelectorButton.setOnClickListener(view -> {
|
||||
List<String> filenames = new ArrayList<>();
|
||||
for(int i = 0; i < files.length; i++){
|
||||
View child = binding.fileSelectorTable.getChildAt(i);
|
||||
if(child.getVisibility() == View.VISIBLE && selected_arr[i])
|
||||
filenames.add(files[i]);
|
||||
}
|
||||
start_upload(get_bytes_of_filenames(filenames));
|
||||
@Override
|
||||
public void onSelectBluetooth(TransferSelector self) {
|
||||
findNavController(self).navigate(R.id.action_navigation_transfer_selector_to_navigation_bluetooth_sender);
|
||||
}
|
||||
@Override
|
||||
public void onSelectWifi(TransferSelector self) {}
|
||||
});
|
||||
findNavController(this).navigate(R.id.action_navigation_file_selector_to_navigation_transfer_selector);
|
||||
});
|
||||
findNavController(this).navigate(R.id.action_navigation_transfer_to_navigation_file_selector);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static String[] meta_string_array;
|
||||
|
||||
private boolean is_in_search_param(String filename, String search_param, List<Integer> nums){
|
||||
return
|
||||
("meta".contains(search_param) && Arrays.asList(meta_string_array).contains(filename)) ||
|
||||
filename.contains(search_param) ||
|
||||
match_file_is_match_num(filename, nums);
|
||||
}
|
||||
|
||||
|
||||
private boolean match_file_is_match_num(String filename, List<Integer> nums){
|
||||
if(!filename.endsWith(".matchscoutdata")) return false;
|
||||
String[] dash_split = filename.split("-");
|
||||
if(dash_split.length != 5) return false;
|
||||
String s = dash_split[1];
|
||||
if(!is_int(s)) return false;
|
||||
int n = Integer.parseInt(s);
|
||||
return nums.contains(n);
|
||||
}
|
||||
|
||||
private List<Integer> get_matches_from_search_params(String search_param){
|
||||
List<Integer> nums = new ArrayList<>();
|
||||
String[] comma_split = search_param.split(",");
|
||||
|
||||
for(int i = 0; i < comma_split.length; i++){
|
||||
if(comma_split[i].contains("-")){
|
||||
|
||||
String[] dash_split = comma_split[i].split("-");
|
||||
if(dash_split.length != 2) continue;
|
||||
String stra = dash_split[0];
|
||||
String strb = dash_split[1];
|
||||
|
||||
if(!(is_int(stra) && is_int(strb))) continue;
|
||||
|
||||
int a = Integer.parseUnsignedInt(stra);
|
||||
int b = Integer.parseUnsignedInt(strb);
|
||||
|
||||
for(int x = a; x <= b; x++)
|
||||
nums.add(x);
|
||||
} else if(is_int(comma_split[i]))
|
||||
nums.add(Integer.parseUnsignedInt(comma_split[i]));
|
||||
}
|
||||
|
||||
return nums;
|
||||
}
|
||||
|
||||
private boolean is_int(String num){
|
||||
try {
|
||||
Integer.parseUnsignedInt(num);
|
||||
return true;
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static byte[] get_bytes_of_filenames(List<String> filenames){
|
||||
try {
|
||||
ByteBuilder b = new ByteBuilder();
|
||||
|
||||
for(int i = 0; i < filenames.size(); i++){
|
||||
file f = new file(filenames.get(i));
|
||||
b.addRaw(file.typecode, f.encode());
|
||||
}
|
||||
|
||||
return b.build();
|
||||
} catch (ByteBuilder.buildingException e){
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void start_upload(byte[] data){
|
||||
binding.mainSelectLayout.setVisibility(View.GONE);
|
||||
binding.fileSelectorLayout.setVisibility(View.GONE);
|
||||
binding.loadSelectLayout.setVisibility(View.VISIBLE);
|
||||
|
||||
binding.cameraButton.setOnClickListener(view -> {
|
||||
start_upload_codes(data);
|
||||
});
|
||||
|
||||
binding.bluetoothButton.setOnClickListener(view -> {
|
||||
start_upload_bluetooth(data);
|
||||
});
|
||||
}
|
||||
|
||||
private void start_download(){
|
||||
binding.mainSelectLayout.setVisibility(View.GONE);
|
||||
binding.fileSelectorLayout.setVisibility(View.GONE);
|
||||
binding.loadSelectLayout.setVisibility(View.VISIBLE);
|
||||
|
||||
binding.cameraButton.setOnClickListener(view -> {
|
||||
start_download_codes();
|
||||
});
|
||||
|
||||
binding.bluetoothButton.setOnClickListener(view -> {
|
||||
start_download_bluetooth();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void start_upload_codes(byte[] data){
|
||||
binding.loadSelectLayout.setVisibility(View.GONE);
|
||||
binding.generatorLayout.setVisibility(View.VISIBLE);
|
||||
binding.generatorLayout.start(binding, data);
|
||||
}
|
||||
|
||||
private void start_download_codes(){
|
||||
binding.loadSelectLayout.setVisibility(View.GONE);
|
||||
binding.scannerLayout.setVisibility(View.VISIBLE);
|
||||
binding.scannerLayout.start(binding, getViewLifecycleOwner());
|
||||
}
|
||||
|
||||
|
||||
private void start_upload_bluetooth(byte[] data){
|
||||
binding.loadSelectLayout.setVisibility(View.GONE);
|
||||
binding.bluetoothSenderView.setVisibility(View.VISIBLE);
|
||||
binding.bluetoothSenderView.init();
|
||||
binding.bluetoothSenderView.set_data(data);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void start_download_bluetooth(){
|
||||
binding.loadSelectLayout.setVisibility(View.GONE);
|
||||
binding.bluetoothReceiverView.setVisibility(View.VISIBLE);
|
||||
binding.bluetoothReceiverView.init();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if(getView() == null){
|
||||
return;
|
||||
}
|
||||
|
||||
getView().setFocusableInTouchMode(true);
|
||||
getView().requestFocus();
|
||||
getView().setOnKeyListener(new View.OnKeyListener() {
|
||||
TransferSelector.setOnSelect(new TransferSelector.onSelect() {
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
|
||||
if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK && submenu){
|
||||
// handle back button's click listener
|
||||
show_ui();
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
public void onSelectCodes(TransferSelector self) {
|
||||
findNavController(self).navigate(R.id.action_navigation_transfer_selector_to_navigation_code_scanner);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelectBluetooth(TransferSelector self) {
|
||||
findNavController(self).navigate(R.id.action_navigation_transfer_selector_to_navigation_bluetooth_receiver);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelectWifi(TransferSelector self) {}
|
||||
});
|
||||
findNavController(this).navigate(R.id.action_navigation_transfer_to_navigation_transfer_selector);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
binding.bluetoothSenderView.onDestroy();
|
||||
binding.bluetoothReceiverView.onDestroy();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.astatin3.scoutingapp2025.ui.transfer;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentTransferSelectorBinding;
|
||||
|
||||
public class TransferSelector extends Fragment {
|
||||
|
||||
// Declaring three blank funcs in one line lol
|
||||
private static onSelect onselect = new onSelect() {@Override public void onSelectCodes(TransferSelector self) {}@Override public void onSelectBluetooth(TransferSelector self) {} @Override public void onSelectWifi(TransferSelector self) {}};
|
||||
|
||||
public static void setOnSelect(onSelect tmp) {
|
||||
onselect = tmp;
|
||||
}
|
||||
|
||||
public interface onSelect {
|
||||
void onSelectCodes(TransferSelector self);
|
||||
void onSelectBluetooth(TransferSelector self);
|
||||
void onSelectWifi(TransferSelector self);
|
||||
}
|
||||
|
||||
FragmentTransferSelectorBinding binding;
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
binding = FragmentTransferSelectorBinding.inflate(inflater, container, false);
|
||||
|
||||
binding.codesButton.setOnClickListener(view -> {
|
||||
onselect.onSelectCodes(this);
|
||||
});
|
||||
|
||||
binding.bluetoothButton.setOnClickListener(view -> {
|
||||
onselect.onSelectBluetooth(this);
|
||||
});
|
||||
|
||||
binding.wifiButton.setOnClickListener(view -> {
|
||||
onselect.onSelectWifi(this);
|
||||
});
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
}
|
||||
+27
-34
@@ -1,44 +1,34 @@
|
||||
package com.astatin3.scoutingapp2025.ui.transfer.bluetooth;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.os.Looper;
|
||||
import android.util.AttributeSet;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.astatin3.scoutingapp2025.MainActivity;
|
||||
import com.astatin3.scoutingapp2025.R;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentTransferBluetoothReceiverBinding;
|
||||
import com.astatin3.scoutingapp2025.types.file;
|
||||
import com.astatin3.scoutingapp2025.utility.AlertManager;
|
||||
import com.astatin3.scoutingapp2025.utility.BuiltByteParser;
|
||||
import com.astatin3.scoutingapp2025.utility.fileEditor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.zip.DataFormatException;
|
||||
|
||||
public class BluetoothReceiverView extends LinearLayout {
|
||||
public class BluetoothReceiverFragment extends Fragment {
|
||||
private BluetoothReceiver bluetoothReceiver;
|
||||
private Button startListeningButton;
|
||||
private Button stopListeningButton;
|
||||
private TextView statusTextView;
|
||||
|
||||
public BluetoothReceiverView(Context context) {
|
||||
super(context);
|
||||
// init(context);
|
||||
}
|
||||
|
||||
public BluetoothReceiverView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
// init(context);
|
||||
}
|
||||
|
||||
// private void alert(String title, String content) {
|
||||
// AlertDialog.Builder dialog = new AlertDialog.Builder(getContext());
|
||||
@@ -51,8 +41,13 @@ public class BluetoothReceiverView extends LinearLayout {
|
||||
//
|
||||
// }
|
||||
|
||||
public void init() {
|
||||
LayoutInflater.from(getContext()).inflate(R.layout.view_bluetooth_receiver, this, true);
|
||||
FragmentTransferBluetoothReceiverBinding binding;
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
|
||||
binding = FragmentTransferBluetoothReceiverBinding.inflate(inflater, container, false);
|
||||
|
||||
|
||||
// bluetoothReceiver = new BluetoothReceiver(context);
|
||||
|
||||
@@ -68,32 +63,28 @@ public class BluetoothReceiverView extends LinearLayout {
|
||||
}
|
||||
});
|
||||
|
||||
startListeningButton = findViewById(R.id.startListeningButton);
|
||||
stopListeningButton = findViewById(R.id.stopListeningButton);
|
||||
statusTextView = findViewById(R.id.statusTextView);
|
||||
startListeningButton = binding.startListeningButton;
|
||||
stopListeningButton = binding.stopListeningButton;
|
||||
statusTextView = binding.statusTextView;
|
||||
|
||||
if (!bluetoothReceiver.isBluetoothSupported()) {
|
||||
AlertManager.error("Bluetooth is not supported on this device");
|
||||
return;
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
if (!bluetoothReceiver.isBluetoothEnabled()) {
|
||||
AlertManager.error("Please enable Bluetooth");
|
||||
}
|
||||
|
||||
startListeningButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startListening();
|
||||
}
|
||||
startListeningButton.setOnClickListener(v -> {
|
||||
startListening();
|
||||
});
|
||||
|
||||
stopListeningButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
stopListening();
|
||||
}
|
||||
stopListeningButton.setOnClickListener(v -> {
|
||||
stopListening();
|
||||
});
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
private void startListening() {
|
||||
@@ -162,6 +153,7 @@ public class BluetoothReceiverView extends LinearLayout {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (bluetoothReceiver != null)
|
||||
try {
|
||||
@@ -169,5 +161,6 @@ public class BluetoothReceiverView extends LinearLayout {
|
||||
} catch (IOException e) {
|
||||
AlertManager.error(e);
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
+22
-20
@@ -2,17 +2,20 @@ package com.astatin3.scoutingapp2025.ui.transfer.bluetooth;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.astatin3.scoutingapp2025.R;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentTransferBluetoothSenderBinding;
|
||||
import com.astatin3.scoutingapp2025.utility.AlertManager;
|
||||
import com.astatin3.scoutingapp2025.utility.fileEditor;
|
||||
|
||||
@@ -20,32 +23,28 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
|
||||
public class BluetoothSenderView extends LinearLayout {
|
||||
public class BluetoothSenderFragment extends Fragment {
|
||||
private BluetoothSender bluetoothSender;
|
||||
private ListView deviceListView;
|
||||
private Button sendFileButton;
|
||||
private ArrayAdapter<String> deviceArrayAdapter;
|
||||
private ArrayList<BluetoothDevice> deviceList;
|
||||
private byte[] data_to_send = new byte[0];
|
||||
|
||||
public BluetoothSenderView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
private FragmentTransferBluetoothSenderBinding binding;
|
||||
|
||||
public BluetoothSenderView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public void set_data(byte[] data){
|
||||
private static byte[] data_to_send = new byte[0];
|
||||
public static void set_data(byte[] data){
|
||||
data_to_send = data;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
LayoutInflater.from(getContext()).inflate(R.layout.view_bluetooth_sender, this, true);
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
|
||||
binding = FragmentTransferBluetoothSenderBinding.inflate(inflater, container, false);
|
||||
|
||||
bluetoothSender = new BluetoothSender(getContext());
|
||||
deviceListView = findViewById(R.id.deviceListView);
|
||||
sendFileButton = findViewById(R.id.sendFileButton);
|
||||
deviceListView = binding.deviceListView;
|
||||
sendFileButton = binding.sendFileButton;
|
||||
|
||||
deviceList = new ArrayList<>();
|
||||
deviceArrayAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1);
|
||||
@@ -53,7 +52,7 @@ public class BluetoothSenderView extends LinearLayout {
|
||||
|
||||
if (!bluetoothSender.isBluetoothSupported()) {
|
||||
AlertManager.toast("Bluetooth is not supported on this device");
|
||||
return;
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
if (!bluetoothSender.isBluetoothEnabled()) {
|
||||
@@ -83,6 +82,8 @@ public class BluetoothSenderView extends LinearLayout {
|
||||
sendData();
|
||||
}
|
||||
});
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
@@ -118,11 +119,12 @@ public class BluetoothSenderView extends LinearLayout {
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
if(bluetoothSender != null)
|
||||
if (bluetoothSender != null)
|
||||
try {
|
||||
bluetoothSender.close();
|
||||
} catch (IOException e) {
|
||||
AlertManager.error(e);
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
||||
+48
-34
@@ -1,18 +1,26 @@
|
||||
package com.astatin3.scoutingapp2025.ui.transfer.codes;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.SeekBar;
|
||||
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.databinding.FragmentDataCompileBinding;
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentTransferBinding;
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentTransferCodeSenderBinding;
|
||||
import com.astatin3.scoutingapp2025.utility.AlertManager;
|
||||
import com.astatin3.scoutingapp2025.utility.fileEditor;
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
@@ -27,8 +35,7 @@ import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
public class generatorView extends ConstraintLayout {
|
||||
private FragmentTransferBinding binding;
|
||||
public class CodeGeneratorView extends Fragment {
|
||||
private ImageView qrImage;
|
||||
private SeekBar qrSpeedSlider;
|
||||
private SeekBar qrSizeSlider;
|
||||
@@ -53,14 +60,48 @@ public class generatorView extends ConstraintLayout {
|
||||
|
||||
private ArrayList<Bitmap> qrBitmaps;
|
||||
|
||||
public generatorView(Context context) {
|
||||
super(context);
|
||||
private FragmentTransferCodeSenderBinding binding;
|
||||
|
||||
private static byte[] data;
|
||||
public static void setData(String data){
|
||||
setData(data.getBytes(StandardCharsets.ISO_8859_1));
|
||||
}
|
||||
public static void setData(byte[] tmpdata){
|
||||
data = tmpdata;
|
||||
}
|
||||
|
||||
public generatorView(Context context, AttributeSet attributeSet){
|
||||
super(context, attributeSet);
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
|
||||
binding = FragmentTransferCodeSenderBinding.inflate(inflater, container, false);
|
||||
|
||||
qrImage = binding.qrImage;
|
||||
qrSpeedSlider = binding.qrSpeedSlider;
|
||||
qrSizeSlider = binding.qrSizeSlider;
|
||||
qrIndexN = binding.qrIndexN;
|
||||
qrIndexD = binding.qrIndexD;
|
||||
|
||||
String compressed = new String(fileEditor.blockCompress(data), StandardCharsets.ISO_8859_1);
|
||||
|
||||
if(compressed.isEmpty()){
|
||||
AlertManager.alert("Error!", "Empty data!");
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
minQrSize = Math.round((float)compressed.length() / maxQrCount)+1;
|
||||
|
||||
qrSizeSlider.setMax(maxQrSize-minQrSize);
|
||||
qrSpeedSlider.setMax((minQrSpeed-maxQrSpeed)*2);
|
||||
|
||||
qrSizeSlider.setProgress(minQrSize+qrSize);
|
||||
qrSpeedSlider.setProgress(defaultQrDelay+5);
|
||||
|
||||
sendData(compressed);
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
|
||||
private Bitmap generateQrCode(String contents) throws WriterException {
|
||||
|
||||
final int size = 512;
|
||||
@@ -103,33 +144,6 @@ public class generatorView extends ConstraintLayout {
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
public void start(FragmentTransferBinding binding, String inputData){
|
||||
start(binding, inputData.getBytes(StandardCharsets.ISO_8859_1));
|
||||
}
|
||||
public void start(FragmentTransferBinding binding, byte[] inputData){
|
||||
qrImage = binding.qrImage;
|
||||
qrSpeedSlider = binding.qrSpeedSlider;
|
||||
qrSizeSlider = binding.qrSizeSlider;
|
||||
qrIndexN = binding.qrIndexN;
|
||||
qrIndexD = binding.qrIndexD;
|
||||
|
||||
String compressed = new String(fileEditor.blockCompress(inputData), StandardCharsets.ISO_8859_1);
|
||||
|
||||
if(compressed.isEmpty()){
|
||||
AlertManager.alert("Error!", "Empty data!");
|
||||
return;
|
||||
}
|
||||
|
||||
minQrSize = Math.round((float)compressed.length() / maxQrCount)+1;
|
||||
|
||||
qrSizeSlider.setMax(maxQrSize-minQrSize);
|
||||
qrSpeedSlider.setMax((minQrSpeed-maxQrSpeed)*2);
|
||||
|
||||
qrSizeSlider.setProgress(minQrSize+qrSize);
|
||||
qrSpeedSlider.setProgress(defaultQrDelay+5);
|
||||
|
||||
sendData(compressed);
|
||||
}
|
||||
|
||||
private void sendData(String data){
|
||||
|
||||
+4
-4
@@ -13,24 +13,24 @@ import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public class qrOverlayView extends View {
|
||||
public class CodeOverlayView extends View {
|
||||
|
||||
PointF[] points;
|
||||
int[] barColors;
|
||||
private Paint paint;
|
||||
private final int barHeight = 50;
|
||||
|
||||
public qrOverlayView(Context context) {
|
||||
public CodeOverlayView(Context context) {
|
||||
super(context);
|
||||
init();
|
||||
}
|
||||
|
||||
public qrOverlayView(Context context, AttributeSet attrs) {
|
||||
public CodeOverlayView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
init();
|
||||
}
|
||||
|
||||
public qrOverlayView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
public CodeOverlayView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
}
|
||||
+1
-2
@@ -3,7 +3,6 @@ package com.astatin3.scoutingapp2025.ui.transfer.codes;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import com.astatin3.scoutingapp2025.utility.AlertManager;
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.BinaryBitmap;
|
||||
import com.google.zxing.ChecksumException;
|
||||
@@ -21,7 +20,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class codeScanTask extends AsyncTask<String, String, String>{
|
||||
public class CodeScanTask extends AsyncTask<String, String, String>{
|
||||
private Function<String, String> resultFunction = null;
|
||||
private Bitmap image;
|
||||
|
||||
+37
-26
@@ -6,13 +6,18 @@ import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.media.Image;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Surface;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.SeekBar;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.OptIn;
|
||||
import androidx.camera.core.AspectRatio;
|
||||
import androidx.camera.core.CameraSelector;
|
||||
@@ -23,9 +28,11 @@ import androidx.camera.core.Preview;
|
||||
import androidx.camera.lifecycle.ProcessCameraProvider;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentTransferBinding;
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentTransferCodeReceiverBinding;
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentTransferCodeSenderBinding;
|
||||
import com.astatin3.scoutingapp2025.types.file;
|
||||
import com.astatin3.scoutingapp2025.utility.AlertManager;
|
||||
import com.astatin3.scoutingapp2025.utility.BuiltByteParser;
|
||||
@@ -35,18 +42,17 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.zip.DataFormatException;
|
||||
|
||||
//public class scannerView extends androidx.appcompat.widget.AppCompatImageView {
|
||||
public class scannerView extends ConstraintLayout {
|
||||
private qrOverlayView qrOverlayView;
|
||||
public class CodeScannerView extends Fragment {
|
||||
private CodeOverlayView CodeOverlayView;
|
||||
private Handler uiHandler;
|
||||
|
||||
|
||||
private void alert(String title, String content) {
|
||||
AlertDialog.Builder alert = new AlertDialog.Builder(getContext());
|
||||
alert.setMessage(content);
|
||||
@@ -56,22 +62,14 @@ public class scannerView extends ConstraintLayout {
|
||||
alert.create().show();
|
||||
}
|
||||
|
||||
public scannerView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public scannerView(Context context, AttributeSet attributeSet){
|
||||
super(context, attributeSet);
|
||||
}
|
||||
|
||||
private float scale = 0;
|
||||
private final int downscale = 1;
|
||||
private FragmentTransferBinding binding;
|
||||
private LifecycleOwner lifecycle;
|
||||
|
||||
private void setImage(Bitmap bmp){
|
||||
if(scale == 0) {
|
||||
scale = ((float) getWidth() / bmp.getWidth()) * ((float) 16 / 9);
|
||||
scale = ((float) binding.container.getWidth() / bmp.getWidth()) * ((float) 16 / 9);
|
||||
binding.scannerImage.setTranslationX(0);
|
||||
binding.scannerImage.setTranslationY(0);
|
||||
}
|
||||
@@ -115,7 +113,7 @@ public class scannerView extends ConstraintLayout {
|
||||
}
|
||||
public void scanQRCode(Bitmap bitmap) {
|
||||
|
||||
codeScanTask async = new codeScanTask();
|
||||
CodeScanTask async = new CodeScanTask();
|
||||
async.setImage(bitmap);
|
||||
async.onResult(data -> {
|
||||
if(data != null){
|
||||
@@ -136,12 +134,23 @@ public class scannerView extends ConstraintLayout {
|
||||
|
||||
// return contents;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private int numColors = 3;
|
||||
private int thresholdOffset = 128;
|
||||
private int brightness = 128;
|
||||
public void start(FragmentTransferBinding binding, LifecycleOwner lifecycle){
|
||||
this.binding = binding;
|
||||
this.lifecycle = lifecycle;
|
||||
|
||||
private FragmentTransferCodeReceiverBinding binding;
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
|
||||
binding = FragmentTransferCodeReceiverBinding.inflate(inflater, container, false);
|
||||
|
||||
this.lifecycle = getViewLifecycleOwner();
|
||||
|
||||
|
||||
|
||||
@@ -192,17 +201,17 @@ public class scannerView extends ConstraintLayout {
|
||||
|
||||
recalcMap();
|
||||
|
||||
qrOverlayView = new qrOverlayView(getContext());
|
||||
qrOverlayView.bringToFront();
|
||||
CodeOverlayView = new CodeOverlayView(getContext());
|
||||
CodeOverlayView.bringToFront();
|
||||
ConstraintLayout.LayoutParams pointsOverlayViewParams = new ConstraintLayout.LayoutParams(
|
||||
LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT
|
||||
ConstraintLayout.LayoutParams.MATCH_PARENT, ConstraintLayout.LayoutParams.MATCH_PARENT
|
||||
);
|
||||
|
||||
qrOverlayView.setLayoutParams(pointsOverlayViewParams);
|
||||
this.addView(qrOverlayView);
|
||||
CodeOverlayView.setLayoutParams(pointsOverlayViewParams);
|
||||
binding.container.addView(CodeOverlayView);
|
||||
|
||||
ListenableFuture<ProcessCameraProvider> cameraProviderFuture
|
||||
= ProcessCameraProvider.getInstance(this.getContext());
|
||||
= ProcessCameraProvider.getInstance(getContext());
|
||||
|
||||
cameraProviderFuture.addListener(() -> {
|
||||
try {
|
||||
@@ -212,7 +221,9 @@ public class scannerView extends ConstraintLayout {
|
||||
// No errors need to be handled for this Future.
|
||||
// This should never be reached.
|
||||
}
|
||||
}, ContextCompat.getMainExecutor(this.getContext()));
|
||||
}, ContextCompat.getMainExecutor(getContext()));
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
void bindPreview(@NonNull ProcessCameraProvider cameraProvider) {
|
||||
@@ -295,7 +306,7 @@ public class scannerView extends ConstraintLayout {
|
||||
|
||||
barColors[prevQrIndex] = 2;
|
||||
barColors[qrIndex] = 1;
|
||||
qrOverlayView.setBar(barColors);
|
||||
CodeOverlayView.setBar(barColors);
|
||||
|
||||
if(updated && qrScannedCount >= qrCount){
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.astatin3.scoutingapp2025.utility;
|
||||
|
||||
import com.astatin3.scoutingapp2025.SettingsVersionStack.latestSettings;
|
||||
import com.astatin3.scoutingapp2025.scoutingData.fields;
|
||||
import com.astatin3.scoutingapp2025.scoutingData.transfer.transferType;
|
||||
import com.astatin3.scoutingapp2025.types.frcEvent;
|
||||
import com.astatin3.scoutingapp2025.types.input.inputType;
|
||||
|
||||
public class DataManager {
|
||||
public static String evcode;
|
||||
public static frcEvent event;
|
||||
public static void reload_event(){
|
||||
evcode = getevcode(); event = frcEvent.decode(fileEditor.readFile(evcode + ".eventdata"));
|
||||
}
|
||||
|
||||
public static String getevcode() {
|
||||
return latestSettings.settings.get_evcode();
|
||||
}
|
||||
|
||||
public static inputType[][] match_values;
|
||||
public static inputType[] match_latest_values;
|
||||
public static transferType[][] match_transferValues;
|
||||
public static void reload_match_fields(){
|
||||
match_values = fields.load(fields.matchFieldsFilename);
|
||||
match_latest_values = match_values[match_values.length-1];
|
||||
match_transferValues = transferType.get_transfer_values(match_values);
|
||||
}
|
||||
|
||||
public static inputType[][] pit_values;
|
||||
public static inputType[] pit_latest_values;
|
||||
public static transferType[][] pit_transferValues;
|
||||
public static void reload_pit_fields(){
|
||||
pit_values = fields.load(fields.pitsFieldsFilename);
|
||||
pit_latest_values = pit_values[pit_values.length-1];
|
||||
pit_transferValues = transferType.get_transfer_values(pit_values);
|
||||
}
|
||||
}
|
||||
+2
-4
@@ -1,15 +1,13 @@
|
||||
package com.astatin3.scoutingapp2025.ui.data;
|
||||
package com.astatin3.scoutingapp2025.utility;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.astatin3.scoutingapp2025.utility.AlertManager;
|
||||
|
||||
import org.tensorflow.lite.support.label.Category;
|
||||
import org.tensorflow.lite.task.text.nlclassifier.NLClassifier;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class sentimentAnalysis {
|
||||
public class SentimentAnalysis {
|
||||
private static NLClassifier textClassifier;
|
||||
|
||||
public static void init(Context context){
|
||||
@@ -6,30 +6,31 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_host_fragment_activity_main"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="60dp"
|
||||
app:defaultNavHost="true"
|
||||
app:layout_constraintBottom_toTopOf="@id/nav_view"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.435"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.842"
|
||||
app:navGraph="@navigation/mobile_navigation">
|
||||
|
||||
</fragment>
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/nav_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:background="?android:attr/windowBackground"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:menu="@menu/bottom_nav_menu" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_host_fragment_activity_main"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:defaultNavHost="true"
|
||||
app:layout_constraintBottom_toTopOf="@id/nav_view"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:navGraph="@navigation/mobile_navigation">
|
||||
|
||||
</fragment>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -5,6 +5,17 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
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:textAlignment="center"
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/buttons"
|
||||
@@ -14,8 +25,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="gone">
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/status_button"
|
||||
@@ -64,167 +74,4 @@
|
||||
app:layout_constraintVertical_bias="0.689" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
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:textAlignment="center"
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.astatin3.scoutingapp2025.ui.data.statusView
|
||||
android:id="@+id/statusView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/matchTable"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
</com.astatin3.scoutingapp2025.ui.data.statusView>
|
||||
|
||||
<com.astatin3.scoutingapp2025.ui.data.teamsView
|
||||
android:id="@+id/teamsView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/teamsArea"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<!-- <TableLayout-->
|
||||
<!-- android:id="@+id/searchTable"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content" />-->
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
</com.astatin3.scoutingapp2025.ui.data.teamsView>
|
||||
|
||||
<com.astatin3.scoutingapp2025.ui.data.fieldsView
|
||||
android:id="@+id/fieldsView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="60dp"
|
||||
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="visible">
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="+"
|
||||
android:textSize="48sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/fields_select_buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="48dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/matchScoutingButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Matches"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintBottom_toTopOf="@id/pitScoutingButton"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/pitScoutingButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Pits"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/matchScoutingButton" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.astatin3.scoutingapp2025.utility.ReorderableTableLayout
|
||||
android:id="@+id/fieldsArea"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</com.astatin3.scoutingapp2025.utility.ReorderableTableLayout>
|
||||
|
||||
<!-- <TableLayout-->
|
||||
<!-- android:id="@+id/searchTable"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content" />-->
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</com.astatin3.scoutingapp2025.ui.data.fieldsView>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TBD"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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">
|
||||
|
||||
<Button
|
||||
android:id="@+id/add_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="+"
|
||||
android:textSize="48sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.astatin3.scoutingapp2025.utility.ReorderableTableLayout
|
||||
android:id="@+id/fieldsArea"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</com.astatin3.scoutingapp2025.utility.ReorderableTableLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?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">
|
||||
|
||||
<Button
|
||||
android:id="@+id/matchScoutingButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Matches"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintBottom_toTopOf="@id/pitScoutingButton"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/pitScoutingButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Pits"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/matchScoutingButton" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/matchTable"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?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">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/teamsArea"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -13,15 +13,6 @@
|
||||
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"
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
android:id="@+id/main_select_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -65,311 +63,5 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/load_select_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
tools:visibility="gone">
|
||||
|
||||
<Button
|
||||
android:id="@+id/cameraButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Camera"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bluetoothButton"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bluetoothButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Bluetooth"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/wifiButton"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cameraButton" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/wifiButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TODO"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bluetoothButton" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/file_selector_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<Button
|
||||
android:id="@+id/file_selector_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:height="48dp"
|
||||
android:text="Send"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/file_selector_searchbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:background="#D33D3D3D"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:textColor="#FFFFFF"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="53dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/file_selector_searchbar">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/file_selector_table"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="48dp" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.astatin3.scoutingapp2025.ui.transfer.bluetooth.BluetoothSenderView
|
||||
android:id="@+id/bluetoothSenderView"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="53dp"/>
|
||||
|
||||
|
||||
<com.astatin3.scoutingapp2025.ui.transfer.bluetooth.BluetoothReceiverView
|
||||
android:id="@+id/bluetoothReceiverView"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="53dp"/>
|
||||
|
||||
<com.astatin3.scoutingapp2025.ui.transfer.codes.generatorView
|
||||
android:id="@+id/generatorLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
tools:visibility="gone">
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/qrSizeSlider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/qrSpeedSlider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/qrSizeSlider"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.971"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage"
|
||||
app:layout_constraintVertical_bias="0.93" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/qrImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:padding="15dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qrSpeedText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="QR Speed"
|
||||
app:layout_constraintBottom_toTopOf="@+id/qrSpeedSlider"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qrSizeText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="QR Size"
|
||||
app:layout_constraintBottom_toTopOf="@+id/qrSizeSlider"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qrIndexN"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
app:layout_constraintEnd_toStartOf="@+id/qrIndexSlash"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qrIndexSlash"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="/"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qrIndexD"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
app:layout_constraintStart_toEndOf="@+id/qrIndexSlash"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage" />
|
||||
|
||||
</com.astatin3.scoutingapp2025.ui.transfer.codes.generatorView>
|
||||
|
||||
|
||||
<com.astatin3.scoutingapp2025.ui.transfer.codes.scannerView
|
||||
android:id="@+id/scannerLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="parent"
|
||||
tools:layout_editor_absoluteX="-62dp"
|
||||
tools:visibility="gone">
|
||||
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/scannerColors"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="15dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/scannerThreshold"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/scannerColors" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/scannerBrightness"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/scannerThreshold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/scannerColorsLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="-12dp"
|
||||
android:text="Posterize"
|
||||
app:layout_constraintBottom_toTopOf="@+id/scannerColors"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/scannerThresholdLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="-12dp"
|
||||
android:text="Exposure"
|
||||
app:layout_constraintBottom_toTopOf="@+id/scannerThreshold"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/scannerBrightnessLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="-12dp"
|
||||
android:text="Brightness"
|
||||
app:layout_constraintBottom_toTopOf="@+id/scannerBrightness"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/scannerImage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:rotation="90"
|
||||
android:scaleType="fitCenter"
|
||||
android:scaleX="1"
|
||||
android:scaleY="1"
|
||||
android:translationY="-40dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:context=".TransferFragment" />
|
||||
|
||||
|
||||
</com.astatin3.scoutingapp2025.ui.transfer.codes.scannerView>
|
||||
|
||||
<com.astatin3.scoutingapp2025.ui.transfer.TBAView
|
||||
android:id="@+id/TBAView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:fillViewport="true"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/matchTable"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
</com.astatin3.scoutingapp2025.ui.transfer.TBAView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/scannerColors"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="15dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/scannerThreshold"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/scannerColors" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/scannerBrightness"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/scannerThreshold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/scannerColorsLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="-12dp"
|
||||
android:text="Posterize"
|
||||
app:layout_constraintBottom_toTopOf="@+id/scannerColors"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/scannerThresholdLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="-12dp"
|
||||
android:text="Exposure"
|
||||
app:layout_constraintBottom_toTopOf="@+id/scannerThreshold"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/scannerBrightnessLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="-12dp"
|
||||
android:text="Brightness"
|
||||
app:layout_constraintBottom_toTopOf="@+id/scannerBrightness"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/scannerImage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:rotation="90"
|
||||
android:scaleType="fitCenter"
|
||||
android:scaleX="1"
|
||||
android:scaleY="1"
|
||||
android:translationY="-40dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:context=".CodeScannerView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?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">
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/qrSizeSlider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/qrSpeedSlider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/qrSizeSlider"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.971"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage"
|
||||
app:layout_constraintVertical_bias="0.93" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/qrImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:padding="15dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qrSpeedText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="QR Speed"
|
||||
app:layout_constraintBottom_toTopOf="@+id/qrSpeedSlider"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qrSizeText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="QR Size"
|
||||
app:layout_constraintBottom_toTopOf="@+id/qrSizeSlider"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qrIndexN"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
app:layout_constraintEnd_toStartOf="@+id/qrIndexSlash"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qrIndexSlash"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="/"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qrIndexD"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
app:layout_constraintStart_toEndOf="@+id/qrIndexSlash"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qrImage" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?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">
|
||||
|
||||
<Button
|
||||
android:id="@+id/file_selector_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:height="48dp"
|
||||
android:text="Send"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/file_selector_searchbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:background="#D33D3D3D"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:textColor="#FFFFFF"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="53dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/file_selector_searchbar">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/file_selector_table"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="48dp" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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">
|
||||
|
||||
<Button
|
||||
android:id="@+id/codes_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Codes"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bluetoothButton"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bluetoothButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Bluetooth"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/wifiButton"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/codes_button" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/wifiButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TODO"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bluetoothButton" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="MissingConstraints">
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/matchTable"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_scouting"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.scouting.scoutingFragment"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.scouting.ScoutingFragment"
|
||||
android:label="@string/title_scouting"
|
||||
tools:layout="@layout/fragment_scouting">
|
||||
<action
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_match_scouting"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.scouting.matchScoutDataEnterFragment"
|
||||
tools:layout="@layout/fragment_match_scout_data_enter">
|
||||
android:name="com.astatin3.scoutingapp2025.ui.scouting.MatchScoutingFragment"
|
||||
tools:layout="@layout/fragment_match_scouting">
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
@@ -31,13 +31,15 @@
|
||||
<action
|
||||
android:id="@+id/action_navigation_team_selector_to_navigation_pit_scouting"
|
||||
app:destination="@id/navigation_pit_scouting" />
|
||||
<action
|
||||
android:id="@+id/action_navigation_team_selector_to_navigation_data_teams"
|
||||
app:destination="@id/navigation_data_teams" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_pit_scouting"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.scouting.pitScoutingFragment"
|
||||
tools:layout="@layout/fragment_pit_scouting">
|
||||
</fragment>
|
||||
android:name="com.astatin3.scoutingapp2025.ui.scouting.PitScoutingFragment"
|
||||
tools:layout="@layout/fragment_pit_scouting"/>
|
||||
|
||||
|
||||
|
||||
@@ -49,8 +51,129 @@
|
||||
android:name="com.astatin3.scoutingapp2025.ui.data.dataFragment"
|
||||
android:label="@string/title_data"
|
||||
tools:layout="@layout/fragment_data">
|
||||
<action
|
||||
android:id="@+id/action_navigation_data_to_navigation_data_status"
|
||||
app:destination="@id/navigation_data_status" />
|
||||
<action
|
||||
android:id="@+id/action_navigation_data_to_navigation_team_selector"
|
||||
app:destination="@id/navigation_team_selector" />
|
||||
<action
|
||||
android:id="@+id/action_navigation_data_to_navigation_data_compile"
|
||||
app:destination="@id/navigation_data_compile" />
|
||||
<action
|
||||
android:id="@+id/action_navigation_data_to_navigation_data_fields_chooser"
|
||||
app:destination="@id/navigation_data_fields_chooser" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_data_status"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.data.StatusFragment"
|
||||
tools:layout="@layout/fragment_data_status">
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_data_teams"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.data.TeamsFragment"
|
||||
tools:layout="@layout/fragment_data_teams">
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_data_compile"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.data.CompileFragment"
|
||||
tools:layout="@layout/fragment_data_compile">
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_data_fields_chooser"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.data.FieldsChooserFragment"
|
||||
tools:layout="@layout/fragment_data_fields_chooser">
|
||||
<action
|
||||
android:id="@+id/action_navigation_data_fields_chooser_to_navigation_data_fields"
|
||||
app:destination="@id/navigation_data_fields" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_data_fields"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.data.FieldsFragment"
|
||||
tools:layout="@layout/fragment_data_fields">
|
||||
</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">
|
||||
<action
|
||||
android:id="@+id/action_navigation_transfer_to_navigation_tba"
|
||||
app:destination="@id/navigation_tba" />
|
||||
<action
|
||||
android:id="@+id/action_navigation_transfer_to_navigation_file_selector"
|
||||
app:destination="@id/navigation_file_selector" />
|
||||
<action
|
||||
android:id="@+id/action_navigation_transfer_to_navigation_transfer_selector"
|
||||
app:destination="@id/navigation_transfer_selector" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_file_selector"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.transfer.FileSelectorFragment"
|
||||
tools:layout="@layout/fragment_transfer_file_selector">
|
||||
<action
|
||||
android:id="@+id/action_navigation_file_selector_to_navigation_transfer_selector"
|
||||
app:destination="@id/navigation_transfer_selector" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_transfer_selector"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.transfer.TransferSelector"
|
||||
tools:layout="@layout/fragment_transfer_selector">
|
||||
<action
|
||||
android:id="@+id/action_navigation_transfer_selector_to_navigation_code_generator"
|
||||
app:destination="@id/navigation_code_generator" />
|
||||
<action
|
||||
android:id="@+id/action_navigation_transfer_selector_to_navigation_bluetooth_sender"
|
||||
app:destination="@id/navigation_bluetooth_sender" />
|
||||
<action
|
||||
android:id="@+id/action_navigation_transfer_selector_to_navigation_code_scanner"
|
||||
app:destination="@id/navigation_code_scanner" />
|
||||
<action
|
||||
android:id="@+id/action_navigation_transfer_selector_to_navigation_bluetooth_receiver"
|
||||
app:destination="@id/navigation_bluetooth_receiver" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_code_generator"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.transfer.codes.CodeGeneratorView"
|
||||
tools:layout="@layout/fragment_transfer_code_sender">
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_code_scanner"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.transfer.codes.CodeScannerView"
|
||||
tools:layout="@layout/fragment_transfer_code_receiver">
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_bluetooth_sender"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.transfer.bluetooth.BluetoothSenderFragment"
|
||||
tools:layout="@layout/fragment_transfer_bluetooth_sender">
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_bluetooth_receiver"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.transfer.bluetooth.BluetoothReceiverFragment"
|
||||
tools:layout="@layout/fragment_transfer_bluetooth_receiver">
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_tba"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.transfer.TBAView"
|
||||
tools:layout="@layout/fragment_transfer_tba">
|
||||
</fragment>
|
||||
|
||||
|
||||
|
||||
@@ -64,17 +187,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_transfer"
|
||||
android:name="com.astatin3.scoutingapp2025.ui.transfer.TransferFragment"
|
||||
android:label="@string/title_transfer"
|
||||
tools:layout="@layout/fragment_transfer">
|
||||
</fragment>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</navigation>
|
||||
Reference in New Issue
Block a user