Skip to content

Commit 5d35cf8

Browse files
committed
Updating SDK
1 parent f248ce0 commit 5d35cf8

File tree

11 files changed

+200
-19
lines changed

11 files changed

+200
-19
lines changed

.idea/misc.xml

+14-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 26
5-
buildToolsVersion "26.0.2"
4+
compileSdkVersion 28
5+
buildToolsVersion '28.0.3'
66
defaultConfig {
77
applicationId "uk.co.agnate.eldercare"
88
minSdkVersion 15
9-
targetSdkVersion 26
10-
versionCode 17
9+
targetSdkVersion 28
10+
versionCode 18
1111
versionName "1.1"
1212
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1313
}
@@ -20,12 +20,12 @@ android {
2020
}
2121

2222
dependencies {
23-
compile fileTree(dir: 'libs', include: ['*.jar'])
24-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
23+
implementation fileTree(dir: 'libs', include: ['*.jar'])
24+
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
2525
exclude group: 'com.android.support', module: 'support-annotations'
2626
})
27-
compile 'com.android.support:appcompat-v7:26.+'
28-
compile 'com.android.support.constraint:constraint-layout:1.0.2'
29-
compile 'com.android.support:design:26.+'
30-
testCompile 'junit:junit:4.12'
27+
implementation 'com.android.support:appcompat-v7:28.0.0'
28+
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
29+
implementation 'com.android.support:design:28.0.0'
30+
testImplementation 'junit:junit:4.12'
3131
}

app/src/main/AndroidManifest.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="uk.co.agnate.eldercare"
4-
android:installLocation="auto">
4+
android:installLocation="auto"
5+
android:name="android.permission.WRITE_EXTERNAL_STORAGE">
56

67
<application
78
android:allowBackup="true"

app/src/main/assets/about.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h1>About</h1>
3232
<p>This app has been designed as an educational resource for medicine in the eldery with the support of the staff and students of the eldercare department at Royal Cornwall Hospital, UK.</p>
3333
<p>Built with Bootstrap 4, HTML5, Font Awesome, Orgnode, Android Studio, Apple Xcode. Where possible all original scientific works have been cited with a journal reference and all registered trademarks and copyright acknowledged.</p>
3434
<p>This compilation of educational material and its <a href="https://github.com/rdjenkins/eldercare">source code</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.</p>
35-
<p>Version: 06 November 2017</p><!-- automatically updated -->
35+
<p>Version: 01 May 2019</p><!-- automatically updated -->
3636
<p>Contributors:<br>
3737
<a href="https://about.me/deanjenkins">Dr Dean Jenkins</a></p>
3838
</div><!-- /.container -->

