Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Commit

Permalink
Added:
Browse files Browse the repository at this point in the history
	-Next/Previous arrows to navigate subtasks as needed
	-Cancel/Re-administer buttons to each subtask

Changed:
	-changed RBE calculation method
	-changed app theme to olive green
	-changed beep length to 300 ms

Fixed:
	-fixed and readded Up arrows Edit Profile and Results View screens
  • Loading branch information
humzakh committed Feb 18, 2018
1 parent 2c970a8 commit 04e32a9
Show file tree
Hide file tree
Showing 82 changed files with 4,730 additions and 170 deletions.
55 changes: 30 additions & 25 deletions src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.best">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

<application
android:allowBackup="true"
Expand All @@ -12,15 +12,14 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.best"
android:grantUriPermissions="true"
android:exported="false">
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
android:resource="@xml/filepaths"/>
</provider>

<activity
Expand Down Expand Up @@ -73,97 +72,97 @@
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.RVE.RVEInstructions"
android:name=".subtasks.A_RVE.RVEInstructions"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.RVE.RVETest"
android:name=".subtasks.A_RVE.RVETest"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.RVE.RVEDone"
android:name=".subtasks.A_RVE.RVEDone"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.PRE.PREInstructions"
android:name=".subtasks.B_PRE.PREInstructions"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.PRE.PRE1Test"
android:name=".subtasks.B_PRE.PRE1Test"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.PRE.PREInterim"
android:name=".subtasks.B_PRE.PREInterim"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.PRE.PRE2Test"
android:name=".subtasks.B_PRE.PRE2Test"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.PVE.PVEInstructions"
android:name=".subtasks.C_PVE.PVEInstructions"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.PVE.PVE1Test"
android:name=".subtasks.C_PVE.PVE1Test"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.PVE.PVE1Done"
android:name=".subtasks.C_PVE.PVE1Done"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.PVE.PVEInterim"
android:name=".subtasks.C_PVE.PVEInterim"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.PVE.PVE2Test"
android:name=".subtasks.C_PVE.PVE2Test"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.PVE.PVE2Done"
android:name=".subtasks.C_PVE.PVE2Done"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.PPE.PPEInstructions"
android:name=".subtasks.D_PPE.PPEInstructions"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.PPE.PPE1Test"
android:name=".subtasks.D_PPE.PPE1Test"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.PPE.PPEInterim"
android:name=".subtasks.D_PPE.PPEInterim"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.PPE.PPE2Test"
android:name=".subtasks.D_PPE.PPE2Test"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.RBE.RBEInstructions"
android:name=".subtasks.E_RBE.RBEInstructions"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
<activity
android:name=".subtasks.RBE.RBETest"
android:name=".subtasks.E_RBE.RBETest"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
Expand All @@ -188,5 +187,11 @@
android:parentActivityName=".MainActivity"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".subtasks.BESTComplete"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
</application>

</manifest>
8 changes: 4 additions & 4 deletions src/main/java/com/best/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private void exportData() {
"PRE1 Target", "PRE1 Result", "PRE2 Target", "PRE2 Result",
"PVE1 Target", "PVE1 Result", "PVE2 Target", "PVE2 Result",
"PPE1 Target", "PPE1 Result", "PPE2 Target", "PPE2 Result",
"RBE Target", "RBE Result"};
"RBE Target", "RBE Result", "RBE Mean", "RBE SD"};

writer.writeNext(columns);

Expand All @@ -140,13 +140,12 @@ private void exportData() {
profile.getDob(), profile.getGender(), profile.getHandedness(),
profile.getEducationLevel(), profile.getNotes(), profile.getCreationDate(),
"N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A",
"N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A"};
"N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A"};

