|
@@ -7,12 +7,17 @@ import android.content.Intent;
|
|
|
import android.net.Uri;
|
|
|
import android.os.Build;
|
|
|
import android.text.InputType;
|
|
|
+import android.text.SpannableString;
|
|
|
+import android.text.SpannableStringBuilder;
|
|
|
import android.text.method.PasswordTransformationMethod;
|
|
|
+import android.text.style.ForegroundColorSpan;
|
|
|
import android.util.Log;
|
|
|
import android.view.View;
|
|
|
import android.view.inputmethod.InputMethodManager;
|
|
|
import android.widget.EditText;
|
|
|
|
|
|
+import androidx.core.content.ContextCompat;
|
|
|
+
|
|
|
import com.dbs.mplus.knuh.BuildConfig;
|
|
|
import com.dbs.mplus.knuh.R;
|
|
|
import com.dbs.mplus.knuh.activity.ConsentActivity;
|
|
@@ -40,11 +45,13 @@ public class ConsentFacade {
|
|
|
private ConsentActivity instance;
|
|
|
|
|
|
private EFormToolkit eFormToolkit;
|
|
|
+ private String consentStateEng = "";
|
|
|
|
|
|
- public ConsentFacade(Context mContext) {
|
|
|
+ public ConsentFacade(Context mContext, String consentStateEng) {
|
|
|
this.mContext = mContext;
|
|
|
this.instance = (ConsentActivity) mContext;
|
|
|
this.eFormToolkit = new EFormToolkit(mContext);
|
|
|
+ this.consentStateEng = consentStateEng;
|
|
|
}
|
|
|
|
|
|
private RunOption createRunOption() {
|
|
@@ -335,6 +342,11 @@ public class ConsentFacade {
|
|
|
visible = "false";
|
|
|
}
|
|
|
|
|
|
+ String pageattachVisible = "true";
|
|
|
+ if (consentStateEng.equals(ConsentConfig.ELECTR_CMP)) {
|
|
|
+ pageattachVisible = "false";
|
|
|
+ }
|
|
|
+
|
|
|
String uiStyle = "{ " +
|
|
|
" 'required-input': { " +
|
|
|
" 'border': { " +
|
|
@@ -359,7 +371,7 @@ public class ConsentFacade {
|
|
|
" }, " +
|
|
|
" 'toast-message': { " +
|
|
|
" 'signature-missing-data': { " +
|
|
|
- " 'text': '" + mContext.getString(R.string.emptySign) + "' " +
|
|
|
+ " 'text': '" + mContext.getString(R.string.emptySign) + "' " +
|
|
|
" } " +
|
|
|
" }, " +
|
|
|
" 'toolbar': { " +
|
|
@@ -371,26 +383,26 @@ public class ConsentFacade {
|
|
|
" 'visible': 'true' " +
|
|
|
" }, " +
|
|
|
" 'tempsave2': { " +
|
|
|
- " 'visible': '" + visible + "', " +
|
|
|
+ " 'visible': '" + visible + "', " +
|
|
|
" 'enabled': 'true', " +
|
|
|
- " 'text': '" + mContext.getString(R.string.confirmSave) + "' " +
|
|
|
+ " 'text': '" + mContext.getString(R.string.confirmSave) + "' " +
|
|
|
" }, " +
|
|
|
" 'tempsave': { " +
|
|
|
" 'visible': 'true', " +
|
|
|
" 'enabled': 'true', " +
|
|
|
- " 'text': '" + mContext.getString(R.string.tempList) + "' " +
|
|
|
+ " 'text': '" + mContext.getString(R.string.tempList) + "' " +
|
|
|
" }, " +
|
|
|
" 'save': { " +
|
|
|
" 'visible': 'true', " +
|
|
|
" 'enabled': 'true', " +
|
|
|
- " 'text': '" + mContext.getString(R.string.certifySave) + "' " +
|
|
|
+ " 'text': '" + mContext.getString(R.string.certifySave) + "' " +
|
|
|
" }, " +
|
|
|
" 'exit': { " +
|
|
|
" 'visible': 'true', " +
|
|
|
- " 'text': '" + mContext.getString(R.string.exit) + "' " +
|
|
|
+ " 'text': '" + mContext.getString(R.string.exit) + "' " +
|
|
|
" }, " +
|
|
|
" 'pageattach': { " +
|
|
|
- " 'visible': 'true' " +
|
|
|
+ " 'visible': '" + pageattachVisible + "' " +
|
|
|
" }, " +
|
|
|
" 'page-number': { " +
|
|
|
" 'current': { " +
|
|
@@ -406,22 +418,22 @@ public class ConsentFacade {
|
|
|
" 'move-next': { " +
|
|
|
" 'buttons': { " +
|
|
|
" 'save-move': { " +
|
|
|
- " 'text': '" + String.format(mContext.getString(R.string.saveNext), mContext.getString(R.string.certifySave)) + "', " +
|
|
|
+ " 'text': '" + String.format(mContext.getString(R.string.saveNext), mContext.getString(R.string.certifySave)) + "', " +
|
|
|
" 'visible': true, " +
|
|
|
" 'enabled': true " +
|
|
|
" }, " +
|
|
|
" 'tempsave-move': { " +
|
|
|
- " 'text': '" + String.format(mContext.getString(R.string.saveNext), mContext.getString(R.string.tempList)) + "', " +
|
|
|
+ " 'text': '" + String.format(mContext.getString(R.string.saveNext), mContext.getString(R.string.tempList)) + "', " +
|
|
|
" 'visible': true, " +
|
|
|
" 'enabled': true " +
|
|
|
" }, " +
|
|
|
" 'tempsave2-move': { " +
|
|
|
- " 'text': '" + String.format(mContext.getString(R.string.saveNext), mContext.getString(R.string.confirmSave)) + "', " +
|
|
|
+ " 'text': '" + String.format(mContext.getString(R.string.saveNext), mContext.getString(R.string.confirmSave)) + "', " +
|
|
|
" 'visible': true, " +
|
|
|
" 'enabled': true " +
|
|
|
" }, " +
|
|
|
" 'move': { " +
|
|
|
- " 'text': '"+ mContext.getString(R.string.notSaveNext) +"', " +
|
|
|
+ " 'text': '"+ mContext.getString(R.string.notSaveNext) +"', " +
|
|
|
" 'visible': true, " +
|
|
|
" 'enabled': true " +
|
|
|
" } " +
|
|
@@ -430,19 +442,33 @@ public class ConsentFacade {
|
|
|
" }, " +
|
|
|
" 'dialog': { " +
|
|
|
" 'save': { " +
|
|
|
- " 'title': '" + mContext.getString(R.string.certifySave) + "', " +
|
|
|
- " 'contents': '" + String.format(mContext.getString(R.string.saveAction), mContext.getString(R.string.certifySave)) + "' " +
|
|
|
+ " 'title': '" + mContext.getString(R.string.certifySave) + "', " +
|
|
|
+ " 'contents': '" + String.format(mContext.getString(R.string.saveAction), mContext.getString(R.string.certifySave)) + "' " +
|
|
|
" }, " +
|
|
|
" 'temp-save': { " +
|
|
|
- " 'title': '" + mContext.getString(R.string.tempList) + "', " +
|
|
|
- " 'contents': '" + String.format(mContext.getString(R.string.saveAction), mContext.getString(R.string.tempList)) + "' " +
|
|
|
+ " 'title': '" + mContext.getString(R.string.tempList) + "', " +
|
|
|
+ " 'contents': '" + String.format(mContext.getString(R.string.saveAction), mContext.getString(R.string.tempList)) + "' " +
|
|
|
" }, " +
|
|
|
" 'temp-save2': { " +
|
|
|
- " 'title': '" + mContext.getString(R.string.confirmSave) + "', " +
|
|
|
- " 'contents': '" + String.format(mContext.getString(R.string.saveAction), mContext.getString(R.string.confirmSave)) + "' " +
|
|
|
- " } " +
|
|
|
- " } " +
|
|
|
- "} ";
|
|
|
+ " 'title': '" + mContext.getString(R.string.confirmSave) + "', " +
|
|
|
+ " 'contents': '" + String.format(mContext.getString(R.string.saveAction), mContext.getString(R.string.confirmSave)) + "' " +
|
|
|
+ " } " +
|
|
|
+ " }, " +
|
|
|
+ " 'progress': { " +
|
|
|
+ " 'save': { " +
|
|
|
+ " 'title': '" + String.format(mContext.getString(R.string.eformSaveProgressTitle), mContext.getString(R.string.certifySave)) + "', " +
|
|
|
+ " 'contents': '" + String.format(mContext.getString(R.string.eformSaveProgressMsg), mContext.getString(R.string.certifySave)) + "' " +
|
|
|
+ " }, " +
|
|
|
+ " 'tempsave': { " +
|
|
|
+ " 'title': '" + String.format(mContext.getString(R.string.eformSaveProgressTitle), mContext.getString(R.string.tempList)) + "', " +
|
|
|
+ " 'contents': '" + String.format(mContext.getString(R.string.eformSaveProgressMsg), mContext.getString(R.string.tempList)) + "' " +
|
|
|
+ " }, " +
|
|
|
+ " 'tempsave2': { " +
|
|
|
+ " 'title': '" + String.format(mContext.getString(R.string.eformSaveProgressTitle), mContext.getString(R.string.confirmSave)) + "', " +
|
|
|
+ " 'contents': '" + String.format(mContext.getString(R.string.eformSaveProgressMsg), mContext.getString(R.string.confirmSave)) + "' " +
|
|
|
+ " } " +
|
|
|
+ " } " +
|
|
|
+ "} ";
|
|
|
return uiStyle;
|
|
|
}
|
|
|
}
|