Add background, fix a crash

This commit is contained in:
Michael Mikovsky
2025-01-24 14:12:17 -07:00
parent 19e377fd9e
commit 8381d21eff
10 changed files with 34 additions and 8 deletions
@@ -72,7 +72,7 @@ public class FieldPosView extends FrameLayout {
return false;
});
setImageResource(R.drawable.field_2024);
setImageResource(R.drawable.field_2025);
}
@@ -52,7 +52,7 @@ public class MultiFieldPosView extends FrameLayout {
imageView.setAdjustViewBounds(true);
addView(imageView);
setImageResource(R.drawable.field_2024);
setImageResource(R.drawable.field_2025);
}
@@ -16,6 +16,7 @@ import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.ridgebotics.ridgescout.R;
import com.ridgebotics.ridgescout.utility.AlertManager;
import com.ridgebotics.ridgescout.utility.settingsManager;
import com.ridgebotics.ridgescout.databinding.FragmentScoutingBinding;
import com.ridgebotics.ridgescout.types.frcTeam;
@@ -36,7 +37,9 @@ public class ScoutingFragment extends Fragment {
String evcode = settingsManager.getEVCode();
if(evcode.equals("unset")){
DataManager.reload_event();
if(event == null){
binding.noEventError.setVisibility(View.VISIBLE);
binding.matchScoutingButton.setEnabled(false);
binding.pitScoutingButton.setEnabled(false);
@@ -45,11 +48,6 @@ public class ScoutingFragment extends Fragment {
return binding.getRoot();
}
DataManager.reload_event();
if(event.matches.isEmpty())
binding.matchScoutingButton.setVisibility(View.GONE);
binding.matchScoutingButton.setOnClickListener(v -> {
findNavController(this).navigate(R.id.action_navigation_scouting_to_navigation_match_scouting);
});
@@ -143,6 +143,8 @@ public class FTPSync extends Thread {
for (String remoteFile : remoteTimestamps.keySet()) {
File localFile = new File(baseDir, remoteFile);
if(remoteFile.equals(timestampsFilename)) continue;
// Remove meta files if the option is disabled
if(!sendMetaFiles && meta_string_array.contains(remoteFile)) continue;
// Date t1 = getLocalFileUtcTimestamp(localFile);
// Date t2 = getUtcTimestamp(remoteFile);
@@ -58,6 +58,10 @@ public class TBAFragment extends Fragment {
final RequestTask rq = new RequestTask();
rq.onResult(s -> {
if(s == null || s.isEmpty()) {
AlertManager.error("Could not fetch event!");
return null;
}
eventTable(s);
return null;
});
@@ -10,7 +10,16 @@ public class DataManager {
public static frcEvent event;
public static void reload_event(){
evcode = getevcode();
if(evcode.equals("unset")) return;
event = frcEvent.decode(fileEditor.readFile(evcode + ".eventdata"));
if(event == null) {
AlertManager.error("Failed to load event!");
settingsManager.setEVCode("unset");
evcode = "unset";
}
}
public static String getevcode() {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 921 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

+13
View File
@@ -6,6 +6,19 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:rotation="0"
android:rotationX="0"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/field_2025_background" />
<fragment
android:id="@+id/nav_host_fragment_activity_main"
android:name="androidx.navigation.fragment.NavHostFragment"