summaryrefslogtreecommitdiffstats
path: root/src/android
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan@kdab.com>2016-03-28 19:16:22 +0300
committerBogDan Vatra <bogdan@kdab.com>2016-04-30 12:05:21 +0000
commit249cb94655bc7d9b08431beecdbc73554c382467 (patch)
tree84664100c6d128e3cd8e03d9d17783d5eda7b78e /src/android
parent3cdc02d38274d42a0a25a50e3ed9de2c5ad264f0 (diff)
Android: Bring back the useful public vars
Change-Id: I2e4acb12ed376ed8afad72abdd10243549413feb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/android')
-rw-r--r--src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java40
1 files changed, 35 insertions, 5 deletions
diff --git a/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java b/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java
index ba16673479..573a28e44b 100644
--- a/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java
+++ b/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java
@@ -63,16 +63,42 @@ import android.view.accessibility.AccessibilityEvent;
public class QtActivity extends Activity
{
- QtActivityLoader m_loader;
+ public String APPLICATION_PARAMETERS = null; // use this variable to pass any parameters to your application,
+ // the parameters must not contain any white spaces
+ // and must be separated with "\t"
+ // e.g "-param1\t-param2=value2\t-param3\tvalue3"
+
+ public String ENVIRONMENT_VARIABLES = "QT_USE_ANDROID_NATIVE_DIALOGS=1";
+ // use this variable to add any environment variables to your application.
+ // the env vars must be separated with "\t"
+ // e.g. "ENV_VAR1=1\tENV_VAR2=2\t"
+ // Currently the following vars are used by the android plugin:
+ // * QT_USE_ANDROID_NATIVE_DIALOGS - 1 to use the android native dialogs.
+
+ public String[] QT_ANDROID_THEMES = null; // A list with all themes that your application want to use.
+ // The name of the theme must be the same with any theme from
+ // http://developer.android.com/reference/android/R.style.html
+ // The most used themes are:
+ // * "Theme" - (fallback) check http://developer.android.com/reference/android/R.style.html#Theme
+ // * "Theme_Black" - check http://developer.android.com/reference/android/R.style.html#Theme_Black
+ // * "Theme_Light" - (default for API <=10) check http://developer.android.com/reference/android/R.style.html#Theme_Light
+ // * "Theme_Holo" - check http://developer.android.com/reference/android/R.style.html#Theme_Holo
+ // * "Theme_Holo_Light" - (default for API 11-13) check http://developer.android.com/reference/android/R.style.html#Theme_Holo_Light
+ // * "Theme_DeviceDefault" - check http://developer.android.com/reference/android/R.style.html#Theme_DeviceDefault
+ // * "Theme_DeviceDefault_Light" - (default for API 14+) check http://developer.android.com/reference/android/R.style.html#Theme_DeviceDefault_Light
+
+ public String QT_ANDROID_DEFAULT_THEME = null; // sets the default theme.
+
+ private QtActivityLoader m_loader;
public QtActivity()
{
m_loader = new QtActivityLoader(this);
if (Build.VERSION.SDK_INT >= 21) {
- m_loader.QT_ANDROID_THEMES = new String[] {"Theme_Holo_Light"};
- m_loader.QT_ANDROID_DEFAULT_THEME = "Theme_Holo_Light";
+ QT_ANDROID_THEMES = new String[] {"Theme_Holo_Light"};
+ QT_ANDROID_DEFAULT_THEME = "Theme_Holo_Light";
} else {
- m_loader.QT_ANDROID_THEMES = new String[] {"Theme_DeviceDefault_Light"};
- m_loader.QT_ANDROID_DEFAULT_THEME = "Theme_DeviceDefault_Light";
+ QT_ANDROID_THEMES = new String[] {"Theme_DeviceDefault_Light"};
+ QT_ANDROID_DEFAULT_THEME = "Theme_DeviceDefault_Light";
}
}
@@ -236,6 +262,10 @@ public class QtActivity extends Activity
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
+ m_loader.APPLICATION_PARAMETERS = APPLICATION_PARAMETERS;
+ m_loader.ENVIRONMENT_VARIABLES = ENVIRONMENT_VARIABLES;
+ m_loader.QT_ANDROID_THEMES = QT_ANDROID_THEMES;
+ m_loader.QT_ANDROID_DEFAULT_THEME = QT_ANDROID_DEFAULT_THEME;
m_loader.onCreate(savedInstanceState);
}
//---------------------------------------------------------------------------