openlp-android team mailing list archive
-
openlp-android team
-
Mailing list archive
-
Message #00201
[Merge] lp:~trb143/openlp/android_dev into lp:openlp/android
Tim Bentley has proposed merging lp:~trb143/openlp/android_dev into lp:openlp/android.
Requested reviews:
OpenLP Android Developers (openlp-android)
For more details, see:
https://code.launchpad.net/~trb143/openlp/android_dev/+merge/178337
Add tab to support /main url.
--
https://code.launchpad.net/~trb143/openlp/android_dev/+merge/178337
Your team OpenLP Android Developers is requested to review the proposed merge of lp:~trb143/openlp/android_dev into lp:openlp/android.
=== modified file 'res/values/strings.xml'
--- res/values/strings.xml 2013-04-07 12:24:38 +0000
+++ res/values/strings.xml 2013-08-02 16:10:46 +0000
@@ -23,7 +23,8 @@
<string name="alertTextNull">Please enter a message to send.</string>
<string name="send">Send</string>
<string name="tabLive">Live</string>
- <string name="tabStage">Stage</string>
+ <string name="tabMain">Main</string>
+ <string name="tabStage">Stage</string>
<string name="tabDisplay">Display</string>
<string name="tabService">Service</string>
<string name="preferenceCategoryTitleServer">Server</string>
=== modified file 'src/org/openlp/android/utility/OpenLPController.java'
--- src/org/openlp/android/utility/OpenLPController.java 2013-06-04 19:22:48 +0000
+++ src/org/openlp/android/utility/OpenLPController.java 2013-08-02 16:10:46 +0000
@@ -70,8 +70,9 @@
public static final int PAGE_LIVE = 1;
public static final int PAGE_DISPLAY = 2;
public static final int PAGE_STAGE = 3;
- public static final int PAGE_ALERT = 4;
- public static final int PAGE_SEARCH = 5;
+ public static final int PAGE_MAIN = 4;
+ public static final int PAGE_ALERT = 5;
+ public static final int PAGE_SEARCH = 6;
private String displayType;
private WebView webView;
@@ -334,7 +335,10 @@
}
if (position == PAGE_STAGE) {
- webView = getWebViewFromView(view);
+ webView = getWebViewFromView(view, "stage");
+ }
+ if (position == PAGE_MAIN) {
+ webView = getWebViewFromView(view, "main");
}
if (position == PAGE_ALERT) {
view.findViewById(R.id.send).setOnClickListener(mSend);
@@ -348,7 +352,7 @@
return view;
}
- private WebView getWebViewFromView(View view) {
+ private WebView getWebViewFromView(View view, String display) {
WebView myWebView = (WebView) view.findViewById(R.id.stageview);
/*
* Handle SSL self signed certificates and refresh the screen if the certificate
@@ -367,7 +371,7 @@
myWebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
myWebView.setScrollbarFadingEnabled(true);
- myWebView.loadUrl(getUrlBase());
+ myWebView.loadUrl(getUrlBase(display));
return myWebView;
}
@@ -391,7 +395,6 @@
if (buttonId == R.id.buttonStage) {
return PAGE_STAGE;
}
-
Log.e(OpenLPController.class.getName(),
"No Button connected to the requested view, with id: " + buttonId);
return 0;
@@ -425,7 +428,13 @@
if (currentPage == PAGE_STAGE) {
if (webView == null) {
webView = getWebViewFromView(context.getLayoutInflater()
- .inflate(R.layout.stageview, null));
+ .inflate(R.layout.stageview, null), "stage");
+ }
+ }
+ if (currentPage == PAGE_MAIN) {
+ if (webView == null) {
+ webView = getWebViewFromView(context.getLayoutInflater()
+ .inflate(R.layout.stageview, null), "main");
}
}
@@ -456,6 +465,9 @@
case PAGE_STAGE:
page = context.getString(R.string.tabStage);
break;
+ case PAGE_MAIN:
+ page = context.getString(R.string.tabMain);
+ break;
case PAGE_ALERT:
page = context.getString(R.string.tabAlert);
break;
@@ -477,6 +489,8 @@
return R.layout.misc;
case PAGE_STAGE:
return R.layout.stageview;
+ case PAGE_MAIN:
+ return R.layout.stageview;
case PAGE_ALERT:
return R.layout.alert;
case PAGE_SEARCH:
@@ -596,15 +610,16 @@
return displayType;
}
- private String getUrlBase() {
+ private String getUrlBase(String display) {
Boolean useSsl = preferences.getBoolean(context.getString(R.string.key_ssl_use), false);
- return String.format("%s://%s:%s/stage",
+ return String.format("%s://%s:%s/%s",
useSsl ? "https" : "http",
preferences.getString(context.getString(R.string.keyHost),
context.getString(R.string.hostDefaultValue)),
preferences.getString(context.getString(R.string.keyPort),
- context.getString(R.string.portDefaultValue)));
+ context.getString(R.string.portDefaultValue)),
+ display);
}
class NoLayoutForPositionException extends Exception {
Follow ups