Skip to content

Commit e443979

Browse files
author
Binod Adhikary
committed
fix(#385): Add a flag indicating production app avoiding red border
1 parent 4f2cc56 commit e443979

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/main/java/org/medicmobile/webapp/mobile/EmbeddedBrowserActivity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import android.content.Context;
2020
import android.content.Intent;
2121
import android.content.IntentFilter;
22+
import android.content.res.Resources;
2223
import android.net.ConnectivityManager;
2324
import android.net.Uri;
2425
import android.os.Bundle;
@@ -80,13 +81,13 @@ public void onReceiveValue(String result) {
8081

8182
this.settings = SettingsStore.in(this);
8283
this.appUrl = settings.getAppUrl();
83-
84+
boolean isProductionApp = getResources().getBoolean(R.bool.production);
8485
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
8586
setContentView(R.layout.main);
8687

8788
// Add an alarming red border if using configurable (i.e. dev)
8889
// app with a medic production server.
89-
if (settings.allowsConfiguration() && appUrl != null && appUrl.contains("app.medicmobile.org")) {
90+
if (settings.allowsConfiguration() && appUrl != null && appUrl.contains("app.medicmobile.org") && !isProductionApp) {
9091
View webviewContainer = findViewById(R.id.lytWebView);
9192
webviewContainer.setPadding(10, 10, 10, 10);
9293
webviewContainer.setBackgroundResource(R.drawable.warning_background);

src/main/res/values/bools.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<bool name="production">False</bool>
4+
</resources>

0 commit comments

Comments
 (0)