Skip to content

Commit

Permalink
Field diagram bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
widavies committed Feb 27, 2020
1 parent f2ecc0c commit c028f3d
Show file tree
Hide file tree
Showing 40 changed files with 339 additions and 157 deletions.
127 changes: 127 additions & 0 deletions .idea/assetWizardSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/kotlinc.xml

This file was deleted.

53 changes: 1 addition & 52 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/encodings.xml → .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:3.1.1'
}
}
Expand Down Expand Up @@ -57,8 +57,8 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
pickFirst 'META-INF/DEPENDENCIES.txt'
Expand Down Expand Up @@ -93,7 +93,7 @@ dependencies {
implementation 'com.roughike:bottom-bar:2.1.1'
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
implementation 'pub.devrel:easypermissions:0.2.1'
implementation 'com.google.guava:guava:24.1-android'
implementation 'com.google.guava:guava:24.1-jre'
// ignore this warning
implementation 'com.jrummyapps:colorpicker:2.1.6'
implementation 'com.github.infotech-group:CanvasView:release'
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<application
android:name="android.support.multidex.MultiDexApplication"
android:allowBackup="true"
android:icon="@drawable/launcher"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme">
Expand Down
Binary file added app/src/main/ic_launcher-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app/src/main/java/com/cpjd/roblu/models/RSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public void setRui(RUI rui) {
rui.setUploadRequired(true);
this.rui = rui;
}

public void setServerIPToDefault() {
this.setServerIP("ec2-13-59-164-241.us-east-2.compute.amazonaws.com");
this.setServerIP("roblucloud-legacy.centralus.cloudapp.azure.com");
}

}
13 changes: 13 additions & 0 deletions app/src/main/java/com/cpjd/roblu/models/RTeam.java
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,19 @@ public void removeTab(int position) {
public ArrayList<RMetric> getMetrics(int page) {
return tabs.get(page).getMetrics();
}

public RMetric getMetric(int page, int id) {
ArrayList<RMetric> metrics = getMetrics(page);

for(RMetric metric : metrics) {
if(metric.getID() == id) {
return metric;
}
}

return null;
}

/**
* Removes all the tab except the PIT and PREDICTIONS tabs
*/
Expand Down
7 changes: 3 additions & 4 deletions app/src/main/java/com/cpjd/roblu/ui/forms/MetricEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public class MetricEditor extends AppCompatActivity implements AdapterView.OnIte
* To add a new year, add a new year at the beginning of this array &
* add a corresponding drawable ID in RMetricToUI
*/
private String[] fieldDiagramYears = {"2019", "2018"};
private String[] fieldDiagramYears = {"2020", "2019", "2018"};

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -151,9 +151,8 @@ protected void onCreate(Bundle savedInstanceState) {
metric.setModified(true);
addMetricPreviewToToolbar();
buildConfigLayout();

} else {
// add a RBoolean type, it's the default loaded type until the user selects a different one
// Add a RBoolean type, it's the default loaded type until the user selects a different one
metric = new RBoolean(0, "Boolean", false);
/*
* The modified variable DOES NOT matter in the form, so always, always make sure it's true
Expand Down Expand Up @@ -485,7 +484,7 @@ private void addMetricPreviewToToolbar() {
else if(metric instanceof RTextfield) toolbar.addView(rMetricToUI.getTextfield((RTextfield) metric));
else if(metric instanceof RGallery) toolbar.addView(rMetricToUI.getGallery(true, 0, 0, ((RGallery)metric)));
else if(metric instanceof RDivider) toolbar.addView(rMetricToUI.getDivider((RDivider)metric));
else if(metric instanceof RFieldDiagram) toolbar.addView(rMetricToUI.getFieldDiagram(-1, (RFieldDiagram)metric));
else if(metric instanceof RFieldDiagram) toolbar.addView(rMetricToUI.getFieldDiagram(-1, -1, -1, (RFieldDiagram)metric));
else if(metric instanceof RCalculation) toolbar.addView(rMetricToUI.getCalculationMetric(null, ((RCalculation)metric)));
else if(metric instanceof RFieldData) toolbar.addView(rMetricToUI.getFieldData((RFieldData)metric));
}
Expand Down
Loading

0 comments on commit c028f3d

Please sign in to comment.