writer.writeNext(data);
}
else {
for (Results results : resultsList) {

String data[] = {profile.getIdNumber(), profile.getLastName(), profile.getFirstName(),
profile.getDob(), profile.getGender(), profile.getHandedness(),
profile.getEducationLevel(), profile.getNotes(), profile.getCreationDate(),
Expand All @@ -157,7 +156,8 @@ private void exportData() {
results.getPve2Target(), results.getPve2Result(),
results.getPpe1Target(), results.getPpe1Result(),
results.getPpe2Target(), results.getPpe2Result(),
results.getRbeTarget(), results.getRbeResult()};
results.getRbeTarget(), results.getRbeResult(),
results.getRbeMean(), results.getRbeSD()};

writer.writeNext(data);
}
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/com/best/createProfile/CreateProfileActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private boolean formCompleted() {

private void saveProfile() {
// set profile creation date and time
String date = (new SimpleDateFormat("MM/dd/yyyy HH:mm:SSS")).format(new Date());
String date = (new SimpleDateFormat("MM/dd/yyyy HH:mm")).format(new Date());

// checks whether to trim "dextrous" or "-handed" from the handedness value
if (this.handednessSpinner.getSelectedItemPosition() == 3) {
Expand Down Expand Up @@ -218,6 +218,15 @@ private void saveProfile() {
private void startBEST() {
Intent intent = new Intent(this, StartBESTfromCreate.class);
intent.putExtra("id", this.idNumberEditText.getText().toString());
intent.putExtra("bestDate", (new SimpleDateFormat("MM/dd/yyyy HH:mm")).format(new Date()));
intent.putExtra("rveResult", "N/A");
intent.putExtra("pre1Result", "N/A");
intent.putExtra("pre2Result", "N/A");
intent.putExtra("pve1Result", "N/A");
intent.putExtra("pve2Result", "N/A");
intent.putExtra("ppe1Result", "N/A");
intent.putExtra("ppe2Result", "N/A");
intent.putExtra("rbeResult", "N/A");
startActivity(intent);
}
}
19 changes: 14 additions & 5 deletions src/main/java/com/best/database/DatabaseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class DatabaseHelper extends SQLiteOpenHelper {

private static DatabaseHelper DBHinstance = null;
private static final int DATABASE_VERSION = 3;
private static final int DATABASE_VERSION = 4;
private static final String DATABASE_NAME = "BESTDatabase";
private static final String TABLE_PROFILES = "profiles";
private static final String TABLE_RESULTS = "results";
Expand Down Expand Up @@ -46,6 +46,8 @@ public class DatabaseHelper extends SQLiteOpenHelper {
private static final String PPE1_RESULT = "ppe1Result";
private static final String PPE2_RESULT = "ppe2Result";
private static final String RBE_RESULT = "rbeResult";
private static final String RBE_MEAN = "rbeMean";
private static final String RBE_SD = "rbeSD";
private static final String RESULTS_DATE = "resultsDate";
private static final String RESULTS_ID = "resultsId";

Expand Down Expand Up @@ -80,6 +82,7 @@ public void onCreate(SQLiteDatabase db) {
+ PPE1_TARGET + " TEXT," + PPE1_RESULT + " TEXT,"
+ PPE2_TARGET + " TEXT," + PPE2_RESULT + " TEXT,"
+ RBE_TARGET + " TEXT," + RBE_RESULT + " TEXT,"
+ RBE_MEAN + " TEXT," + RBE_SD + " TEXT,"
+ RESULTS_DATE + " TEXT," + RESULTS_ID + " TEXT,"
+ "FOREIGN KEY (" + RESULTS_ID + ") REFERENCES " + TABLE_PROFILES + "(idNumber) " + ")";

Expand Down Expand Up @@ -136,6 +139,8 @@ public void addResults(Results results) {
values.put(PPE2_RESULT, results.getPpe2Result());
values.put(RBE_TARGET, results.getRbeTarget());
values.put(RBE_RESULT, results.getRbeResult());
values.put(RBE_MEAN, results.getRbeMean());
values.put(RBE_SD, results.getRbeSD());
values.put(RESULTS_DATE, results.getTestDate());
values.put(RESULTS_ID, results.getResultsId());

Expand Down Expand Up @@ -210,8 +215,10 @@ public List<Results> getResults(String id) {
results.setPpe2Result(cursor.getString(13));
results.setRbeTarget(cursor.getString(14));
results.setRbeResult(cursor.getString(15));
results.setTestDate(cursor.getString(16));
results.setResultsId(cursor.getString(17));
results.setRbeMean(cursor.getString(16));
results.setRbeSD(cursor.getString(17));
results.setTestDate(cursor.getString(18));
results.setResultsId(cursor.getString(19));
// Adding results to list
resultsList.add(results);
} while (cursor.moveToNext());
Expand Down Expand Up @@ -251,8 +258,10 @@ public List<Results> getAllResults() {
results.setPpe2Result(cursor.getString(13));
results.setRbeTarget(cursor.getString(14));
results.setRbeResult(cursor.getString(15));
results.setTestDate(cursor.getString(16));
results.setResultsId(cursor.getString(17));
results.setRbeMean(cursor.getString(16));
results.setRbeSD(cursor.getString(17));
results.setTestDate(cursor.getString(18));
results.setResultsId(cursor.getString(19));
// Adding results to list
resultsList.add(results);
} while (cursor.moveToNext());
Expand Down
22 changes: 21 additions & 1 deletion src/main/java/com/best/database/Results.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class Results {
private String ppe1Result;
private String ppe2Result;
private String rbeResult;
private String rbeMean;
private String rbeSD;
private String testDate;
private String resultsId;

Expand All @@ -33,7 +35,7 @@ public Results(String rveTarget,
String pre1Result, String pre2Result,
String pve1Result, String pve2Result,
String ppe1Result, String ppe2Result,
String rbeResult,
String rbeResult, String rbeMean, String rbeSD,
String testDate, String resultsId) {
this.rveTarget = rveTarget;
this.pre1Target = pre1Target;
Expand All @@ -51,6 +53,8 @@ public Results(String rveTarget,
this.ppe1Result = ppe1Result;
this.ppe2Result = ppe2Result;
this.rbeResult = rbeResult;
this.rbeMean = rbeMean;
this.rbeSD = rbeSD;
this.testDate = testDate;
this.resultsId = resultsId;
}
Expand Down Expand Up @@ -198,4 +202,20 @@ public String getResultsId() {
public void setResultsId(String resultsId) {
this.resultsId = resultsId;
}

public String getRbeMean() {
return rbeMean;
}

public void setRbeMean(String rbeMean) {
this.rbeMean = rbeMean;
}

public String getRbeSD() {
return rbeSD;
}

public void setRbeSD(String rbeSD) {
this.rbeSD = rbeSD;
}
}
20 changes: 20 additions & 0 deletions src/main/java/com/best/loadProfile/EditProfileActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
Expand Down Expand Up @@ -47,6 +48,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_profile);

setupActionBar();

this.idNumberEditText = findViewById(R.id.idNumberEditText2);
this.lastNameEditText = findViewById(R.id.lastNameEditText2);
this.firstNameEditText = findViewById(R.id.firstNameEditText2);
Expand All @@ -71,6 +74,23 @@ protected void onCreate(Bundle savedInstanceState) {
fillProfile();
}

private void setupActionBar() {
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
// Show the Up button in the action bar.
actionBar.setDisplayHomeAsUpEnabled(true);
}
}

public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);
}

private void fillProfile() {
db = DatabaseHelper.getInstance(this);
this.id = "";
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/best/loadProfile/LoadProfileActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.Menu;
import android.view.MenuItem;

import com.best.R;
import com.best.database.DatabaseHelper;
Expand All @@ -30,6 +32,16 @@ protected void onCreate(Bundle savedInstanceState) {
recyclerView.setAdapter(adapter);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.load_profile_actions, menu);
return super.onCreateOptionsMenu(menu);
}

public void searchProfileClick(MenuItem item) {

}

@Override
protected void onRestart() {
this.recreate();
Expand Down
Loading

0 comments on commit 04e32a9

Please sign in to comment.