app/src/main/assets/js/scales/CGIS.js

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// Clinical Global Impressions Scale Calculator
2+
// Javascript to load a bootstrap-styled calculator on a page
3+
// created 24/Oct/2017 Dean Jenkins
4+
5+
// Since I don't like the way some websites covet these trivial algorithms
6+
// and try to monetize them by licensing them or pushing adverts this
7+
// code has been released under the following license.
8+
// Creative Commons Attribution 4.0 International (CC BY 4.0)
9+
// https://creativecommons.org/licenses/by/4.0/
10+
11+
12+
function CGIS()
13+
{
14+
15+
var CGIS=getvaluefromradio("tblable_calc_form_CGIS");
16+
17+
var score = parseFloat(CGIS);
18+
document.getElementById("tblable_calc_form_score").innerHTML = score.toString();
19+
20+
var summaryhtml="";
21+
var source=". from Busner & Targum (2007, table 1).";
22+
23+
if (score==1) {
24+
summaryhtml = summaryhtml + "Normal" + source;
25+
$('#result').removeClass();
26+
$('#result').addClass("alert alert-success");
27+
}
28+
if (score>1 && score <5) {
29+
$('#result').removeClass();
30+
$('#result').addClass("alert alert-warning");
31+
}
32+
if (score>4) {
33+
$('#result').removeClass();
34+
$('#result').addClass("alert alert-danger");
35+
}
36+
37+
if (score==2) {
38+
summaryhtml = summaryhtml + "Borderline mentally ill" + source;
39+
}
40+
41+
if (score==3) {
42+
summaryhtml = summaryhtml + "Mildly ill" + source;
43+
}
44+
45+
if (score==4) {
46+
summaryhtml = summaryhtml + "Moderately ill" + source;
47+
}
48+
49+
if (score==5) {
50+
summaryhtml = summaryhtml + "Markedly ill" + source;
51+
}
52+
53+
if (score==6) {
54+
summaryhtml = summaryhtml + " Severely ill" + source;
55+
}
56+
57+
if (score==7) {
58+
summaryhtml = summaryhtml + " Among the most extremely ill patients" + source;
59+
}
60+
61+
62+
document.getElementById("tblable_calc_form_comment").innerHTML = summaryhtml;
63+
}
64+
65+
function resetCalc() {
66+
uncheckradio("tblable_calc_form_CGIS");
67+
checkradio("tblable_calc_form_CGIS1"); // CGIS normal is 1
68+
}
69+
70+
71+
var calculatorHTML = '' +
72+
'<div class="calculator" id="tblable_calc">' +
73+
74+
' <div name="hform" id="tblable_calc_form">' +
75+
76+
headerBlurb("CGI-Severity","Clinical Global Impressions Scale for mental illness","Select the most appropriate") +
77+
78+
79+
simpleradio("tblable_calc_form_CGIS1","tblable_calc_form_CGIS","1","<b>Normal</b> (1). not at all ill, symptoms of disorder not present past seven days","CGIS();") +
80+
simpleradio("tblable_calc_form_CGIS2","tblable_calc_form_CGIS","2","<b>Borderline mentally ill</b> (2). subtle or suspected pathology","CGIS();") +
81+
simpleradio("tblable_calc_form_CGIS3","tblable_calc_form_CGIS","3","<b>Mildly ill</b> (3). clearly established symptoms with minimal, if any, distress or difficulty in social and occupational function","CGIS();") +
82+
simpleradio("tblable_calc_form_CGIS4","tblable_calc_form_CGIS","4","<b>Moderately ill</b> (4). overt symptoms causing noticeable, but modest, functional impairment or distress; symptom level may warrant medication","CGIS();") +
83+
simpleradio("tblable_calc_form_CGIS5","tblable_calc_form_CGIS","5","<b>Markedly ill</b> (5). intrusive symptoms that distinctly impair social/occupational function or cause intrusive levels of distress","CGIS();") +
84+
simpleradio("tblable_calc_form_CGIS6","tblable_calc_form_CGIS","6","<b>Severely ill</b> (6). disruptive pathology, behavior and function are frequently influenced by symptoms, may require assistance from others","CGIS();") +
85+
simpleradio("tblable_calc_form_CGIS7","tblable_calc_form_CGIS","7","<b>Among the most extremely ill patients</b> (7). pathology drastically interferes in many life functions; may be hospitalized","CGIS();") +
86+
87+
88+
' <div id="result" class="alert alert-success">' +
89+
' <div><b>CGI-S Scale = <span id="tblable_calc_form_score"></span></b>. ' +
90+
' <span id="tblable_calc_form_comment"></span></div>' +
91+
' </div>' +
92+
93+
' <div class="reset">' +
94+
' <input value="Reset" class="btn btn-secondary" onclick="resetCalc(); CGIS(); return false;" type="reset">' +
95+
' </div>' +
96+
97+
' </div><!-- end hform -->' +
98+
99+
'</div><!-- end calculator -->' +
100+
'<p class="small">Source <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2880930/">Busner & Targum (2007)</a></p>' +
101+
'';
102+
103+
function calcHTML() {
104+
document.write('<div id="calc"></div>');
105+
106+
document.getElementById("calc").innerHTML = calculatorHTML;
107+
}
108+
109+
calcHTML();
110+
resetCalc(); // required to set the default radio button
111+
CGIS();

