summaryrefslogtreecommitdiffhomepage
path: root/app/components/TransitionContainerStyles.android.js
diff options
context:
space:
mode:
authoranderklander <anderklander@gmail.com>2018-04-06 11:31:59 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-04-16 12:01:12 +0200
commitf400e025eedc9323fe8c14f8c813c45bdaedc85b (patch)
tree12ba29b38d5e7de759bccdcf78983bc40ea052f4 /app/components/TransitionContainerStyles.android.js
parent959f1d1b0d1c47e8016188ac071d99a3ffb03824 (diff)
downloadmullvadvpn-f400e025eedc9323fe8c14f8c813c45bdaedc85b.tar.xz
mullvadvpn-f400e025eedc9323fe8c14f8c813c45bdaedc85b.zip
Modification of TransistionContainer for android compatibility
Diffstat (limited to 'app/components/TransitionContainerStyles.android.js')
-rw-r--r--app/components/TransitionContainerStyles.android.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/app/components/TransitionContainerStyles.android.js b/app/components/TransitionContainerStyles.android.js
new file mode 100644
index 0000000000..30abdfede8
--- /dev/null
+++ b/app/components/TransitionContainerStyles.android.js
@@ -0,0 +1,30 @@
+// @flow
+import { Styles, UserInterface } from 'reactxp';
+import { MobileAppBridge } from 'NativeModules';
+
+const dimensions = UserInterface.measureWindow();
+let menuBarHeight;
+
+/*MobileAppBridge.getHeight().then(_response => {height = _response}).catch(e => {
+ log.error('Failed getting menuBarHeight:', e);
+});
+*/
+MobileAppBridge.getMenuBarHeight().then(_response => {menuBarHeight = _response}).catch(e => {
+ log.error('Failed getting menuBarHeight:', e);
+});
+
+
+export default getStyles = () => {
+ return {
+ animationDefaultStyle: Styles.createAnimatedViewStyle({
+ position: 'absolute',
+ width: dimensions.width,
+ height: dimensions.height - menuBarHeight + 24,
+ }, false),
+ allowPointerEventsStyle: null,
+ transitionContainerStyle: Styles.createViewStyle({
+ width: dimensions.width,
+ height: dimensions.height - menuBarHeight + 24, //TODO: Remove ugly hack since it seems that at least my LG is hard to find the real display area ... Probably needs to be fixed for some versions or models
+ }, false)
+ }
+};