Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28

defaultConfig {
applicationId "org.researchstack.backboneapp"
minSdkVersion 16
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
Expand All @@ -19,12 +19,17 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'org.researchstack:backbone:1.1.2'
implementation 'org.researchstack:backbone_interop:2.0.0-alpha01'

testImplementation 'junit:junit:4.12'

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 @@ -20,7 +20,7 @@
</activity>

<activity
android:name="org.researchstack.backbone.ui.ViewTaskActivity"
android:name="org.researchstack.backbone.interop.ViewBackboneInteropTaskActivity"
android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.BackboneApp.Survey"
Copy link
Contributor Author

@liujoshua liujoshua Jan 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although :backbone_interop will merge ViewBackboneInteropTaskActivity into your app's AndroidManifest.xml, you may need to update your app's AndroidManifest.xml if you specified a theme or other custom attribute.

/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import android.app.Application;

import com.jakewharton.threetenabp.AndroidThreeTen;

import org.researchstack.backbone.StorageAccess;
import org.researchstack.backbone.storage.database.AppDatabase;
import org.researchstack.backbone.storage.database.sqlite.DatabaseHelper;
Expand Down Expand Up @@ -34,6 +36,9 @@ public void onCreate()
null,
DatabaseHelper.DEFAULT_VERSION);

// initialize timezone database for JSR-310 library
AndroidThreeTen.init(this);

StorageAccess.getInstance().init(pinCodeConfig, encryptionProvider, fileAccess, database);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.researchstack.backbone.task.OrderedTask;
import org.researchstack.backbone.task.Task;
import org.researchstack.backbone.ui.PinCodeActivity;
import org.researchstack.backbone.interop.ViewBackboneInteropTaskActivity;
import org.researchstack.backbone.ui.ViewTaskActivity;
import org.researchstack.backbone.ui.step.layout.ConsentSignatureStepLayout;

Expand Down Expand Up @@ -275,8 +276,8 @@ private void launchConsent()
formStep,
signatureStep);

// Launch using hte ViewTaskActivity and make sure to listen for the activity result
Intent intent = ViewTaskActivity.newIntent(this, consentTask);
// Launch using hte ViewBackboneInteropTaskActivity and make sure to listen for the activity result
Intent intent = ViewBackboneInteropTaskActivity.newIntent(this, consentTask);
startActivityForResult(intent, REQUEST_CONSENT);
}

Expand Down Expand Up @@ -358,7 +359,7 @@ private void launchSurvey()
booleanStep, multiStep);

// Create an activity using the task and set a delegate.
Intent intent = ViewTaskActivity.newIntent(this, task);
Intent intent = ViewBackboneInteropTaskActivity.newIntent(this, task);
startActivityForResult(intent, REQUEST_SURVEY);
}

Expand Down Expand Up @@ -424,7 +425,10 @@ private void printSurveyInfo(TextView surveyAnswer)
for(String id : taskResult.getResults().keySet())
{
StepResult stepResult = taskResult.getStepResult(id);
results += id + ": " + stepResult.getResult().toString() + "\n";
// handle stepResults with null results
// we now add an empty stepResult to track step start/end timestamps for when a step
// does not add a result for itself
results += id + ": " + stepResult.getResult() + "\n";
}

surveyAnswer.setText(results);
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ allprojects {
jcenter()
mavenCentral()
maven { url "https://jitpack.io" } // for MPAndroidChart dependency, not on jcenter yet
maven { url "https://dl.bintray.com/researchstack/ResearchStack/" } // 2.0.0-alpha01 is not on jcenter yet
}
}

Expand Down