app/src/main/assets/scale_CGIS.html

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<!-- Required meta tags -->
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
8+
<!-- Bootstrap CSS -->
9+
<link rel="stylesheet" href="css/bootstrap.min.css">
10+
11+
<!-- Custom styles -->
12+
<link href="css/ec.css" rel="stylesheet">
13+
<link href="css/scale.css" rel="stylesheet">
14+
</head>
15+
16+
<body>
17+
18+
<div id="nav_holder"></div>
19+
<script src="js/nav.js"></script>
20+
21+
<!-- JavaScript -->
22+
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
23+
<script src="js/jquery-3.2.1.slim.min.js"></script>
24+
<script src="js/popper.min.js"></script>
25+
<script src="js/bootstrap.min.js"></script>
26+
27+
<div class="container">
28+
<script src="js/scale_functions.js"></script>
29+
<!-- The following is automatically created by go-scales.py -->
30+
<script src="js/scales/CGIS.js"></script>
31+
<noscript><br>Error: javascript required. Please enable javascript.</noscript>
32+
</div><!-- /.container -->
33+
34+
</body>
35+
</html>
36+

app/src/main/assets/scales.html

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ <h3>Orthogeriatrics</h3>
5353
<a href="scale_frax.html" type="button" class="btn btn-secondary">FRAX<sup>&reg;</sup></a>
5454
<a href="scale_qfracture.html" type="button" class="btn btn-secondary">QFracture<sup>&reg;</sup>-2016</a>
5555
</div>
56+
<h3>Psychiatry</h3>
57+
<div class="home_button_list">
58+
<a href="scale_CGIS.html" type="button" class="btn btn-primary">CGI-S</a>
59+
</div>
5660
<h3>Stroke</h3>
5761
<div class="home_button_list">
5862
<a href="scale_abcd2.html" type="button" class="btn btn-primary">ABCD<sub>2</sub></a>

app/src/main/java/uk/co/agnate/eldercare/MainActivity.java

+16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package uk.co.agnate.eldercare;
22

3+
import android.content.ActivityNotFoundException;
34
import android.content.Intent;
45
import android.net.Uri;
56
import android.os.Bundle;
@@ -10,6 +11,8 @@
1011
import android.webkit.WebViewClient;
1112
import android.widget.Toast;
1213

14+
import java.io.File;
15+
1316
public class MainActivity extends AppCompatActivity {
1417

1518
public String starturl = "file:///android_asset/index.html"; // the initial page to load, located in app/src/main/assets folder
@@ -41,6 +44,19 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) {
4144
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
4245
return true; // this used to work on its own but intent above required now
4346
}
47+
if (url.startsWith("Xdata")) {
48+
Toast.makeText(getApplicationContext(), "Opening in browser", Toast.LENGTH_LONG).show();
49+
Uri uri = Uri.parse("googlechrome://navigate?url=" + url);
50+
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
51+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
52+
intent.setPackage("com.android.chrome");
53+
try {
54+
startActivity(intent);
55+
} catch (ActivityNotFoundException ex) {
56+
Toast.makeText(getApplicationContext(), "Browser not found", Toast.LENGTH_LONG).show();
57+
}
58+
return true; // this used to work on its own but intent above required now
59+
}
4460
return false;
4561
}
4662

app/src/main/res/drawable/splash.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
<item>
6-
<shape xmlns:android="http://schemas.android.com/apk/res/android">
6+
<shape>
77
<gradient android:angle="90" android:startColor="#ffffff" android:endColor="#007bff"/>
88
</shape>
99
</item>

build.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
buildscript {
44
repositories {
55
jcenter()
6+
google()
67
}
78
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.0.0'
9+
classpath 'com.android.tools.build:gradle:3.4.1'
910

1011
// NOTE: Do not place your application dependencies here; they belong
1112
// in the individual module build.gradle files
@@ -15,6 +16,7 @@ buildscript {
1516
allprojects {
1617
repositories {
1718
jcenter()
19+
google()
1820
}
1921
}
2022

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sat Oct 28 00:11:35 BST 2017
1+
#Sat Apr 27 18:45:52 BST 2019
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

0 commit comments

Comments
 (0)