mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-08 16:28:00 -06:00
Finish back button. Some other random stuff.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
Ridgebotics 2025 scouting app in Android
|
||||
|
||||
TODO:
|
||||
- Handle saving team list data from TBA without matches. For the practice day.
|
||||
- Allow the option to save event data without matches, and handle only having matches. This is where practice mode should be selected.
|
||||
- Make the file browser UI
|
||||
- Add white border around the datamatrix code to allow file transfer in dark mode
|
||||
- Fix the code scanning progress indicator
|
||||
|
||||
@@ -23,6 +23,8 @@ public class dataFragment extends Fragment {
|
||||
|
||||
private FragmentDataBinding binding;
|
||||
|
||||
private boolean submenu = false;
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
|
||||
@@ -40,19 +42,22 @@ public class dataFragment extends Fragment {
|
||||
|
||||
frcEvent event = frcEvent.decode(fileEditor.readFile(evcode + ".eventdata"));
|
||||
|
||||
// for(frcTeam team : event.teams){
|
||||
// System.out.println(team.getDescription());
|
||||
// }
|
||||
|
||||
binding.overviewButton.setOnClickListener(v -> {
|
||||
binding.buttons.setVisibility(View.GONE);
|
||||
binding.overviewView.setVisibility(View.VISIBLE);
|
||||
binding.overviewView.start(binding, event);
|
||||
submenu = true;
|
||||
});
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
public void show_ui(){
|
||||
binding.buttons.setVisibility(View.VISIBLE);
|
||||
binding.overviewView.setVisibility(View.GONE);
|
||||
submenu = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
@@ -67,10 +72,10 @@ public class dataFragment extends Fragment {
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
|
||||
if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK){
|
||||
if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK && submenu){
|
||||
// handle back button's click listener
|
||||
|
||||
System.out.println("Back");
|
||||
show_ui();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.astatin3.scoutingapp2025.ui.scouting;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
public class ScoutingDataView extends ConstraintLayout {
|
||||
public ScoutingDataView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
public ScoutingDataView(Context context, AttributeSet attributeSet){
|
||||
super(context, attributeSet);
|
||||
}
|
||||
|
||||
public void load(String fieldsFilename){
|
||||
|
||||
}
|
||||
}
|
||||
@@ -76,6 +76,19 @@ public class matchScoutingView extends ConstraintLayout {
|
||||
}
|
||||
|
||||
|
||||
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){
|
||||
@@ -89,6 +102,13 @@ public class matchScoutingView extends ConstraintLayout {
|
||||
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){
|
||||
|
||||
@@ -136,6 +136,8 @@ public class pitScoutingView extends ConstraintLayout {
|
||||
binding.pitTeamName.setVisibility(View.GONE);
|
||||
binding.pitTeamDescription.setVisibility(View.GONE);
|
||||
|
||||
clear_fields();
|
||||
|
||||
|
||||
int[] teamNums = new int[event.teams.size()];
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user