Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#385): Production instance on production app should not have red border #386

Merged
merged 4 commits into from
Jan 29, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void onReceiveValue(String result) {
};


//> ACTIVITY LIFECYCLE METHODS
//> ACTIVITY LIFECYCLE METHODS
@SuppressLint("ClickableViewAccessibility")
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -86,7 +86,7 @@ public void onReceiveValue(String result) {

// Add an alarming red border if using configurable (i.e. dev)
// app with a medic production server.
if (settings.allowsConfiguration() && appUrl != null && appUrl.contains("app.medicmobile.org")) {
if (settings.allowCustomHosts() && appUrl != null && appUrl.contains("app.medicmobile.org")) {
View webviewContainer = findViewById(R.id.lytWebView);
webviewContainer.setPadding(10, 10, 10, 10);
webviewContainer.setBackgroundResource(R.drawable.warning_background);
Expand Down Expand Up @@ -171,8 +171,8 @@ protected void onStop() {
@Override public void onBackPressed() {
trace(this, "onBackPressed()");
container.evaluateJavascript(
"angular.element(document.body).injector().get('AndroidApi').v1.back()",
backButtonHandler);
"angular.element(document.body).injector().get('AndroidApi').v1.back()",
backButtonHandler);
}

@Override
Expand Down Expand Up @@ -218,7 +218,7 @@ protected void onActivityResult(int requestCd, int resultCode, Intent intent) {
}
}

//> ACCESSORS
//> ACCESSORS
MrdtSupport getMrdtSupport() {
return this.mrdt;
}
Expand All @@ -231,7 +231,7 @@ ChtExternalAppHandler getChtExternalAppHandler() {
return this.chtExternalAppHandler;
}

//> PUBLIC API
//> PUBLIC API
public void evaluateJavascript(final String js) {
evaluateJavascript(js, true);
}
Expand Down Expand Up @@ -278,7 +278,7 @@ public boolean getLocationPermissions() {
return false;
}

//> PRIVATE HELPERS
//> PRIVATE HELPERS
private void locationRequestResolved() {
evaluateJavascript("window.CHTCore.AndroidApi.v1.locationPermissionRequestResolved();");
}
Expand Down Expand Up @@ -403,7 +403,7 @@ private void registerRetryConnectionBroadcastReceiver() {
);
}

//> ENUMS
//> ENUMS
public enum RequestCode {
ACCESS_LOCATION_PERMISSION(100),
ACCESS_STORAGE_PERMISSION(101),
Expand Down
Loading