Skip to content

Commit

Permalink
Fix match schedule downloading and main menu logo centering
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerng committed Feb 16, 2019
1 parent 9116daa commit 4c255ce
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected String doInBackground(Void... voids) {
return "Invalid Blue Alliance API key";
}

if (!eventCode.equals("")) {
if (!eventCode.isEmpty()) {

try {
FileManager.saveFile(scoreBreakdownFilePath, getEventMatchData(eventCode), c);
Expand All @@ -93,15 +93,15 @@ protected String doInBackground(Void... voids) {


String teamList = getTeamList(eventCode);
if (teamList.equals("")) {
if (teamList.isEmpty()) {
return "Event data not found on The Blue Alliance";
} else {
FileManager.saveFile(teamListFilePath, teamList, c);
}


String matchList = getMatchList(eventCode);
if (matchList.equals("")) {
if (matchList.isEmpty()) {
return "Only team list downloaded";
} else {
FileManager.saveFile(matchListFilePath, matchList, c);
Expand Down Expand Up @@ -160,9 +160,11 @@ private String getMatchList(String eventCode) throws IOException {
matchList.append(match.getBlueAlliance().getTeamKeys()[j].split("frc")[1]).append(",");
}
}
matchList.append(",\n");

}

matchList.append("\n");


}

Expand All @@ -181,7 +183,7 @@ protected void onPostExecute(String message) {
super.onPostExecute(message);

// Display response message, if any
if (!message.equals("")) {
if (!message.isEmpty()) {
Toast.makeText(c, message, Toast.LENGTH_SHORT).show();
}
}
Expand Down
40 changes: 24 additions & 16 deletions scoutingapp/src/main/res/layout/activity_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,24 +163,32 @@
android:layout_above="@+id/current_info_label"
android:layout_below="@id/settings"
android:layout_centerHorizontal="true"
android:layout_marginTop="60dp">


<ImageView
android:id="@+id/raider_robotix_logo"
android:layout_width="175dp"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_marginEnd="30dp"
android:src="@drawable/team_25_logo" />
android:layout_marginTop="60dp">

<ImageView
android:id="@+id/game_logo_view"
android:layout_width="250dp"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/raider_robotix_logo"
android:src="@drawable/deep_space_logo" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true">

<ImageView
android:id="@+id/raider_robotix_logo"
android:layout_width="175dp"
android:layout_height="match_parent"
android:layout_centerVertical="true"

android:layout_marginEnd="30dp"
android:src="@drawable/team_25_logo" />

<ImageView
android:id="@+id/game_logo_view"
android:layout_width="250dp"

android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/raider_robotix_logo"
android:src="@drawable/deep_space_logo" />
</LinearLayout>

</RelativeLayout>
</RelativeLayout>
2 changes: 1 addition & 1 deletion scoutingapp/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
note that there is no trailing zero for the patch version. Tags on GitHub follow the same scheme,
except the letter "v" is appended to the version number.
Version 1.0 was created for the 2017 FRC season (FIRST Steamworks).-->
<string name="version_number">v3.1</string>
<string name="version_number">v3.11</string>

<!-- Name of the cheatsheet file in /assets-->
<string name="cheatsheet_filename">Deep Space Cheatsheet.pdf</string>
Expand Down

0 comments on commit 4c255ce

Please sign in to comment.