Skip to content

Commit 58d4092

Browse files
authored
Merge branch 'develop' into api-copyright
2 parents 4b7548c + 8e996b0 commit 58d4092

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1372
-493
lines changed

api/QCVOC.Api/Veterans/Data/DTO/VeteranEnrollRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class VeteranEnrollRequest
4242
/// <summary>
4343
/// Gets or sets the number of the card presently assigned to the Veteran.
4444
/// </summary>
45-
[Range(minimum: 1000, maximum: 9999)]
45+
[Range(minimum: 0, maximum: 9999)]
4646
public int? CardNumber { get; set; }
4747

4848
/// <summary>

api/QCVOC.Api/Veterans/Data/DTO/VeteranUpdateRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class VeteranUpdateRequest
4242
/// <summary>
4343
/// Gets or sets the number of the card presently assigned to the Veteran.
4444
/// </summary>
45-
[Range(minimum: 1000, maximum: 9999)]
45+
[Range(minimum: 0, maximum: 9999)]
4646
public int? CardNumber { get; set; }
4747

4848
/// <summary>

mobile-new/app/build.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ android {
44
compileSdkVersion 28
55
defaultConfig {
66
applicationId "org.qccoders.qcvoc"
7-
minSdkVersion 24
7+
minSdkVersion 21
88
targetSdkVersion 28
9-
versionCode 1
10-
versionName "1.0"
9+
versionCode 5
10+
versionName "0.5"
1111
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1212
}
1313
buildTypes {
@@ -19,14 +19,12 @@ android {
1919
}
2020

2121
dependencies {
22-
implementation fileTree(dir: 'libs', include: ['*.jar'])
22+
implementation fileTree(include: ['*.jar'], dir: 'libs')
2323
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
2424
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
2525
testImplementation 'junit:junit:4.12'
2626
androidTestImplementation 'com.android.support.test:runner:1.0.2'
2727
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
28-
2928
implementation 'com.google.android.gms:play-services-vision:15.0.2+'
3029
implementation 'com.android.support:design:28+'
31-
3230
}
1.54 MB
Binary file not shown.

mobile-new/app/release/output.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":5,"versionName":"0.5","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

mobile-new/app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package="org.qccoders.qcvoc">
44

55
<uses-permission android:name="android.permission.INTERNET"/>
6-
<uses-feature android:name="android.hardware.Camera"/>
76
<uses-permission android:name="android.permission.CAMERA"/>
87

98
<application

mobile-new/app/src/main/java/org/qccoders/qcvoc/MainActivity.java

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
import android.content.Intent;
99
import android.graphics.Bitmap;
10+
import android.support.design.widget.Snackbar;
1011
import android.support.v7.app.AppCompatActivity;
1112
import android.os.Bundle;
1213
import android.util.Log;
14+
import android.view.KeyEvent;
1315
import android.view.View;
1416
import android.webkit.JavascriptInterface;
1517
import android.webkit.WebView;
@@ -19,9 +21,20 @@
1921
import com.google.android.gms.samples.vision.barcodereader.BarcodeCaptureActivity;
2022
import com.google.android.gms.vision.barcode.Barcode;
2123

24+
import static android.view.KeyEvent.KEYCODE_VOLUME_DOWN;
25+
import static android.view.KeyEvent.KEYCODE_VOLUME_UP;
26+
2227
public class MainActivity extends AppCompatActivity {
2328
private WebView webview;
29+
private boolean developmentEnvironment = false;
2430
private ProgressBar progressBar;
31+
private String callback;
32+
33+
private final int[] environmentCode = {KEYCODE_VOLUME_UP, KEYCODE_VOLUME_UP, KEYCODE_VOLUME_UP,
34+
KEYCODE_VOLUME_DOWN, KEYCODE_VOLUME_UP, KEYCODE_VOLUME_UP, KEYCODE_VOLUME_DOWN,
35+
KEYCODE_VOLUME_UP, KEYCODE_VOLUME_UP, KEYCODE_VOLUME_UP, KEYCODE_VOLUME_UP,
36+
KEYCODE_VOLUME_DOWN};
37+
private int codeIndex = 0;
2538

2639
@Override
2740
protected void onCreate(Bundle savedInstanceState) {
@@ -49,11 +62,13 @@ public void onPageFinished(WebView view, String url) {
4962
webview.addJavascriptInterface(this, "Android");
5063
webview.getSettings().setJavaScriptEnabled(true);
5164
webview.getSettings().setDomStorageEnabled(true);
52-
webview.loadUrl("http://qcvoc-dev.s3-website-us-east-1.amazonaws.com");
65+
webview.loadUrl("http://qcvoc-prod.s3-website-us-east-1.amazonaws.com");
5366
}
5467

5568
@JavascriptInterface
56-
public void scanBarcode() {
69+
public void scanBarcode(String callback) {
70+
this.callback = callback;
71+
5772
Intent intent = new Intent(this, BarcodeCaptureActivity.class);
5873
intent.putExtra(BarcodeCaptureActivity.AutoFocus, true);
5974

@@ -68,8 +83,42 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
6883
Log.d("MainActivity", barcode.displayValue);
6984

7085
webview.evaluateJavascript(
71-
"window.barcodeScanned(" + barcode.displayValue + ");",
86+
callback + "(" + barcode.displayValue + ");",
7287
null);
7388
}
7489
}
90+
91+
@Override
92+
public boolean onKeyUp(int keycode, KeyEvent event) {
93+
94+
if (event.getKeyCode() == environmentCode[codeIndex]) {
95+
codeIndex += 1;
96+
} else {
97+
codeIndex = 0;
98+
}
99+
100+
if (codeIndex == environmentCode.length) {
101+
codeIndex = 0;
102+
developmentEnvironment = !developmentEnvironment;
103+
104+
String message = "Environment switched to " +
105+
(developmentEnvironment ? "development" : "production");
106+
107+
Log.d("MainActivity", message);
108+
109+
Snackbar.make(
110+
findViewById(R.id.mainLayout),
111+
message,
112+
Snackbar.LENGTH_SHORT)
113+
.show();
114+
115+
String newUrl = developmentEnvironment
116+
? "http://qcvoc-dev.s3-website-us-east-1.amazonaws.com"
117+
: "http://qcvoc-prod.s3-website-us-east-1.amazonaws.com";
118+
119+
webview.loadUrl(newUrl);
120+
}
121+
122+
return super.onKeyUp(keycode, event);
123+
}
75124
}

mobile-new/app/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
7+
android:id="@+id/mainLayout"
78
tools:context=".MainActivity">
89

910
<WebView

web/.eslintrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "react-app",
3+
"rules": {
4+
"semi": ["error", "always"],
5+
"comma-dangle": ["error", "always-multiline"],
6+
"no-const-assign": "error"
7+
},
8+
"parserOptions": {
9+
"ecmaVersion": 7,
10+
"sourceType": "module",
11+
"ecmaFeatures": {
12+
"jsx": true
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)