Mostly random stuff

This commit is contained in:
Astatin3
2024-07-04 20:55:29 -06:00
parent 0313f43207
commit 8ec5b1f791
5 changed files with 35 additions and 29 deletions
@@ -87,11 +87,11 @@ public class sliderType extends inputType {
Slider slider = new Slider(parent.getContext());
float slider_position = (float) ((int) data.get()-min) / (max-min);
float step_size = (float) 1/max;
float step_size = (float) 1/(max-min);
int round_position = Math.round(slider_position / step_size);
slider.setValue(round_position*step_size);
slider.setStepSize((float) 1 / max);
slider.setStepSize((float) 1 / (max-min));
slider.setEnabled(false);
parent.addView(slider);
}
@@ -33,6 +33,8 @@ public class dataFragment extends Fragment {
String evcode = latestSettings.settings.get_evcode();
if(evcode.equals("unset")){
binding.noEventError.setVisibility(View.VISIBLE);
binding.buttons.setVisibility(View.GONE);
@@ -42,17 +44,17 @@ public class dataFragment extends Fragment {
frcEvent event = frcEvent.decode(fileEditor.readFile(evcode + ".eventdata"));
binding.overviewView.setOnClickListener(v -> {
binding.statusButton.setOnClickListener(v -> {
binding.buttons.setVisibility(View.GONE);
binding.overviewView.setVisibility(View.VISIBLE);
binding.overviewView.start(binding, event);
binding.statusView.setVisibility(View.VISIBLE);
binding.statusView.start(binding, event);
submenu = true;
});
binding.searchButton.setOnClickListener(v -> {
binding.teamsButton.setOnClickListener(v -> {
binding.buttons.setVisibility(View.GONE);
binding.searchView.setVisibility(View.VISIBLE);
binding.searchView.init(binding, event);
binding.teamsView.setVisibility(View.VISIBLE);
binding.teamsView.init(binding, event);
submenu = true;
});
@@ -63,8 +65,8 @@ public class dataFragment extends Fragment {
public void show_ui(){
binding.buttons.setVisibility(View.VISIBLE);
binding.overviewView.setVisibility(View.GONE);
binding.searchView.setVisibility(View.GONE);
binding.statusView.setVisibility(View.GONE);
binding.teamsView.setVisibility(View.GONE);
submenu = false;
}
@@ -61,11 +61,11 @@ public class teamsView extends ConstraintLayout {
pit_transferValues = transferType.get_transfer_values(pit_values);
binding.searchArea.removeAllViews();
binding.teamsArea.removeAllViews();
TableLayout table = new TableLayout(getContext());
table.setStretchAllColumns(true);
binding.searchArea.addView(table);
binding.teamsArea.addView(table);
// binding.searchTable.addView(table);
@@ -116,7 +116,7 @@ public class teamsView extends ConstraintLayout {
}
public void loadTeam(frcTeam team, boolean compiled_mode) {
binding.searchArea.removeAllViews();
binding.teamsArea.removeAllViews();
LinearLayout ll = new LinearLayout(getContext());
ll.setLayoutParams(new LinearLayout.LayoutParams(
@@ -124,7 +124,7 @@ public class teamsView extends ConstraintLayout {
ViewGroup.LayoutParams.WRAP_CONTENT
));
ll.setOrientation(LinearLayout.VERTICAL);
binding.searchArea.addView(ll);
binding.teamsArea.addView(ll);
CheckBox cb = new CheckBox(getContext());
cb.setLayoutParams(new FrameLayout.LayoutParams(
+14 -12
View File
@@ -20,19 +20,19 @@
android:id="@+id/status_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Overview"
android:text="status"
android:textSize="34sp"
app:layout_constraintBottom_toTopOf="@+id/searchButton"
app:layout_constraintBottom_toTopOf="@+id/teamsButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.307" />
<Button
android:id="@+id/searchButton"
android:id="@+id/teamsButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Search"
android:text="teams"
android:textSize="34sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@@ -48,7 +48,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/searchButton"
app:layout_constraintTop_toBottomOf="@+id/teamsButton"
app:layout_constraintVertical_bias="0.689" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -66,10 +66,11 @@
app:layout_constraintTop_toTopOf="parent" />
<com.astatin3.scoutingapp2025.ui.data.statusView
android:id="@+id/overviewView"
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"
@@ -92,10 +93,11 @@
</com.astatin3.scoutingapp2025.ui.data.statusView>
<com.astatin3.scoutingapp2025.ui.data.teamsView
android:id="@+id/searchView"
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"
@@ -110,14 +112,14 @@
app:layout_constraintTop_toTopOf="parent">
<ScrollView
android:id="@+id/searchArea"
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" />-->
<!-- <TableLayout-->
<!-- android:id="@+id/searchTable"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content" />-->
</ScrollView>