mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-09 00:37:59 -06:00
Start work on fields editor
This commit is contained in:
@@ -6,6 +6,7 @@ TODO:
|
||||
- Make a word cloud for the compiled mode of notes input type
|
||||
- Make pit and match data field builder UIs. I don't want to have to keep editing a variable
|
||||
- Add "history" view type to the teams view menu.
|
||||
- Add CSV exporting
|
||||
|
||||
- Make the "Compile" menu
|
||||
- The compile menu should be a shortcut to view all the team's stats from the upcoming match, from the teams view
|
||||
@@ -17,4 +18,5 @@ TODO:
|
||||
- Make practice mode
|
||||
- AI overview of scouting data for a team???
|
||||
- Bluetooth data sync
|
||||
- Statbotics intigration
|
||||
- Test the scouting app
|
||||
@@ -37,7 +37,14 @@ public class dataFragment extends Fragment {
|
||||
|
||||
if(evcode.equals("unset")){
|
||||
binding.noEventError.setVisibility(View.VISIBLE);
|
||||
binding.buttons.setVisibility(View.GONE);
|
||||
|
||||
binding.buttons.setVisibility(View.VISIBLE);
|
||||
binding.statusButton.setVisibility(View.GONE);
|
||||
binding.teamsButton.setVisibility(View.GONE);
|
||||
binding.compileButton.setVisibility(View.GONE);
|
||||
binding.fieldsButton.setVisibility(View.VISIBLE);
|
||||
|
||||
|
||||
binding.matchTable.setVisibility(View.GONE);
|
||||
return root;
|
||||
}
|
||||
@@ -58,6 +65,22 @@ public class dataFragment extends Fragment {
|
||||
submenu = true;
|
||||
});
|
||||
|
||||
|
||||
|
||||
binding.compileButton.setOnClickListener(v -> {
|
||||
// binding.buttons.setVisibility(View.GONE);
|
||||
// binding.teamsView.setVisibility(View.VISIBLE);
|
||||
// binding.teamsView.init(binding, event);
|
||||
// submenu = true;
|
||||
});
|
||||
|
||||
binding.fieldsButton.setOnClickListener(v -> {
|
||||
binding.buttons.setVisibility(View.GONE);
|
||||
binding.fieldsView.setVisibility(View.VISIBLE);
|
||||
binding.fieldsView.init(binding);
|
||||
submenu = true;
|
||||
});
|
||||
|
||||
show_ui();
|
||||
|
||||
return root;
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.astatin3.scoutingapp2025.ui.data;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.TableRow;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.astatin3.scoutingapp2025.SettingsVersionStack.latestSettings;
|
||||
import com.astatin3.scoutingapp2025.databinding.FragmentDataBinding;
|
||||
import com.astatin3.scoutingapp2025.scoutingData.fields;
|
||||
import com.astatin3.scoutingapp2025.scoutingData.transfer.transferType;
|
||||
import com.astatin3.scoutingapp2025.types.frcEvent;
|
||||
import com.astatin3.scoutingapp2025.types.frcTeam;
|
||||
import com.astatin3.scoutingapp2025.types.input.inputType;
|
||||
|
||||
public class fieldsView extends ConstraintLayout {
|
||||
public fieldsView(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
public fieldsView(Context context, AttributeSet attributeSet){
|
||||
super(context, attributeSet);
|
||||
}
|
||||
FragmentDataBinding binding;
|
||||
String filename;
|
||||
|
||||
inputType[][] values;
|
||||
|
||||
public void init(FragmentDataBinding binding) {
|
||||
this.binding = binding;
|
||||
|
||||
binding.fieldsSelectButtons.setVisibility(VISIBLE);
|
||||
binding.fieldsSelectButtons.bringToFront();
|
||||
|
||||
binding.fieldsArea.setStretchAllColumns(true);
|
||||
|
||||
binding.matchScoutingButton.setOnClickListener(v -> {
|
||||
binding.fieldsSelectButtons.setVisibility(GONE);
|
||||
filename = fields.matchFieldsFilename;
|
||||
load_fields();
|
||||
});
|
||||
|
||||
binding.pitScoutingButton.setOnClickListener(v -> {
|
||||
binding.fieldsSelectButtons.setVisibility(GONE);
|
||||
filename = fields.pitsFieldsFilename;
|
||||
load_fields();
|
||||
});
|
||||
}
|
||||
|
||||
private void load_fields() {
|
||||
values = fields.load(filename);
|
||||
|
||||
for(int i = 0; i < values.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.fieldsArea.addView(tr);
|
||||
|
||||
tr.setBackgroundColor(0x1000ff00);
|
||||
|
||||
TextView tv = new TextView(getContext());
|
||||
tv.setText("v" + i);
|
||||
tv.setTextSize(20);
|
||||
tr.addView(tv);
|
||||
|
||||
tv = new TextView(getContext());
|
||||
tv.setText(values[i].length + " Fields");
|
||||
tv.setTextSize(16);
|
||||
tr.addView(tv);
|
||||
|
||||
// frcTeam finalTeam = team;
|
||||
tr.setOnClickListener(v -> {
|
||||
// loadTeam(finalTeam, latestSettings.settings.get_compiled_mode());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,10 +34,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="teams"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@id/status_button"
|
||||
app:layout_constraintBottom_toTopOf="@id/compileButton" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/compileButton"
|
||||
@@ -45,10 +45,21 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Compile"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/fieldsButton"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/teamsButton" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/fieldsButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Fields"
|
||||
android:textSize="34sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/teamsButton"
|
||||
app:layout_constraintTop_toBottomOf="@+id/compileButton"
|
||||
app:layout_constraintVertical_bias="0.689" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -126,4 +137,81 @@
|
||||
</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="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="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: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">
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/fieldsArea"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</TableLayout>
|
||||
|
||||
<!-- <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>
|
||||
Reference in New Issue
Block a user