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

Commit

Permalink
redirects screen on siteupload
Browse files Browse the repository at this point in the history
  • Loading branch information
konishon committed Mar 5, 2019
1 parent 3206034 commit 4ea6001
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
4 changes: 2 additions & 2 deletions collect_app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if (secretsFile.exists()) {

def versionMajor = 2
def versionMinor = 6
def versionPatch = 0
def versionPatch = 1


android {
Expand All @@ -81,7 +81,7 @@ android {
targetSdkVersion(26)
//versionCode LEGACY_BUILD_NUMBER_OFFSET + getMasterCommitCount()
//versionName getVersionName()
versionCode 49
versionCode 54
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
System.out.println(versionName + " " + versionCode)
testInstrumentationRunner('android.support.test.runner.AndroidJUnitRunner')
Expand Down
6 changes: 1 addition & 5 deletions collect_app/release/output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
<<<<<<< HEAD
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":51,"versionName":"2.5.3","enabled":true,"outputFile":"collect-release-2.5.3.apk","fullName":"release","baseName":"release"},"path":"collect-release-2.5.3.apk","properties":{}}]
=======
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":49,"versionName":"2.5.5","enabled":true,"outputFile":"collect-release-2.5.5.apk","fullName":"release","baseName":"release"},"path":"collect-release-2.5.5.apk","properties":{}}]
>>>>>>> 980a41b8383f2c9266e4ff892ddddc55be64e84f
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":54,"versionName":"2.6.1","enabled":true,"outputFile":"collect-release-2.6.1.apk","fullName":"release","baseName":"release"},"path":"collect-release-2.6.1.apk","properties":{}}]
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
import retrofit2.HttpException;
import timber.log.Timber;

import static android.app.Activity.RESULT_CANCELED;
import static android.app.Activity.RESULT_OK;
import static org.bcss.collect.naxa.common.Constant.ANIM.fragmentEnterAnimation;
import static org.bcss.collect.naxa.common.Constant.ANIM.fragmentExitAnimation;
import static org.bcss.collect.naxa.common.Constant.ANIM.fragmentPopEnterAnimation;
Expand Down Expand Up @@ -390,14 +392,17 @@ public void accept(Disposable disposable) throws Exception {
public void onSuccess(List<Long> instanceIDs) {
FieldSightNotificationUtils.getINSTANCE().cancelNotification(progressNotifyId);

if (uploadForms && instanceIDs.size() > 0) {
Intent i = new Intent(getActivity(), InstanceUploaderActivity.class);
i.putExtra(FormEntryActivity.KEY_INSTANCES, Longs.toArray(instanceIDs));
startActivityForResult(i, INSTANCE_UPLOADER);
}

if (uploadForms && instanceIDs.size() == 0) {
FlashBarUtils.showFlashbar(requireActivity(), "There are no forms to upload");
if (uploadForms) {
if (instanceIDs.size() > 0) {
Intent i = new Intent(getActivity(), InstanceUploaderActivity.class);
i.putExtra(FormEntryActivity.KEY_INSTANCES, Longs.toArray(instanceIDs));
startActivityForResult(i, INSTANCE_UPLOADER);
} else {
FlashBarUtils.showFlashbar(requireActivity(), "There are no forms to upload");
requireActivity().onBackPressed();
}
} else {
requireActivity().onBackPressed();
}
}

Expand All @@ -417,6 +422,19 @@ public void onError(Throwable e) {
}


@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == INSTANCE_UPLOADER) {
switch (resultCode) {
case RESULT_OK:
case RESULT_CANCELED:
requireActivity().onBackPressed();
break;
}
}
}

private ArrayList<Long> getNotUploadedFormForSite(String siteId) {
String selection;
String[] selectionArgs;
Expand Down

0 comments on commit 4ea6001

Please sign in to comment.