From a6356adfa724bd96da6acfa7bba949a4296c7a75 Mon Sep 17 00:00:00 2001 From: Phil Lopreiato Date: Sun, 24 Feb 2019 16:07:54 -0500 Subject: [PATCH] 2019 native breakdown view (#892) * 2019 native breakdown view * add unit tests * lint * fix test --- .../MatchBreakdownView2019Test.java | 77 +++ .../androidTest/resources/2019week0_f1m1.json | 148 +++++ .../androidTest/resources/2019week0_qm6.json | 148 +++++ .../binders/MatchBreakdownBinder.java | 5 +- .../renderers/MatchRenderer.java | 4 + .../subscribers/MatchBreakdownSubscriber.java | 9 +- .../breakdowns/MatchBreakdownView2019.java | 374 ++++++++++++ .../baseline_done_all_black_24.png | Bin 0 -> 289 bytes .../drawable-hdpi/baseline_lens_black_24.png | Bin 0 -> 248 bytes .../baseline_looks_3_black_24.png | Bin 0 -> 222 bytes .../baseline_looks_one_black_24.png | Bin 0 -> 172 bytes .../baseline_looks_two_black_24.png | Bin 0 -> 215 bytes .../baseline_trip_origin_black_24.png | Bin 0 -> 391 bytes .../baseline_done_all_black_24.png | Bin 0 -> 246 bytes .../drawable-mdpi/baseline_lens_black_24.png | Bin 0 -> 193 bytes .../baseline_looks_3_black_24.png | Bin 0 -> 159 bytes .../baseline_looks_one_black_24.png | Bin 0 -> 131 bytes .../baseline_looks_two_black_24.png | Bin 0 -> 163 bytes .../baseline_trip_origin_black_24.png | Bin 0 -> 276 bytes .../baseline_done_all_black_24.png | Bin 0 -> 360 bytes .../drawable-xhdpi/baseline_lens_black_24.png | Bin 0 -> 306 bytes .../baseline_looks_3_black_24.png | Bin 0 -> 236 bytes .../baseline_looks_one_black_24.png | Bin 0 -> 170 bytes .../baseline_looks_two_black_24.png | Bin 0 -> 222 bytes .../baseline_trip_origin_black_24.png | Bin 0 -> 519 bytes .../baseline_done_all_black_24.png | Bin 0 -> 299 bytes .../baseline_lens_black_24.png | Bin 0 -> 508 bytes .../baseline_looks_3_black_24.png | Bin 0 -> 313 bytes .../baseline_looks_one_black_24.png | Bin 0 -> 214 bytes .../baseline_looks_two_black_24.png | Bin 0 -> 289 bytes .../baseline_trip_origin_black_24.png | Bin 0 -> 781 bytes .../baseline_done_all_black_24.png | Bin 0 -> 510 bytes .../baseline_lens_black_24.png | Bin 0 -> 678 bytes .../baseline_looks_3_black_24.png | Bin 0 -> 411 bytes .../baseline_looks_one_black_24.png | Bin 0 -> 282 bytes .../baseline_looks_two_black_24.png | Bin 0 -> 391 bytes .../baseline_trip_origin_black_24.png | Bin 0 -> 1001 bytes .../res/drawable/baseline_done_all_24.xml | 10 + .../main/res/drawable/baseline_lens_24.xml | 10 + .../main/res/drawable/baseline_looks_3_24.xml | 10 + .../res/drawable/baseline_looks_one_24.xml | 10 + .../res/drawable/baseline_looks_two_24.xml | 10 + .../res/drawable/baseline_trip_origin_24.xml | 10 + .../main/res/drawable/breakdown2019_cargo.xml | 4 + .../drawable/breakdown2019_hatch_panel.xml | 4 + .../breakdown2019_null_hatch_panel.xml | 4 + .../main/res/layout/match_breakdown_2019.xml | 532 ++++++++++++++++++ .../strings_2018_breakdown.xml | 0 .../res/values/strings_2019_breakdown.xml | 18 + .../res/values/strings_score_breakdown.xml | 1 + .../MatchBreakdownSubscriberTest.java | 34 ++ android/src/test/resources/2018week0_qm1.json | 120 ++++ android/src/test/resources/2019week0_qm6.json | 148 +++++ 53 files changed, 1687 insertions(+), 3 deletions(-) create mode 100644 android/src/androidTest/java/com/thebluealliance/androidclient/views/breakdowns/MatchBreakdownView2019Test.java create mode 100644 android/src/androidTest/resources/2019week0_f1m1.json create mode 100644 android/src/androidTest/resources/2019week0_qm6.json create mode 100644 android/src/main/java/com/thebluealliance/androidclient/views/breakdowns/MatchBreakdownView2019.java create mode 100755 android/src/main/res/drawable-hdpi/baseline_done_all_black_24.png create mode 100755 android/src/main/res/drawable-hdpi/baseline_lens_black_24.png create mode 100755 android/src/main/res/drawable-hdpi/baseline_looks_3_black_24.png create mode 100755 android/src/main/res/drawable-hdpi/baseline_looks_one_black_24.png create mode 100755 android/src/main/res/drawable-hdpi/baseline_looks_two_black_24.png create mode 100755 android/src/main/res/drawable-hdpi/baseline_trip_origin_black_24.png create mode 100755 android/src/main/res/drawable-mdpi/baseline_done_all_black_24.png create mode 100755 android/src/main/res/drawable-mdpi/baseline_lens_black_24.png create mode 100755 android/src/main/res/drawable-mdpi/baseline_looks_3_black_24.png create mode 100755 android/src/main/res/drawable-mdpi/baseline_looks_one_black_24.png create mode 100755 android/src/main/res/drawable-mdpi/baseline_looks_two_black_24.png create mode 100755 android/src/main/res/drawable-mdpi/baseline_trip_origin_black_24.png create mode 100755 android/src/main/res/drawable-xhdpi/baseline_done_all_black_24.png create mode 100755 android/src/main/res/drawable-xhdpi/baseline_lens_black_24.png create mode 100755 android/src/main/res/drawable-xhdpi/baseline_looks_3_black_24.png create mode 100755 android/src/main/res/drawable-xhdpi/baseline_looks_one_black_24.png create mode 100755 android/src/main/res/drawable-xhdpi/baseline_looks_two_black_24.png create mode 100755 android/src/main/res/drawable-xhdpi/baseline_trip_origin_black_24.png create mode 100755 android/src/main/res/drawable-xxhdpi/baseline_done_all_black_24.png create mode 100755 android/src/main/res/drawable-xxhdpi/baseline_lens_black_24.png create mode 100755 android/src/main/res/drawable-xxhdpi/baseline_looks_3_black_24.png create mode 100755 android/src/main/res/drawable-xxhdpi/baseline_looks_one_black_24.png create mode 100755 android/src/main/res/drawable-xxhdpi/baseline_looks_two_black_24.png create mode 100755 android/src/main/res/drawable-xxhdpi/baseline_trip_origin_black_24.png create mode 100755 android/src/main/res/drawable-xxxhdpi/baseline_done_all_black_24.png create mode 100755 android/src/main/res/drawable-xxxhdpi/baseline_lens_black_24.png create mode 100755 android/src/main/res/drawable-xxxhdpi/baseline_looks_3_black_24.png create mode 100755 android/src/main/res/drawable-xxxhdpi/baseline_looks_one_black_24.png create mode 100755 android/src/main/res/drawable-xxxhdpi/baseline_looks_two_black_24.png create mode 100755 android/src/main/res/drawable-xxxhdpi/baseline_trip_origin_black_24.png create mode 100755 android/src/main/res/drawable/baseline_done_all_24.xml create mode 100755 android/src/main/res/drawable/baseline_lens_24.xml create mode 100755 android/src/main/res/drawable/baseline_looks_3_24.xml create mode 100755 android/src/main/res/drawable/baseline_looks_one_24.xml create mode 100755 android/src/main/res/drawable/baseline_looks_two_24.xml create mode 100755 android/src/main/res/drawable/baseline_trip_origin_24.xml create mode 100644 android/src/main/res/drawable/breakdown2019_cargo.xml create mode 100644 android/src/main/res/drawable/breakdown2019_hatch_panel.xml create mode 100644 android/src/main/res/drawable/breakdown2019_null_hatch_panel.xml create mode 100644 android/src/main/res/layout/match_breakdown_2019.xml rename android/src/main/res/{values-v21 => values}/strings_2018_breakdown.xml (100%) create mode 100644 android/src/main/res/values/strings_2019_breakdown.xml create mode 100644 android/src/test/resources/2018week0_qm1.json create mode 100644 android/src/test/resources/2019week0_qm6.json diff --git a/android/src/androidTest/java/com/thebluealliance/androidclient/views/breakdowns/MatchBreakdownView2019Test.java b/android/src/androidTest/java/com/thebluealliance/androidclient/views/breakdowns/MatchBreakdownView2019Test.java new file mode 100644 index 000000000..d2d96dfc0 --- /dev/null +++ b/android/src/androidTest/java/com/thebluealliance/androidclient/views/breakdowns/MatchBreakdownView2019Test.java @@ -0,0 +1,77 @@ +package com.thebluealliance.androidclient.views.breakdowns; + +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.FrameLayout; + +import com.facebook.testing.screenshot.Screenshot; +import com.facebook.testing.screenshot.ViewHelpers; +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.thebluealliance.androidclient.R; +import com.thebluealliance.androidclient.datafeed.HttpModule; +import com.thebluealliance.androidclient.models.Match; +import com.thebluealliance.androidclient.testing.ModelMaker; +import com.thebluealliance.androidclient.types.MatchType; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +@RunWith(AndroidJUnit4.class) +public class MatchBreakdownView2019Test { + private static final int WIDTH_DP = 400; + private Gson mGson; + + @Before + public void setUp() { + mGson = HttpModule.getGson(); + } + + @Test + public void testRenderQualMatch() throws Exception { + View view = getView("2019week0_qm6"); + ViewHelpers.setupView(view) + .setExactWidthDp(WIDTH_DP) + .layout(); + + Screenshot.snap(view) + .record(); + } + + @Test + public void testRenderPlayoffMatch() throws Exception { + View view = getView("2019week0_f1m1"); + ViewHelpers.setupView(view) + .setExactWidthDp(WIDTH_DP) + .layout(); + + Screenshot.snap(view) + .record(); + } + + + private MatchBreakdownView2019 getView(String matchJsonFile) { + Match match = ModelMaker.getModel(Match.class, matchJsonFile); + LayoutInflater inflater = LayoutInflater.from(InstrumentationRegistry.getTargetContext()); + View view = inflater.inflate(R.layout.fragment_match_breakdown, null, false); + + FrameLayout matchView = view.findViewById(R.id.match_breakdown); + assertEquals(1, matchView.getChildCount()); + assertTrue(matchView.getChildAt(0) instanceof MatchBreakdownView2019); + MatchBreakdownView2019 view2019 = (MatchBreakdownView2019) matchView.getChildAt(0); + MatchType matchType = MatchType.fromKey(match.getKey()); + view2019.initWithData(matchType, match.getWinningAlliance(), match.getAlliances(), + mGson.fromJson(match.getScoreBreakdown(), JsonObject.class)); + view2019.setVisibility(View.VISIBLE); + + // hide progress bar + view.findViewById(R.id.progress).setVisibility(View.GONE); + return view2019; + } +} diff --git a/android/src/androidTest/resources/2019week0_f1m1.json b/android/src/androidTest/resources/2019week0_f1m1.json new file mode 100644 index 000000000..e176b043c --- /dev/null +++ b/android/src/androidTest/resources/2019week0_f1m1.json @@ -0,0 +1,148 @@ +{ + "actual_time": 1550349044, + "alliances": { + "blue": { + "dq_team_keys": [], + "score": 50, + "surrogate_team_keys": [], + "team_keys": [ + "frc5687", + "frc58", + "frc1517" + ] + }, + "red": { + "dq_team_keys": [], + "score": 32, + "surrogate_team_keys": [], + "team_keys": [ + "frc1153", + "frc3236", + "frc246" + ] + } + }, + "comp_level": "f", + "event_key": "2019week0", + "key": "2019week0_f1m1", + "match_number": 1, + "post_result_time": 1550349303, + "predicted_time": 1550349181, + "score_breakdown": { + "blue": { + "adjustPoints": 0, + "autoPoints": 12, + "bay1": "Panel", + "bay2": "PanelAndCargo", + "bay3": "PanelAndCargo", + "bay4": "None", + "bay5": "PanelAndCargo", + "bay6": "PanelAndCargo", + "bay7": "PanelAndCargo", + "bay8": "PanelAndCargo", + "cargoPoints": 18, + "completeRocketRankingPoint": false, + "completedRocketFar": false, + "completedRocketNear": false, + "endgameRobot1": "HabLevel1", + "endgameRobot2": "HabLevel3", + "endgameRobot3": "HabLevel1", + "foulCount": 0, + "foulPoints": 0, + "habClimbPoints": 18, + "habDockingRankingPoint": false, + "habLineRobot1": "CrossedHabLineInSandstorm", + "habLineRobot2": "CrossedHabLineInSandstorm", + "habLineRobot3": "CrossedHabLineInSandstorm", + "hatchPanelPoints": 2, + "lowLeftRocketFar": "None", + "lowLeftRocketNear": "None", + "lowRightRocketFar": "None", + "lowRightRocketNear": "None", + "midLeftRocketFar": "None", + "midLeftRocketNear": "None", + "midRightRocketFar": "None", + "midRightRocketNear": "None", + "preMatchBay1": "Panel", + "preMatchBay2": "Panel", + "preMatchBay3": "Panel", + "preMatchBay6": "Panel", + "preMatchBay7": "Panel", + "preMatchBay8": "Panel", + "preMatchLevelRobot1": "HabLevel1", + "preMatchLevelRobot2": "HabLevel1", + "preMatchLevelRobot3": "HabLevel2", + "rp": 0, + "sandStormBonusPoints": 12, + "techFoulCount": 0, + "teleopPoints": 38, + "topLeftRocketFar": "None", + "topLeftRocketNear": "None", + "topRightRocketFar": "None", + "topRightRocketNear": "None", + "totalPoints": 50 + }, + "red": { + "adjustPoints": 0, + "autoPoints": 9, + "bay1": "Panel", + "bay2": "Panel", + "bay3": "Panel", + "bay4": "Panel", + "bay5": "PanelAndCargo", + "bay6": "Panel", + "bay7": "Panel", + "bay8": "Panel", + "cargoPoints": 3, + "completeRocketRankingPoint": false, + "completedRocketFar": false, + "completedRocketNear": false, + "endgameRobot1": "HabLevel2", + "endgameRobot2": "HabLevel1", + "endgameRobot3": "HabLevel1", + "foulCount": 0, + "foulPoints": 0, + "habClimbPoints": 12, + "habDockingRankingPoint": false, + "habLineRobot1": "CrossedHabLineInSandstorm", + "habLineRobot2": "CrossedHabLineInSandstorm", + "habLineRobot3": "CrossedHabLineInTeleop", + "hatchPanelPoints": 8, + "lowLeftRocketFar": "Panel", + "lowLeftRocketNear": "None", + "lowRightRocketFar": "Panel", + "lowRightRocketNear": "None", + "midLeftRocketFar": "None", + "midLeftRocketNear": "None", + "midRightRocketFar": "None", + "midRightRocketNear": "None", + "preMatchBay1": "Panel", + "preMatchBay2": "Panel", + "preMatchBay3": "Panel", + "preMatchBay6": "Panel", + "preMatchBay7": "Panel", + "preMatchBay8": "Panel", + "preMatchLevelRobot1": "HabLevel2", + "preMatchLevelRobot2": "HabLevel1", + "preMatchLevelRobot3": "HabLevel1", + "rp": 0, + "sandStormBonusPoints": 9, + "techFoulCount": 0, + "teleopPoints": 23, + "topLeftRocketFar": "None", + "topLeftRocketNear": "None", + "topRightRocketFar": "None", + "topRightRocketNear": "None", + "totalPoints": 32 + } + }, + "set_number": 1, + "time": 1550345760, + "videos": [ + { + "key": "ynbCsVr8_84", + "type": "youtube" + } + ], + "winning_alliance": "blue" +} \ No newline at end of file diff --git a/android/src/androidTest/resources/2019week0_qm6.json b/android/src/androidTest/resources/2019week0_qm6.json new file mode 100644 index 000000000..620037c73 --- /dev/null +++ b/android/src/androidTest/resources/2019week0_qm6.json @@ -0,0 +1,148 @@ +{ + "actual_time": 1550330637, + "alliances": { + "blue": { + "dq_team_keys": [], + "score": 47, + "surrogate_team_keys": [], + "team_keys": [ + "frc1721", + "frc58", + "frc3236" + ] + }, + "red": { + "dq_team_keys": [], + "score": 26, + "surrogate_team_keys": [], + "team_keys": [ + "frc811", + "frc3986", + "frc1729" + ] + } + }, + "comp_level": "qm", + "event_key": "2019week0", + "key": "2019week0_qm6", + "match_number": 6, + "post_result_time": 1550330813, + "predicted_time": 1550330766, + "score_breakdown": { + "blue": { + "adjustPoints": 0, + "autoPoints": 9, + "bay1": "Panel", + "bay2": "Panel", + "bay3": "Panel", + "bay4": "None", + "bay5": "None", + "bay6": "Panel", + "bay7": "Panel", + "bay8": "Panel", + "cargoPoints": 0, + "completeRocketRankingPoint": false, + "completedRocketFar": false, + "completedRocketNear": false, + "endgameRobot1": "HabLevel1", + "endgameRobot2": "HabLevel3", + "endgameRobot3": "HabLevel1", + "foulCount": 0, + "foulPoints": 10, + "habClimbPoints": 18, + "habDockingRankingPoint": true, + "habLineRobot1": "CrossedHabLineInSandstorm", + "habLineRobot2": "CrossedHabLineInSandstorm", + "habLineRobot3": "CrossedHabLineInSandstorm", + "hatchPanelPoints": 10, + "lowLeftRocketFar": "Panel", + "lowLeftRocketNear": "Panel", + "lowRightRocketFar": "None", + "lowRightRocketNear": "None", + "midLeftRocketFar": "Panel", + "midLeftRocketNear": "Panel", + "midRightRocketFar": "None", + "midRightRocketNear": "None", + "preMatchBay1": "Panel", + "preMatchBay2": "Panel", + "preMatchBay3": "Panel", + "preMatchBay6": "Panel", + "preMatchBay7": "Panel", + "preMatchBay8": "Panel", + "preMatchLevelRobot1": "HabLevel1", + "preMatchLevelRobot2": "HabLevel1", + "preMatchLevelRobot3": "HabLevel1", + "rp": 3, + "sandStormBonusPoints": 9, + "techFoulCount": 0, + "teleopPoints": 28, + "topLeftRocketFar": "Panel", + "topLeftRocketNear": "None", + "topRightRocketFar": "None", + "topRightRocketNear": "None", + "totalPoints": 47 + }, + "red": { + "adjustPoints": 0, + "autoPoints": 12, + "bay1": "None", + "bay2": "Panel", + "bay3": "PanelAndCargo", + "bay4": "None", + "bay5": "None", + "bay6": "Panel", + "bay7": "Panel", + "bay8": "Panel", + "cargoPoints": 3, + "completeRocketRankingPoint": false, + "completedRocketFar": false, + "completedRocketNear": false, + "endgameRobot1": "HabLevel1", + "endgameRobot2": "HabLevel1", + "endgameRobot3": "HabLevel1", + "foulCount": 0, + "foulPoints": 0, + "habClimbPoints": 9, + "habDockingRankingPoint": false, + "habLineRobot1": "CrossedHabLineInSandstorm", + "habLineRobot2": "CrossedHabLineInSandstorm", + "habLineRobot3": "CrossedHabLineInSandstorm", + "hatchPanelPoints": 2, + "lowLeftRocketFar": "None", + "lowLeftRocketNear": "None", + "lowRightRocketFar": "None", + "lowRightRocketNear": "None", + "midLeftRocketFar": "None", + "midLeftRocketNear": "None", + "midRightRocketFar": "None", + "midRightRocketNear": "None", + "preMatchBay1": "Cargo", + "preMatchBay2": "Panel", + "preMatchBay3": "Panel", + "preMatchBay6": "Panel", + "preMatchBay7": "Panel", + "preMatchBay8": "Panel", + "preMatchLevelRobot1": "HabLevel1", + "preMatchLevelRobot2": "HabLevel1", + "preMatchLevelRobot3": "HabLevel2", + "rp": 0, + "sandStormBonusPoints": 12, + "techFoulCount": 1, + "teleopPoints": 14, + "topLeftRocketFar": "None", + "topLeftRocketNear": "Panel", + "topRightRocketFar": "None", + "topRightRocketNear": "None", + "totalPoints": 26 + } + }, + "set_number": 1, + "time": 1550327700, + "videos": [ + { + "key": "n3fDuqHxh7w", + "type": "youtube" + } + ], + "winning_alliance": "blue" +} \ No newline at end of file diff --git a/android/src/main/java/com/thebluealliance/androidclient/binders/MatchBreakdownBinder.java b/android/src/main/java/com/thebluealliance/androidclient/binders/MatchBreakdownBinder.java index 9cea2f58f..e4b5c05ec 100644 --- a/android/src/main/java/com/thebluealliance/androidclient/binders/MatchBreakdownBinder.java +++ b/android/src/main/java/com/thebluealliance/androidclient/binders/MatchBreakdownBinder.java @@ -14,6 +14,7 @@ import com.thebluealliance.androidclient.views.breakdowns.MatchBreakdownView2016; import com.thebluealliance.androidclient.views.breakdowns.MatchBreakdownView2017; import com.thebluealliance.androidclient.views.breakdowns.MatchBreakdownView2018; +import com.thebluealliance.androidclient.views.breakdowns.MatchBreakdownView2019; import com.thebluealliance.api.model.IMatchAlliancesContainer; import butterknife.Bind; @@ -34,7 +35,6 @@ public void updateData(@Nullable MatchBreakdownBinder.Model data) { return; } long startTime = System.currentTimeMillis(); - TbaLogger.d("BINDING DATA"); AbstractMatchBreakdownView breakdownView; switch (data.year) { case 2015: @@ -49,6 +49,9 @@ public void updateData(@Nullable MatchBreakdownBinder.Model data) { case 2018: breakdownView = new MatchBreakdownView2018(mActivity); break; + case 2019: + breakdownView = new MatchBreakdownView2019(mActivity); + break; default: breakdownView = null; break; diff --git a/android/src/main/java/com/thebluealliance/androidclient/renderers/MatchRenderer.java b/android/src/main/java/com/thebluealliance/androidclient/renderers/MatchRenderer.java index 6664e5b87..05de57ff5 100644 --- a/android/src/main/java/com/thebluealliance/androidclient/renderers/MatchRenderer.java +++ b/android/src/main/java/com/thebluealliance/androidclient/renderers/MatchRenderer.java @@ -150,6 +150,10 @@ public MatchRenderer(APICache datafeed, Resources resources) { rpName1 = "autoQuestRankingPoint"; rpName2 = "faceTheBossRankingPoint"; break; + case 2019: + rpName1 = "habDockingRankingPoint"; + rpName2 = "completeRocketRankingPoint"; + break; } if (rpName1 != null) { if (redScoreBreakdown != null && redScoreBreakdown.get(rpName1).getAsBoolean()) { diff --git a/android/src/main/java/com/thebluealliance/androidclient/subscribers/MatchBreakdownSubscriber.java b/android/src/main/java/com/thebluealliance/androidclient/subscribers/MatchBreakdownSubscriber.java index 11ae5c398..92a921ca3 100644 --- a/android/src/main/java/com/thebluealliance/androidclient/subscribers/MatchBreakdownSubscriber.java +++ b/android/src/main/java/com/thebluealliance/androidclient/subscribers/MatchBreakdownSubscriber.java @@ -15,8 +15,9 @@ public class MatchBreakdownSubscriber extends BaseAPISubscriber { - public static final String SHOW_2017_KEY = "show_2017_breakdowns"; - public static final String SHOW_2018_KEY = "show_2018_breakdowns"; + static final String SHOW_2017_KEY = "show_2017_breakdowns"; + static final String SHOW_2018_KEY = "show_2018_breakdowns"; + static final String SHOW_2019_KEY = "show_2019_breakdowns"; private final Gson mGson; private final AppConfig mConfig; @@ -46,6 +47,10 @@ public void parseData() { shouldShowBreakdown = mConfig.getBoolean(SHOW_2018_KEY); TbaLogger.i("Showing 2018 breakdowns? " + shouldShowBreakdown); break; + case 2019: + shouldShowBreakdown = mConfig.getBoolean(SHOW_2019_KEY); + TbaLogger.i("Showing 2019 breakdowns? " + shouldShowBreakdown); + break; } mDataToBind = null; diff --git a/android/src/main/java/com/thebluealliance/androidclient/views/breakdowns/MatchBreakdownView2019.java b/android/src/main/java/com/thebluealliance/androidclient/views/breakdowns/MatchBreakdownView2019.java new file mode 100644 index 000000000..a1035a65e --- /dev/null +++ b/android/src/main/java/com/thebluealliance/androidclient/views/breakdowns/MatchBreakdownView2019.java @@ -0,0 +1,374 @@ +package com.thebluealliance.androidclient.views.breakdowns; + +import android.content.Context; +import android.content.res.Resources; +import android.support.annotation.DrawableRes; +import android.support.v7.widget.GridLayout; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.TextView; + +import com.google.gson.JsonObject; +import com.thebluealliance.androidclient.R; +import com.thebluealliance.androidclient.types.MatchType; +import com.thebluealliance.api.model.IMatchAlliancesContainer; + +import java.util.List; + +import butterknife.Bind; +import butterknife.ButterKnife; + +import static com.thebluealliance.androidclient.views.breakdowns.MatchBreakdownHelper.getBooleanDefault; +import static com.thebluealliance.androidclient.views.breakdowns.MatchBreakdownHelper.getIntDefault; +import static com.thebluealliance.androidclient.views.breakdowns.MatchBreakdownHelper.getIntDefaultValue; +import static com.thebluealliance.androidclient.views.breakdowns.MatchBreakdownHelper.teamNumberFromKey; + +public class MatchBreakdownView2019 extends AbstractMatchBreakdownView { + @Bind(R.id.breakdown2019_container) GridLayout breakdownContainer; + + @Bind(R.id.breakdown_red1) TextView red1; + @Bind(R.id.breakdown_blue1) TextView blue1; + @Bind(R.id.breakdown_red2) TextView red2; + @Bind(R.id.breakdown_blue2) TextView blue2; + @Bind(R.id.breakdown_red3) TextView red3; + @Bind(R.id.breakdown_blue3) TextView blue3; + + @Bind(R.id.breakdown2019_red_sandstorm_bonus_robot_1) TextView redSandstormBonusRobot1; + @Bind(R.id.breakdown2019_blue_sandstorm_bonus_robot_1) TextView blueSandstormBonusRobot1; + @Bind(R.id.breakdown2019_red_sandstorm_bonus_robot_2) TextView redSandstormBonusRobot2; + @Bind(R.id.breakdown2019_blue_sandstorm_bonus_robot_2) TextView blueSandstormBonusRobot2; + @Bind(R.id.breakdown2019_red_sandstorm_bonus_robot_3) TextView redSandstormBonusRobot3; + @Bind(R.id.breakdown2019_blue_sandstorm_bonus_robot_3) TextView blueSandstormBonusRobot3; + @Bind(R.id.breakdown2019_sandstorm_total_red) TextView redSandstormTotal; + @Bind(R.id.breakdown2019_sandstorm_total_blue) TextView blueSandstormTotal; + + + @Bind(R.id.breakdown2019_red_cargo_ship_panels) TextView redCargoShipPanels; + @Bind(R.id.breakdown2019_red_cargo_ship_null_panels) TextView redCargoShipNullPanels; + @Bind(R.id.breakdown2019_red_cargo_ship_cargo) TextView redCargoShipCargo; + @Bind(R.id.breakdown2019_red_rocket_1_panels) TextView redRocket1Panels; + @Bind(R.id.breakdown2019_red_rocket_1_cargo) TextView redRocket1Cargo; + @Bind(R.id.breakdown2019_red_rocket_2_panels) TextView redRocket2Panels; + @Bind(R.id.breakdown2019_red_rocket_2_cargo) TextView redRocket2Cargo; + + @Bind(R.id.breakdown2019_blue_cargo_ship_panels) TextView blueCargoShipPanels; + @Bind(R.id.breakdown2019_blue_cargo_ship_null_panels) TextView blueCargoShipNullPanels; + @Bind(R.id.breakdown2019_blue_cargo_ship_cargo) TextView blueCargoShipCargo; + @Bind(R.id.breakdown2019_blue_rocket_1_panels) TextView blueRocket1Panels; + @Bind(R.id.breakdown2019_blue_rocket_1_cargo) TextView blueRocket1Cargo; + @Bind(R.id.breakdown2019_blue_rocket_2_panels) TextView blueRocket2Panels; + @Bind(R.id.breakdown2019_blue_rocket_2_cargo) TextView blueRocket2Cargo; + + @Bind(R.id.breakdown2019_red_hatch_panel_points) TextView redHatchPanelPoints; + @Bind(R.id.breakdown2019_blue_hatch_panel_points) TextView blueHatchPanelPoints; + @Bind(R.id.breakdown2019_red_cargo_points) TextView redCargoPoints; + @Bind(R.id.breakdown2019_blue_cargo_points) TextView blueCargoPoints; + + @Bind(R.id.breakdown2019_red_hab_robot_1) TextView redHabRobot1; + @Bind(R.id.breakdown2019_blue_hab_robot_1) TextView blueHabRobot1; + @Bind(R.id.breakdown2019_red_hab_robot_2) TextView redHabRobot2; + @Bind(R.id.breakdown2019_blue_hab_robot_2) TextView blueHabRobot2; + @Bind(R.id.breakdown2019_red_hab_robot_3) TextView redHabRobot3; + @Bind(R.id.breakdown2019_blue_hab_robot_3) TextView blueHabRobot3; + @Bind(R.id.breakdown2019_hab_total_red) TextView redHabTotal; + @Bind(R.id.breakdown2019_hab_total_blue) TextView blueHabTotal; + + @Bind(R.id.breakdown_teleop_total_red) TextView redTeleopTotal; + @Bind(R.id.breakdown_teleop_total_blue) TextView blueTeleopTotal; + + @Bind(R.id.breakdown2019_red_complete_rocket) TextView redCompleteRocket; + @Bind(R.id.breakdown2019_blue_complete_rocket) TextView blueCompleteRocket; + @Bind(R.id.breakdown2019_red_hab_docking) TextView redHabDocking; + @Bind(R.id.breakdown2019_blue_hab_docking) TextView blueHabDocking; + + @Bind(R.id.breakdown_fouls_red) TextView foulsRed; + @Bind(R.id.breakdown_fouls_blue) TextView foulsBlue; + @Bind(R.id.breakdown_adjust_red) TextView adjustRed; + @Bind(R.id.breakdown_adjust_blue) TextView adjustBlue; + @Bind(R.id.breakdown_total_red) TextView totalRed; + @Bind(R.id.breakdown_total_blue) TextView totalBlue; + @Bind(R.id.breakdown_red_rp) TextView rpRed; + @Bind(R.id.breakdown_blue_rp) TextView rpBlue; + @Bind(R.id.breakdown_rp_header) TextView rpHeader; + + private Resources mResources; + + public MatchBreakdownView2019(Context context) { + super(context); + } + + public MatchBreakdownView2019(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public MatchBreakdownView2019(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + } + + @Override + void init() { + LayoutInflater.from(getContext()).inflate(R.layout.match_breakdown_2019, this, true); + ButterKnife.bind(this); + } + + @Override + public boolean initWithData(MatchType matchType, String winningAlliance, IMatchAlliancesContainer allianceData, JsonObject scoreData) { + if (scoreData == null || scoreData.entrySet().isEmpty() + || allianceData == null || allianceData.getRed() == null || allianceData.getBlue() == null) { + breakdownContainer.setVisibility(GONE); + return false; + } + + /* Resources */ + mResources = getResources(); + + /* Alliance data */ + List redTeams = allianceData.getRed().getTeamKeys(); + List blueTeams = allianceData.getBlue().getTeamKeys(); + JsonObject redData = scoreData.get("red").getAsJsonObject(); + JsonObject blueData = scoreData.get("blue").getAsJsonObject(); + + /* Red Teams */ + red1.setText(teamNumberFromKey(redTeams.get(0))); + red2.setText(teamNumberFromKey(redTeams.get(1))); + red3.setText(teamNumberFromKey(redTeams.get(2))); + + /* Blue Teams */ + blue1.setText(teamNumberFromKey(blueTeams.get(0))); + blue2.setText(teamNumberFromKey(blueTeams.get(1))); + blue3.setText(teamNumberFromKey(blueTeams.get(2))); + + /* Sandstorm Bonus */ + setSandstormBonus(redData, "1", redSandstormBonusRobot1); + setSandstormBonus(redData, "2", redSandstormBonusRobot2); + setSandstormBonus(redData, "3", redSandstormBonusRobot3); + setSandstormBonus(blueData, "1", blueSandstormBonusRobot1); + setSandstormBonus(blueData, "2", blueSandstormBonusRobot2); + setSandstormBonus(blueData, "3", blueSandstormBonusRobot3); + blueSandstormTotal.setText(getIntDefault(blueData, "sandStormBonusPoints")); + redSandstormTotal.setText(getIntDefault(redData, "sandStormBonusPoints")); + + /* Scoring Objects */ + setCargoShipScoring(redData, redCargoShipNullPanels, redCargoShipPanels, redCargoShipCargo); + setRocketScoring(redData, "Near", redRocket1Panels, redRocket1Cargo); + setRocketScoring(redData, "Far", redRocket2Panels, redRocket2Cargo); + + setCargoShipScoring(blueData, blueCargoShipNullPanels, blueCargoShipPanels, blueCargoShipCargo); + setRocketScoring(blueData, "Near", blueRocket1Panels, blueRocket1Cargo); + setRocketScoring(blueData, "Far", blueRocket2Panels, blueRocket2Cargo); + + setTotalPanels(redData, redHatchPanelPoints); + setTotalCargo(redData, redCargoPoints); + setTotalPanels(blueData, blueHatchPanelPoints); + setTotalCargo(blueData, blueCargoPoints); + + /* HAB Climb */ + setHabClimbBonus(redData, "1", redHabRobot1); + setHabClimbBonus(redData, "2", redHabRobot2); + setHabClimbBonus(redData, "3", redHabRobot3); + redHabTotal.setText(getIntDefault(redData, "habClimbPoints")); + + setHabClimbBonus(blueData, "1", blueHabRobot1); + setHabClimbBonus(blueData, "2", blueHabRobot2); + setHabClimbBonus(blueData, "3", blueHabRobot3); + blueHabTotal.setText(getIntDefault(blueData, "habClimbPoints")); + + /* Teleop Total Points */ + redTeleopTotal.setText(getIntDefault(redData, "teleopPoints")); + blueTeleopTotal.setText(getIntDefault(blueData, "teleopPoints")); + + /* Ranking Points */ + setRocketRankingPoint(redData, redCompleteRocket); + setHabRankingPoint(redData, redHabDocking); + setRocketRankingPoint(blueData, blueCompleteRocket); + setHabRankingPoint(blueData, blueHabDocking); + + /* Fouls */ + foulsRed.setText(mResources.getString(R.string.breakdown_foul_format_add, getIntDefaultValue(redData, "foulPoints"))); + foulsBlue.setText(mResources.getString(R.string.breakdown_foul_format_add, getIntDefaultValue(blueData, "foulPoints"))); + + /* Adjustment points */ + adjustRed.setText(getIntDefault(redData, "adjustPoints")); + adjustBlue.setText(getIntDefault(blueData, "adjustPoints")); + + /* Total Points */ + totalRed.setText(getIntDefault(redData, "totalPoints")); + totalBlue.setText(getIntDefault(blueData, "totalPoints")); + + /* Show RPs earned, if needed */ + if (!matchType.isPlayoff()) { + rpRed.setText(mResources.getString(R.string.breakdown_total_rp, getIntDefaultValue(redData, "rp"))); + rpBlue.setText(mResources.getString(R.string.breakdown_total_rp, getIntDefaultValue(blueData, "rp"))); + } else { + rpRed.setVisibility(GONE); + rpBlue.setVisibility(GONE); + rpHeader.setVisibility(GONE); + } + + breakdownContainer.setVisibility(View.VISIBLE); + return true; + } + + private void setSandstormBonus(JsonObject allianceData, String robotNumber, TextView view) { + String habLineAction = getIntDefault(allianceData, "habLineRobot" + robotNumber); + String preMatchLevel = getIntDefault(allianceData, "preMatchLevelRobot" + robotNumber); + @DrawableRes int bonusResource; + int bonusPoints; + if (!habLineAction.equals("CrossedHabLineInSandstorm")) { + bonusPoints = 0; + bonusResource = R.drawable.ic_close_black_24dp; + } else { + switch (preMatchLevel) { + case "HabLevel1": + bonusPoints = 3; + bonusResource = R.drawable.baseline_looks_one_black_24; + break; + case "HabLevel2": + bonusPoints = 6; + bonusResource = R.drawable.baseline_looks_two_black_24; + break; + default: + bonusPoints = 0; + bonusResource = R.drawable.ic_close_black_24dp; + break; + } + } + + String bonusText = (bonusPoints != 0) ? mResources.getString(R.string.breakdown_addition_format, bonusPoints) : ""; + view.setText(bonusText); + view.setCompoundDrawablesWithIntrinsicBounds(bonusResource, 0, 0, 0); + } + + private void setCargoShipScoring(JsonObject allianceData, TextView nullPanels, TextView panels, TextView cargo) { + int nullPanelCount = 0; + int panelCount = 0; + int cargoCount = 0; + for (int i = 1; i <= 8; i++) { + String initialValue = getIntDefault(allianceData, "preMatchBay" + i); + String scoreValue = getIntDefault(allianceData, "bay" + i); + if (initialValue.contains("Panel")) { + nullPanelCount++; + } else if (scoreValue.contains("Panel")) { + panelCount++; + } + if (scoreValue.contains("Cargo")) { + cargoCount++; + } + } + + nullPanels.setText(String.format("%1$s", nullPanelCount)); + panels.setText(String.format("%1$s", panelCount)); + cargo.setText(String.format("%1$s", cargoCount)); + } + + private static String[] rocketKeys = {"topLeftRocket", "topRightRocket", "midLeftRocket", "midRightRocket", "lowLeftRocket", "lowRightRocket"}; + private void setRocketScoring(JsonObject allianceData, String rocket /* Near or Far */, TextView panels, TextView cargo) { + int panelCount = 0; + int cargoCount = 0; + for (String key : rocketKeys) { + String scoreValue = getIntDefault(allianceData, key + rocket); + if (scoreValue.contains("Panel")) { + panelCount++; + } + if (scoreValue.contains("Cargo")) { + cargoCount++; + } + } + + panels.setText(String.format("%1$s", panelCount)); + cargo.setText(String.format("%1$s", cargoCount)); + } + + private void setTotalPanels(JsonObject allianceData, TextView view) { + int panelScore = getIntDefaultValue(allianceData, "hatchPanelPoints"); + int panelCount = panelScore / 2; + + if (panelScore == 0) { + view.setText(mResources.getString(R.string.breakdown_number_format, panelScore)); + } else { + view.setText(mResources.getString(R.string.breakdown_number_with_addition_format, panelCount, panelScore)); + } + } + + private void setTotalCargo(JsonObject allianceData, TextView view) { + int panelScore = getIntDefaultValue(allianceData, "cargoPoints"); + int panelCount = panelScore / 3; + + if (panelScore == 0) { + view.setText(mResources.getString(R.string.breakdown_number_format, panelScore)); + } else { + view.setText(mResources.getString(R.string.breakdown_number_with_addition_format, panelCount, panelScore)); + } + } + + private void setHabClimbBonus(JsonObject allianceData, String robotNumber, TextView view) { + String endgameState = getIntDefault(allianceData, "endgameRobot" + robotNumber); + @DrawableRes int bonusResource; + int bonusPoints; + switch (endgameState) { + case "HabLevel3": + bonusResource = R.drawable.baseline_looks_3_black_24; + bonusPoints = 12; + break; + case "HabLevel2": + bonusResource = R.drawable.baseline_looks_two_black_24; + bonusPoints = 6; + break; + case "HabLevel1": + bonusResource = R.drawable.baseline_looks_one_black_24; + bonusPoints = 3; + break; + default: + bonusResource = R.drawable.ic_close_black_24dp; + bonusPoints = 0; + break; + } + + String bonusText = (bonusPoints != 0) ? mResources.getString(R.string.breakdown_addition_format, bonusPoints) : ""; + view.setText(bonusText); + view.setCompoundDrawablesWithIntrinsicBounds(bonusResource, 0, 0, 0); + } + + private void setRocketRankingPoint(JsonObject allianceData, TextView view) { + @DrawableRes int resource; + String additionText; + if (getBooleanDefault(allianceData, "completedRocketFar") && getBooleanDefault(allianceData, "completedRocketNear")) { + resource = R.drawable.baseline_done_all_black_24; + } else if (getBooleanDefault(allianceData, "completedRocketFar") || getBooleanDefault(allianceData, "completedRocketNear")) { + resource = R.drawable.ic_clear_black_24dp; + } else { + resource = R.drawable.ic_close_black_24dp; + } + + + if (getBooleanDefault(allianceData, "completeRocketRankingPoint")) { + additionText = mResources.getString(R.string.breakdown_rp_format, 1); + } else { + additionText = ""; + } + + view.setText(additionText); + view.setCompoundDrawablesWithIntrinsicBounds(resource, 0, 0, 0); + } + + private void setHabRankingPoint(JsonObject allianceData, TextView view) { + @DrawableRes int resource; + String additionText; + int habPoints = getIntDefaultValue(allianceData, "habClimbPoints"); + if (habPoints > 15) { + resource = R.drawable.ic_check_black_24dp; + } else { + resource = R.drawable.ic_close_black_24dp; + } + + if (getBooleanDefault(allianceData, "habDockingRankingPoint")) { + additionText = mResources.getString(R.string.breakdown_rp_format, 1); + } else { + additionText = ""; + } + + view.setText(additionText); + view.setCompoundDrawablesWithIntrinsicBounds(resource, 0, 0, 0); + } +} diff --git a/android/src/main/res/drawable-hdpi/baseline_done_all_black_24.png b/android/src/main/res/drawable-hdpi/baseline_done_all_black_24.png new file mode 100755 index 0000000000000000000000000000000000000000..6c781ee1e7e65d8bca90aa80baa19ce0ac024099 GIT binary patch literal 289 zcmV++0p9+JP)30tN&a2%tv^2n-Ab1OkyLSO|zpBB&dDxXdp7 zMa9ko9KT{@q-joWOiKmpo?ThYnqwc@RhlF@&6*@hHmfvumcWE)biUV|{Gn#@r<(46 zX{PkFp!k%|YFRF%f(dZ3tm~|;hUPWbJlCny<$*b$AwgByc zs;=CG`KVroRCQwPYQG?s}7OPQj zn3u_s0|_;nIFM1J3kTG0r$FtcYq80z2nh3R#fTQ^|3wkY8#&a#0}Ay yje)>=)8c>;M`XX)n@BaDkwiv_Ok%|Ik9+_GhP)kPInw|k0wldT1B8LpQcoAhkP61PQ%#we3`Ja?^W0(A zyx6?J^xYJT@&>t;)4LNzjb5ny*mvJA&gNkAjvo`|k1|%Oc%$NbBialK%Ln;{GUO&irKtaIe;{BQB zle@lb;#EmFx{N8Yb;l$F`DgzQobC$Z_I6-=^Hfy9Fp~M#Bhxvu4*a(|7fW%hve@J> z;jdgub1oCFP{xOpMup=nLLLf@EJ7JY*5~|k0wldT1B8LpJWm(LkP61PQybY18;H1`pKr>r z>+cyZkB5y6(tl^d=|4v;CsOc}6Ebf2D^@CN*~a%}jZ~&YiuKTTX9HQ@G4# zky(W^L^e4)OWyWLu}ztBC#vBxY)#_%DZoVOMoZ~v@|5mwlqVuvmlC38LfO0CrF$=+AHHT zmGL(Tc1bXn=9DcSMv^5=7VUbVnlgID=0(~~P+b`nu_;Qs3u+*vD{PX|{sOg>(J3}( z(q4jE$tZ?ROxmm6kCw#dQrZJhor7O?2UP3e&)))-!bq-h{~=RhOJowdL?+Ul;Zwm# z`i_gXf=`s$-rLBG2muNK8{0h|=bHp?Yy}8b$Kam&KWzR04;Y8kaFDYekU1PhxN|?U l-7XP5#;pG?5l>_|M!)iLz{fVj);|CM002ovPDHLkV1j^Iq>%ss literal 0 HcmV?d00001 diff --git a/android/src/main/res/drawable-mdpi/baseline_done_all_black_24.png b/android/src/main/res/drawable-mdpi/baseline_done_all_black_24.png new file mode 100755 index 0000000000000000000000000000000000000000..25111a7345e58e4b076594d81cba9b0a2676ea67 GIT binary patch literal 246 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_+iy`C4SB>ZikmXn%JV|p(6B7w!G?Cte@Dqt^05Pd9K^IGuo~}%u~%41W>zv_r}LqL56=l!sKPiBjMY;81CIAZ@V@oD!tn-11fj;E9QLl#VM zk7`T^=PQ-?v5e2*`F5{IN1n%89uQ%xo2pW@RK@fByPakWm$;skWYhCZ;M4v-?}+Bk u@8=kgO-<3Z{Bkz%5_6Qv?+D9ANyeaC{*#Q`nhpUy!r0;0T literal 0 HcmV?d00001 diff --git a/android/src/main/res/drawable-mdpi/baseline_lens_black_24.png b/android/src/main/res/drawable-mdpi/baseline_lens_black_24.png new file mode 100755 index 0000000000000000000000000000000000000000..eb37b3d71325cc2ebd63e44e0112fad6a4aa2aa0 GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gj9iA?ZAr*{C5`qeh7h)x6FbFgS zlpM+4oZXzg_|^imk1Q+?1Xg}-5BR{K^5;u%s@yUom5|QZc}F^5PP(w@^xdVCC8M6S zsfV91-Zp{%_Buv^7hzi`YEY+&ws sV$YrKQ#EhT?6oz&mU!wIw$B%TbKP9Z`g6%Vpqm&xUHx3vIVCg!0L&;!5C8xG literal 0 HcmV?d00001 diff --git a/android/src/main/res/drawable-mdpi/baseline_looks_3_black_24.png b/android/src/main/res/drawable-mdpi/baseline_looks_3_black_24.png new file mode 100755 index 0000000000000000000000000000000000000000..a4d959a771f5252cb3cb42dec8edf90624982a15 GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_+iG*1`DkP60Ri9HAUA95Y8xA|b@ z%&@BMxP#-L52~x$>KzoFCUiRS&JdE~k?y$4z$~=HvXfKAZx)-_AF~9nuuC4yPK?&Q zHoX%jsOid?TvYDcm-&*>@u_~mT$)GvKSq9-FI6!is)4O-7AuEM*1;95i^X^vH@y%P<*9dBacHMsrtJlq%HZkh=d#Wzp$P!HH7aTV literal 0 HcmV?d00001 diff --git a/android/src/main/res/drawable-mdpi/baseline_looks_two_black_24.png b/android/src/main/res/drawable-mdpi/baseline_looks_two_black_24.png new file mode 100755 index 0000000000000000000000000000000000000000..7496a12533f7fb743e66ce4f656d8ba458b0a671 GIT binary patch literal 163 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjS)MMAAr*|t3Zgws^$Ppgj{HA) zT$)GvKSq9-FI6EB)xc@eSRtINR7K1(d2iE(p6#dO#H6$w9-okY)-a`EivGiw$x;9`hgUYQ59mBG{1 K&t;ucLK6T$Q8O+8 literal 0 HcmV?d00001 diff --git a/android/src/main/res/drawable-mdpi/baseline_trip_origin_black_24.png b/android/src/main/res/drawable-mdpi/baseline_trip_origin_black_24.png new file mode 100755 index 0000000000000000000000000000000000000000..01e4ec5393003808a305e1c8c54c432267eb9f81 GIT binary patch literal 276 zcmV+v0qg#WP)AC=ic$s4aAQs3tehP~wwIl(MG}K%YIS-r{31yd{Vj zU>gug^1`5&`W=rlPw!r$F48*Ta+LIfx=U+}%Sh5YDv?$fm!71_?}1+31Giegbo=Ac z3u$F|lugJaU7!q4X@(534GATAVz5lD(KzU69IVlp)|^$TRg-zm*)>_92Y#Iu{pgBz aXxSGWPQ}PZGLzN-000040D=(Jf&iM@m(OO}*C(6uB&2ob81u(1e07m{$0M35AMZlE}AmL&Ltd>BJx zXHL+(fS>bx2Mm8vE|<&AvW`*(#}p)Jo>z=bm#4%iDdPDG!!Wi{G$?AY528z`DMO5{8Sj< z;*u^(_4Ne61UDZ3@mF4dF>ofvICox|CikQ8<2+!PJHaW2ITO?DhVzOI%rnuU()|Fp znQ-2n=%5J(y7wIZDUerN`k>MTbe)L+K7OL@=hIA_(dIdT51N=m6AX2Ki{PD!7fryD zCPwGgPQZlt*oi}wCd9{2^iY}*AKM;BC^W%^_*^dckNO5_W;}RlAYe5B0000z`bPEF(A58=6y=+XCj z5;r^s9Ct=^r;$63YC?+^)FM=PU`7j@37piTCu=DtB($Q0P$Z$1rHYSZ{h9DzqB ziiV`HGDNc?O@Bv_z=0E7mo_zVXrI(JKIs%MdS6q5+rIAU{P%XtW~gsgIKjH8 k5n(4smdKI;Vst0LQ0SKmY&$ literal 0 HcmV?d00001 diff --git a/android/src/main/res/drawable-xhdpi/baseline_looks_one_black_24.png b/android/src/main/res/drawable-xhdpi/baseline_looks_one_black_24.png new file mode 100755 index 0000000000000000000000000000000000000000..5dcca914c36b220f67c3a83dba74ecc1dcf087a9 GIT binary patch literal 170 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}b0DLQfaRkP61P*EjMuD2TXT+}+gb zw*9)ON*{~Z0iGMP9UAA~*z>!}@3*7o=P;ShOFLVVmtOQ)P;=+3%htI`8=A8&vUG%K zn@O{9RG7*L1k7h(WMbhEF!;Ah;DPVF@AmWFcOPU|F}R%ZSgG88p5;vgzm@E_kItFp TlPuc|w4A}y)z4*}Q$iB}cGf*z literal 0 HcmV?d00001 diff --git a/android/src/main/res/drawable-xhdpi/baseline_looks_two_black_24.png b/android/src/main/res/drawable-xhdpi/baseline_looks_two_black_24.png new file mode 100755 index 0000000000000000000000000000000000000000..e7765b19576e43a28a78828f3cb4ec741e696b72 GIT binary patch literal 222 zcmV<403rX0P)(+=5$Oy{z&eUs3(FPP{pij+M&`RlhWoa zGejYC&QhufO3orm(HEHDkRAc4zF?mTwOav%t_7Zw;QS9>DlkDxK#zTVJwe0R?Jx~F zW=x|e@Ytuvl+49aA?ITP_X3soO<>2CZxFVr!jMwL88#qiM5K`A1RIzWvN-Kv!^1WX#f0HAn-u6JPbAP7p#+@omiDuaamEDm<}{xUR95AYv4%j z7SPD>AZqtClSVUlYMDXl$BK-R*0|dCqfCp+H9oGzdKzV4RF?3uB-VQ<6;T<&$DmlB zqdbX9H$J+>`Uy!LEsgkSQOA%Hi%K3Jd9jY`@QNy;GKh}>v96%(ipnBB7R7oOWmZ(K z@Np^DGe7&O7*pH6G#|UW;E&xS88qgwB1fcgtac?dpo3UdmvLEEo0xW=BlCb9NpgNi zCPch^`_O--jT$B#*OnIY^e|fE+A{IG7q2o-P2pEZPRZ8i@~ari0WZhkW!UQnWH|H} z>I3V@2PF)_J|_>%d^hlP0w*%aQ>U+)gwl)pHqB}x1)W5pk78mc9(YA z|0gU=zEg!cR5gp|MPIk*RC#U_e#>&^lIJX8Z|C@2D}MHDMl#>sCE0UkTRxld`SUNY zb1dvVf!STQZ53-T7UprxFgTe~DWM4f9u9gk literal 0 HcmV?d00001 diff --git a/android/src/main/res/drawable-xxhdpi/baseline_lens_black_24.png b/android/src/main/res/drawable-xxhdpi/baseline_lens_black_24.png new file mode 100755 index 0000000000000000000000000000000000000000..fb89df3c98be6ee8679d612a0d7c7a984a8f3b87 GIT binary patch literal 508 zcmV&PicF!1AbW%r_+M<(;5*o;2DG3?$ z(?piLWPm>^(LfGLX$Nx!4v?dEC}3X+>U<=UyqAkFa1Pt%?Fv4LxNT zOd&@I#q?O;pa9+Qtp^mK2fp=&0`wOD4+?+F;(w@v4*R3{{}|()Is#3u@h(5&U!XxX zwk7Pa_eFjWzt}?_+lzmr82?rpMvVN{~ zD3KxuH7M~%y<8&8H7S!pV)-f^laNt~Eo7-W9au5NorS%{RBWF(t()Zk5Fmo#K#EI(TMQX)O-S1M>inv+Z~kh1|J|2(Ip>_K zVwOvyg657DYKb3poDvm0moyT)EusLkO9io-CJHq3#A-Vj=!jT71_ON(s}G`JQ)7@p z1|>eInRVWkKmc7lXn|mgZ!HjPsDVb+K-C%_`?yg>%knO1cET7FYs1=bZZkj$G_3p6J7o00000 LNkvXXu0mjfA#j2q literal 0 HcmV?d00001 diff --git a/android/src/main/res/drawable-xxhdpi/baseline_looks_one_black_24.png b/android/src/main/res/drawable-xxhdpi/baseline_looks_one_black_24.png new file mode 100755 index 0000000000000000000000000000000000000000..4e37b4c344f7f40b8b0805cae194ba491f89e227 GIT binary patch literal 214 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY0wn)GsXhaw=6bp~hEy=Vy}6OM*+GEyVq=Sx zPi2|M++$^o9UPrX1vPnz=P&897~9A1tuZv-9KkFsz4W4)8k^RxjX_fRsVWi2Cr{cS zF1zsElqI$tU;UVCIllTb%eH7$3afZrsDIAF$>kI9)sKx+NX27WdP)p7Mi)Dapo;x>*}hu$Pn>Gg#J0^Ywwjn-Y~!R$HD`41#P3(%sYVz4 z_uqfNtqN+H%L)#1mV12Q9rroMepWJ%S}OR7x-pw;h)36$O=lvOz*Np70XoN2;)zI% zJ4lG`5W~7Gwju^?B@2rxxsMojpGvIAWEoXh}um&fz3oBY$gE>Lwxj@`Bc)4GEzvPl&)0M%2UKgBM6{?XNX4!7)2sZ zk{HDS#G|Ja;M;P9*9eyiQ!j_&xlJs@#Q3<_Kbc6(T`_{+DUvE zf~dWq9YM9@1)??tPX`gDuT&F84PRaEMh}I2LzJ2cs|8W|MiH(W5Ty&4IFBeb;OaP{ z)CUv&5T)a|NKqftZJ64wzD80|Rhv8wp`YF=R88t@J`PiHJV6|5M72~IvJe{W7Iwh|*D9H6cppF>wJ=YQj~8%TInwBtQ9uCexrA z`_mwkr$Kl@dxC23I#H}LpGps~IF&w)FMSc0J~0`;CU`71^u?!T7M5fBa}aTDne7Fu z(Inv{iP1h5te#O|e@X8NtyIyCGLlLDv84A5@lg!{%|Ie-27$$M2#Kh}#1le#L<{Fv zNdKL-7H(34fqc#(7P~+`hB8@!SZXDizt0BV11hm7n{|jmYstd8iJ>=vClZkaVu82G zW5g4&Zp`xWI=KEb4ibDH=2DA=(4`h%f$#y4g;;7aNWmx=1)~4}VqXq#>~xPS00000 LNkvXXu0mjfXb@Cz literal 0 HcmV?d00001 diff --git a/android/src/main/res/drawable-xxxhdpi/baseline_done_all_black_24.png b/android/src/main/res/drawable-xxxhdpi/baseline_done_all_black_24.png new file mode 100755 index 0000000000000000000000000000000000000000..95a7dca61f2d99b9f247f5dd1cccb5fc69c2de5e GIT binary patch literal 510 zcmV3^flCqRgw-6i{j0lVfga`;UpbIE1FoYq7(47D0H| zKFZPbc>>qB^^ir=w>6ylwl1=0`nGeY{v=^DmcFg-)VFp1E?|l4qXEWtJpHF1>3{rl zed$ZTSq%M!qU%2tL|^)qqU-mIq2H2z0_KaZe=mLM&!E0>L-nsy=$CPe1$b$q21XSF zqCdy}m$!ZoV>~(&ny{bogk20=`n^2$v&nNjf$M*pFifrAwFjID4ZE6>u!mtf{mqHK zGofx5u7pt<{S9>N0cXOIeRU>mrO-F7Fm@-bgZj)X;WyG9d6mXKKAk?@>r zf?q#mLgv?xn2@3C*N>Or*AJPHP~W)BA>qKUA3VXKA0Xk4C#2W+B$UYQ3V6a&F^v-1 zTt7kr(dP+7KS07Myp(YFTlzu>A%qY@2qA>{0<#VH;7uMO!2kdN07*qoM6N<$g0|l7 AUjP6A literal 0 HcmV?d00001 diff --git a/android/src/main/res/drawable-xxxhdpi/baseline_lens_black_24.png b/android/src/main/res/drawable-xxxhdpi/baseline_lens_black_24.png new file mode 100755 index 0000000000000000000000000000000000000000..4ae2cfcefa608c49f8a2457a90efe815e23a706d GIT binary patch literal 678 zcmV;X0$KfuP)A)CZCmT0cK^nxp00Lwz7z9tX0A{u5C{YU zfiea%n{^!G0{5vw5Nf#31rD)}*$ku%ClxV*9Xvt8=n2~yP7%&%%@*Dv5%!i%w7{}t zCUXgip;L?^5i5#VNF}16*UTpmqdcZik0`93Nq892meYuaPSX?vhVc>6)Cc;ZmB$K1 zYd@Kfhb9>uMhtX-3^d5+B4VhEad4d@3F(oKc%pJr+x5!0-9PS{N zxg+%Tlj&zSiA~q9osOdx~ zj!ML#?h{8u#v_h3o(RP80CBAQczUlt`fG3D`fulckji_+!QPWfSo$N5)}OGfK^$!j zVY!Al+BL$E!wGuD^+W*EU5QjTJNcRwjyGBUQ5Qn=*NY#kL zRTI)@#Nj^s;0^fxC*=B{*#DQ&6Ntl|@c*L(GaLHDT=$0lIGyYCfF{S^LrV7t^?sjL zaerdVFH?*DpWKCqh-2MuR0|vs$7{r)9uVjMMLxeRvqA^=uRlKDY5)aPB9^P7fEaW| zEZ4bVZ+Kcm%u>06Sn3K&eD6q=d(a;hs>8LKVh0zLo`BkN=RuKEy!#NI?^i zrP{aOFUCWwQG7r&^^x8f&|KRQl;#-XF^PJ`PduaWFe-=nibidfEF=p{hR67GI>iXA zYr!VoA`$kEEi}a$=?rIk*oQ%PFq|};RK{TDvVkKej^hRbfj}Ve3&J3XSBE*cZ~y=R M07*qoM6N<$g3uKX@DpM?15)OP(d#NaQ6U^^kh@aaTA8H1n7`g@^J;DhaK$5l00IaQ+5%4qCyOb&006i~B&(JI z06$o_4S*=?fa?s~20(&!z&GoFTfPB;AHePv0t66100C~|YyK|2_S#~0)(=_J)CX8SL=Xy z+koqg+6F}9ECar?VfiCp1j}|mvt~1?58VO?Ab!`GKm zSe*`c7%(TXNHDoI2%b>m;0#nvV{#}{`K0siALqVXbu}l>0D)M}jsoSs73O+55e6%# z2`gtF>z$LKxn`j{YlOdZAbZdRS&fXN0&E5wly>WCUf7mW&dd7Z=<3Qh=X$$w=FBjRe z{x<`Y)Vk973mi@tep6nctULKt#QBo8(lp=pnLx1jEo*Fl8S95&sSKcJ89ZJ6T-G@y GGywqm31x@? literal 0 HcmV?d00001 diff --git a/android/src/main/res/drawable-xxxhdpi/baseline_looks_two_black_24.png b/android/src/main/res/drawable-xxxhdpi/baseline_looks_two_black_24.png new file mode 100755 index 0000000000000000000000000000000000000000..5f7d8de0292bacf690d0fc71e57197a3c3aaef81 GIT binary patch literal 391 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD0wg^q?%&M7!06}c;uuoF`1bZuN9RBRw};KU zHy=stHD!=h@I4^6oM8)7kV_Dgrs7J5OosBEYd)%<;Q5oT^~216-3Lc6&81Uc^EIia(zy^HpU{m(sxlA}f^wC7ULmoUnjV?hJ#RghJVC7U#`= zZ@88*xF(gSauqnfY1%00z`)2NaKP-r=2?>Ivz;$Da7;BgJ2Rc(fWh^Bj0TTo15WMB zXIN9k-c!MD@~e8{-WUB$ECL`s7Adn0XVvaIac;)477gBLmKbA~D`7fJX`NA)?B5vJ zrwDD0Y_dI|6)3&+r?;io6t5Xueg)q@aeQlabQtGHcaWtH496R0NV0J#G%zr6ESOsb z7Gm_{Y=HJ9HgAQIJS$^ndp+DlWa6RH&daRg(r4)Gr;Lh>vNFb-+~ z&k};~Ig4>rXZQxEQnbc6uGXY*q?l=#5NaC5IFMlxCZt+K2Fo61GbY5^%p+KIFFP?I z*G}%mk}MlA5!42#EpU(G}K@er$(9oAETXEl}KQz^l(5~eD<)WoBFwyS~%ktT>V{ZxInk&h>Tt73;> z!w^-kzwu<9B62cmY)CU%(QO^*y`}ocD#eyk)d$8~sErWA&hsQTJ;`~o=WvwD6k*M< zt-09q9A&8dpjfLHVOx=6&+!8)y~Ln~xX@7S+Y6Ny;;N?v7b-X@bY6i%IYy{HxY9@L zU4iHWG2}&Dc|q*`e(*KWK3qC1bgzM^yAUxEmnI6`yCIq(L^ML??vrSG@Xw%6aOsoa zpF>-Ph(~eh5uy85MA9}sgG(9lB19yugVMN^78j8s>CmG9mkNaL7lQu@Rl}uf!T*G| z#QL9j3!-I0#HYCQsnC5HqFF*jV_a$^bf1N&N353;J%TUhcH`2X;0Ijq=lXIwQoo zVtKSU47E36dAR!qdaO|dPPcZvK10!MEuQ>~QPjW?FF5|ilYF+RV*7=3#k8G#SC@R# zD95idcb9xnpuT2Z$HVyXkh;Tq^6}wyhZo&hPZ!;<;nQ%8x=z#8(Wt?2e9LkWqc1Kn zOdR$Y%0-VOu~`E6*xI;F1IGB8yZexUdSN20o&;9N(g;V+3UhhrZzGx99=p5;iyjGm z@b%GT^f;cw-|-*6Z%YcNzI6Bi;w)bhf@d5(L7Brdge1kkmLCBf%L?Uqw X5L|t;c}HRf00000NkvXXu0mjf2vyy& literal 0 HcmV?d00001 diff --git a/android/src/main/res/drawable/baseline_done_all_24.xml b/android/src/main/res/drawable/baseline_done_all_24.xml new file mode 100755 index 000000000..86f9be454 --- /dev/null +++ b/android/src/main/res/drawable/baseline_done_all_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/android/src/main/res/drawable/baseline_lens_24.xml b/android/src/main/res/drawable/baseline_lens_24.xml new file mode 100755 index 000000000..bae536757 --- /dev/null +++ b/android/src/main/res/drawable/baseline_lens_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/android/src/main/res/drawable/baseline_looks_3_24.xml b/android/src/main/res/drawable/baseline_looks_3_24.xml new file mode 100755 index 000000000..2f5c067c5 --- /dev/null +++ b/android/src/main/res/drawable/baseline_looks_3_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/android/src/main/res/drawable/baseline_looks_one_24.xml b/android/src/main/res/drawable/baseline_looks_one_24.xml new file mode 100755 index 000000000..28c85725b --- /dev/null +++ b/android/src/main/res/drawable/baseline_looks_one_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/android/src/main/res/drawable/baseline_looks_two_24.xml b/android/src/main/res/drawable/baseline_looks_two_24.xml new file mode 100755 index 000000000..2ed25cc98 --- /dev/null +++ b/android/src/main/res/drawable/baseline_looks_two_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/android/src/main/res/drawable/baseline_trip_origin_24.xml b/android/src/main/res/drawable/baseline_trip_origin_24.xml new file mode 100755 index 000000000..466c9dcaa --- /dev/null +++ b/android/src/main/res/drawable/baseline_trip_origin_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/android/src/main/res/drawable/breakdown2019_cargo.xml b/android/src/main/res/drawable/breakdown2019_cargo.xml new file mode 100644 index 000000000..6c10be95e --- /dev/null +++ b/android/src/main/res/drawable/breakdown2019_cargo.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/android/src/main/res/drawable/breakdown2019_hatch_panel.xml b/android/src/main/res/drawable/breakdown2019_hatch_panel.xml new file mode 100644 index 000000000..fb78c9463 --- /dev/null +++ b/android/src/main/res/drawable/breakdown2019_hatch_panel.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/android/src/main/res/drawable/breakdown2019_null_hatch_panel.xml b/android/src/main/res/drawable/breakdown2019_null_hatch_panel.xml new file mode 100644 index 000000000..0392a53ae --- /dev/null +++ b/android/src/main/res/drawable/breakdown2019_null_hatch_panel.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/android/src/main/res/layout/match_breakdown_2019.xml b/android/src/main/res/layout/match_breakdown_2019.xml new file mode 100644 index 000000000..26e309be6 --- /dev/null +++ b/android/src/main/res/layout/match_breakdown_2019.xml @@ -0,0 +1,532 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/src/main/res/values-v21/strings_2018_breakdown.xml b/android/src/main/res/values/strings_2018_breakdown.xml similarity index 100% rename from android/src/main/res/values-v21/strings_2018_breakdown.xml rename to android/src/main/res/values/strings_2018_breakdown.xml diff --git a/android/src/main/res/values/strings_2019_breakdown.xml b/android/src/main/res/values/strings_2019_breakdown.xml new file mode 100644 index 000000000..45382bba1 --- /dev/null +++ b/android/src/main/res/values/strings_2019_breakdown.xml @@ -0,0 +1,18 @@ + + + Robot 1 Sandstorm + Robot 2 Sandstorm + Robot 3 Sandstorm + Sandstorm Bonus Points + Cargo Ship + Rocket 1 + Rocket 2 + Total Hatch Panels + Total Cargo + Robot 1 HAB Climb + Robot 2 HAB Climb + Robot 3 HAB Climb + HAB Climb Points + Completed Rocket + HAB Docking + \ No newline at end of file diff --git a/android/src/main/res/values/strings_score_breakdown.xml b/android/src/main/res/values/strings_score_breakdown.xml index 440ec05d9..fd15de0c7 100644 --- a/android/src/main/res/values/strings_score_breakdown.xml +++ b/android/src/main/res/values/strings_score_breakdown.xml @@ -8,6 +8,7 @@ Total Teleop %1$d (+ %1$d) + %1$d (+ %2$d) (+ %1$d RP) %1$d RP Fouls diff --git a/android/src/test/java/com/thebluealliance/androidclient/subscribers/MatchBreakdownSubscriberTest.java b/android/src/test/java/com/thebluealliance/androidclient/subscribers/MatchBreakdownSubscriberTest.java index d88fb21df..9e4ae0b72 100644 --- a/android/src/test/java/com/thebluealliance/androidclient/subscribers/MatchBreakdownSubscriberTest.java +++ b/android/src/test/java/com/thebluealliance/androidclient/subscribers/MatchBreakdownSubscriberTest.java @@ -31,6 +31,8 @@ public class MatchBreakdownSubscriberTest { private Match mMatch2015; private Match mMatch2016; private Match mMatch2017; + private Match mMatch2018; + private Match mMatch2019; @Before public void setUp() { @@ -41,6 +43,8 @@ public void setUp() { mMatch2015 = ModelMaker.getModel(Match.class, "2015necmp_qm1"); mMatch2016 = ModelMaker.getModel(Match.class, "2016ctwat_qm6"); mMatch2017 = ModelMaker.getModel(Match.class, "2017week0_qm7"); + mMatch2018 = ModelMaker.getModel(Match.class, "2018week0_qm1"); + mMatch2019 = ModelMaker.getModel(Match.class, "2019week0_qm6"); } @Test @@ -87,6 +91,36 @@ public void testParsedData2017KillSwitch() { assertNull(data); } + + @Test + public void testParsedData2018() { + when(mConfig.getBoolean(MatchBreakdownSubscriber.SHOW_2018_KEY)).thenReturn(true); + MatchBreakdownBinder.Model data = DatafeedTestDriver.getParsedData(mSubscriber, mMatch2018); + assertEquals(getExpected(mMatch2018), data); + } + + @Test + public void testParsedData2018KillSwitch() { + when(mConfig.getBoolean(MatchBreakdownSubscriber.SHOW_2018_KEY)).thenReturn(false); + MatchBreakdownBinder.Model data = DatafeedTestDriver.getParsedData(mSubscriber, mMatch2018); + assertNull(data); + } + + + @Test + public void testParsedData2019() { + when(mConfig.getBoolean(MatchBreakdownSubscriber.SHOW_2019_KEY)).thenReturn(true); + MatchBreakdownBinder.Model data = DatafeedTestDriver.getParsedData(mSubscriber, mMatch2019); + assertEquals(getExpected(mMatch2019), data); + } + + @Test + public void testParsedData2019KillSwitch() { + when(mConfig.getBoolean(MatchBreakdownSubscriber.SHOW_2019_KEY)).thenReturn(false); + MatchBreakdownBinder.Model data = DatafeedTestDriver.getParsedData(mSubscriber, mMatch2019); + assertNull(data); + } + private MatchBreakdownBinder.Model getExpected(Match match) { return new MatchBreakdownBinder.Model(match.getType(), match.getYear(), diff --git a/android/src/test/resources/2018week0_qm1.json b/android/src/test/resources/2018week0_qm1.json new file mode 100644 index 000000000..51b9415ca --- /dev/null +++ b/android/src/test/resources/2018week0_qm1.json @@ -0,0 +1,120 @@ +{ + "actual_time": 1518901106, + "alliances": { + "blue": { + "dq_team_keys": [], + "score": 267, + "surrogate_team_keys": [], + "team_keys": [ + "frc78", + "frc5813", + "frc5459" + ] + }, + "red": { + "dq_team_keys": [], + "score": 267, + "surrogate_team_keys": [], + "team_keys": [ + "frc238", + "frc5687", + "frc3323" + ] + } + }, + "comp_level": "f", + "event_key": "2018week0", + "key": "2018week0_f1m1", + "match_number": 1, + "post_result_time": 1518901301, + "predicted_time": 1518901029, + "score_breakdown": { + "blue": { + "adjustPoints": 0, + "autoOwnershipPoints": 20, + "autoPoints": 30, + "autoQuestRankingPoint": false, + "autoRobot1": "AutoRun", + "autoRobot2": "AutoRun", + "autoRobot3": "None", + "autoRunPoints": 10, + "autoScaleOwnershipSec": 0, + "autoSwitchAtZero": true, + "autoSwitchOwnershipSec": 10, + "endgamePoints": 65, + "endgameRobot1": "Levitate", + "endgameRobot2": "Climbing", + "endgameRobot3": "Parking", + "faceTheBossRankingPoint": false, + "foulCount": 1, + "foulPoints": 0, + "rp": 0, + "tba_rpEarned": null, + "techFoulCount": 0, + "teleopOwnershipPoints": 152, + "teleopPoints": 237, + "teleopScaleBoostSec": 0, + "teleopScaleForceSec": 0, + "teleopScaleOwnershipSec": 6, + "teleopSwitchBoostSec": 10, + "teleopSwitchForceSec": 0, + "teleopSwitchOwnershipSec": 136, + "totalPoints": 267, + "vaultBoostPlayed": 0, + "vaultBoostTotal": 1, + "vaultForcePlayed": 0, + "vaultForceTotal": 0, + "vaultLevitatePlayed": 3, + "vaultLevitateTotal": 3, + "vaultPoints": 20 + }, + "red": { + "adjustPoints": 0, + "autoOwnershipPoints": 0, + "autoPoints": 10, + "autoQuestRankingPoint": false, + "autoRobot1": "AutoRun", + "autoRobot2": "AutoRun", + "autoRobot3": "None", + "autoRunPoints": 10, + "autoScaleOwnershipSec": 0, + "autoSwitchAtZero": false, + "autoSwitchOwnershipSec": 0, + "endgamePoints": 40, + "endgameRobot1": "Levitate", + "endgameRobot2": "Parking", + "endgameRobot3": "Parking", + "faceTheBossRankingPoint": false, + "foulCount": 0, + "foulPoints": 5, + "rp": 0, + "tba_rpEarned": null, + "techFoulCount": 0, + "teleopOwnershipPoints": 187, + "teleopPoints": 252, + "teleopScaleBoostSec": 0, + "teleopScaleForceSec": 0, + "teleopScaleOwnershipSec": 81, + "teleopSwitchBoostSec": 0, + "teleopSwitchForceSec": 10, + "teleopSwitchOwnershipSec": 106, + "totalPoints": 267, + "vaultBoostPlayed": 0, + "vaultBoostTotal": 0, + "vaultForcePlayed": 1, + "vaultForceTotal": 2, + "vaultLevitatePlayed": 2, + "vaultLevitateTotal": 3, + "vaultPoints": 25 + } + }, + "set_number": 1, + "time": 1518899400, + "videos": [ + { + "key": "8hYdD7qnuKo", + "type": "youtube" + } + ], + "winning_alliance": "" +} \ No newline at end of file diff --git a/android/src/test/resources/2019week0_qm6.json b/android/src/test/resources/2019week0_qm6.json new file mode 100644 index 000000000..620037c73 --- /dev/null +++ b/android/src/test/resources/2019week0_qm6.json @@ -0,0 +1,148 @@ +{ + "actual_time": 1550330637, + "alliances": { + "blue": { + "dq_team_keys": [], + "score": 47, + "surrogate_team_keys": [], + "team_keys": [ + "frc1721", + "frc58", + "frc3236" + ] + }, + "red": { + "dq_team_keys": [], + "score": 26, + "surrogate_team_keys": [], + "team_keys": [ + "frc811", + "frc3986", + "frc1729" + ] + } + }, + "comp_level": "qm", + "event_key": "2019week0", + "key": "2019week0_qm6", + "match_number": 6, + "post_result_time": 1550330813, + "predicted_time": 1550330766, + "score_breakdown": { + "blue": { + "adjustPoints": 0, + "autoPoints": 9, + "bay1": "Panel", + "bay2": "Panel", + "bay3": "Panel", + "bay4": "None", + "bay5": "None", + "bay6": "Panel", + "bay7": "Panel", + "bay8": "Panel", + "cargoPoints": 0, + "completeRocketRankingPoint": false, + "completedRocketFar": false, + "completedRocketNear": false, + "endgameRobot1": "HabLevel1", + "endgameRobot2": "HabLevel3", + "endgameRobot3": "HabLevel1", + "foulCount": 0, + "foulPoints": 10, + "habClimbPoints": 18, + "habDockingRankingPoint": true, + "habLineRobot1": "CrossedHabLineInSandstorm", + "habLineRobot2": "CrossedHabLineInSandstorm", + "habLineRobot3": "CrossedHabLineInSandstorm", + "hatchPanelPoints": 10, + "lowLeftRocketFar": "Panel", + "lowLeftRocketNear": "Panel", + "lowRightRocketFar": "None", + "lowRightRocketNear": "None", + "midLeftRocketFar": "Panel", + "midLeftRocketNear": "Panel", + "midRightRocketFar": "None", + "midRightRocketNear": "None", + "preMatchBay1": "Panel", + "preMatchBay2": "Panel", + "preMatchBay3": "Panel", + "preMatchBay6": "Panel", + "preMatchBay7": "Panel", + "preMatchBay8": "Panel", + "preMatchLevelRobot1": "HabLevel1", + "preMatchLevelRobot2": "HabLevel1", + "preMatchLevelRobot3": "HabLevel1", + "rp": 3, + "sandStormBonusPoints": 9, + "techFoulCount": 0, + "teleopPoints": 28, + "topLeftRocketFar": "Panel", + "topLeftRocketNear": "None", + "topRightRocketFar": "None", + "topRightRocketNear": "None", + "totalPoints": 47 + }, + "red": { + "adjustPoints": 0, + "autoPoints": 12, + "bay1": "None", + "bay2": "Panel", + "bay3": "PanelAndCargo", + "bay4": "None", + "bay5": "None", + "bay6": "Panel", + "bay7": "Panel", + "bay8": "Panel", + "cargoPoints": 3, + "completeRocketRankingPoint": false, + "completedRocketFar": false, + "completedRocketNear": false, + "endgameRobot1": "HabLevel1", + "endgameRobot2": "HabLevel1", + "endgameRobot3": "HabLevel1", + "foulCount": 0, + "foulPoints": 0, + "habClimbPoints": 9, + "habDockingRankingPoint": false, + "habLineRobot1": "CrossedHabLineInSandstorm", + "habLineRobot2": "CrossedHabLineInSandstorm", + "habLineRobot3": "CrossedHabLineInSandstorm", + "hatchPanelPoints": 2, + "lowLeftRocketFar": "None", + "lowLeftRocketNear": "None", + "lowRightRocketFar": "None", + "lowRightRocketNear": "None", + "midLeftRocketFar": "None", + "midLeftRocketNear": "None", + "midRightRocketFar": "None", + "midRightRocketNear": "None", + "preMatchBay1": "Cargo", + "preMatchBay2": "Panel", + "preMatchBay3": "Panel", + "preMatchBay6": "Panel", + "preMatchBay7": "Panel", + "preMatchBay8": "Panel", + "preMatchLevelRobot1": "HabLevel1", + "preMatchLevelRobot2": "HabLevel1", + "preMatchLevelRobot3": "HabLevel2", + "rp": 0, + "sandStormBonusPoints": 12, + "techFoulCount": 1, + "teleopPoints": 14, + "topLeftRocketFar": "None", + "topLeftRocketNear": "Panel", + "topRightRocketFar": "None", + "topRightRocketNear": "None", + "totalPoints": 26 + } + }, + "set_number": 1, + "time": 1550327700, + "videos": [ + { + "key": "n3fDuqHxh7w", + "type": "youtube" + } + ], + "winning_alliance": "blue" +} \ No newline at end of file