Skip to content

Commit 3d9510d

Browse files
committed
Backport android min sdk, android keyboard, and networkQuery fixes from 6.3.2
1 parent 6567fae commit 3d9510d

File tree

4 files changed

+38
-8
lines changed

4 files changed

+38
-8
lines changed

config.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<widget android-versionCode="6183" id="org.codaco.NetworkCanvasInterviewer6" ios-CFBundleIdentifier="org.codaco.networkCanvasInterviewerBusiness" ios-CFBundleVersion="6182" version="6.3.2"
2+
<widget android-versionCode="6199" id="org.codaco.NetworkCanvasInterviewer6" ios-CFBundleIdentifier="org.codaco.networkCanvasInterviewerBusiness" ios-CFBundleVersion="6199" version="6.3.2"
33
xmlns="http://www.w3.org/ns/widgets"
44
xmlns:android="http://schemas.android.com/apk/res/android"
55
xmlns:cdv="http://cordova.apache.org/ns/1.0">
@@ -75,14 +75,14 @@
7575
<preference name="AndroidPersistentFileLocation" value="Internal"/>
7676
<preference name="iosPersistentFileLocation" value="Library"/>
7777
<preference name="AllowInlineMediaPlayback" value="true"/>
78-
<preference name="android-minSdkVersion" value="27"/>
78+
<preference name="android-minSdkVersion" value="24"/>
7979
<preference name="android-targetSdkVersion" value="30"/>
8080
<plugin name="cordova-plugin-file-transfer" spec="^1.7.1"/>
8181
<plugin name="cordova-plugin-whitelist" spec="^1.3.3"/>
8282
<plugin name="cordova-plugin-device" spec="^2.0.2"/>
83-
<plugin name="cordova-plugin-keyboard" spec="^1.2.0"/>
8483
<plugin name="cordova-plugin-x-socialsharing" spec="^5.6.4"/>
8584
<plugin name="cordova-plugin-zeroconf" spec="^1.4.1"/>
85+
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.2.0"/>
8686
<plugin name="cordova-plugin-inappbrowser" spec="~4.0.0"/>
8787
<plugin name="cordova-plugin-network-information" spec="~2.0.2"/>
8888
<plugin name="cordova-plugin-chooser" spec="~1.3.1"/>

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"cordova-ios": "~5.1.1",
7979
"cordova-plugin-app-version": "~0.1.14",
8080
"cordova-plugin-file": "~5.0.0",
81+
"cordova-plugin-ionic-keyboard": "2.2.0",
8182
"cordova-plugin-network-canvas-client": "github:complexdatacollective/cordova-plugin-network-canvas-client",
8283
"cross-env": "^5.2.0",
8384
"css-loader": "^3.4.2",
@@ -300,7 +301,9 @@
300301
"cordova-plugin-file-transfer": {},
301302
"cordova-plugin-whitelist": {},
302303
"cordova-plugin-device": {},
303-
"cordova-plugin-keyboard": {},
304+
"cordova-plugin-app-version": {},
305+
"cordova-plugin-ionic-keyboard": {},
306+
"cordova-plugin-fullscreen": {},
304307
"cordova-plugin-zeroconf": {},
305308
"cordova-plugin-x-socialsharing": {
306309
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+",
@@ -313,8 +316,7 @@
313316
"cordova-plugin-wkwebview-engine": {},
314317
"cordova-plugin-network-canvas-client": {},
315318
"cordova-sqlite-storage": {},
316-
"cordova-plugin-file": {},
317-
"cordova-plugin-app-version": {}
319+
"cordova-plugin-file": {}
318320
}
319321
}
320322
}

src/index.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ import initMenuActions from './utils/initMenuActions';
99
import { history, store, persistor as storePersistor } from './ducks/store';
1010
import { actionCreators as deviceActions } from './ducks/modules/deviceSettings';
1111
import App from './containers/App';
12-
import { isCordova, isElectron, getEnv } from './utils/Environment';
12+
import {
13+
isCordova,
14+
isElectron,
15+
getEnv,
16+
isAndroid,
17+
} from './utils/Environment';
1318
import AppRouter from './routes';
1419
import remote from './utils/remote';
1520

@@ -40,6 +45,29 @@ const Persist = ({ persistor, children }) => {
4045
const startApp = () => {
4146
store.dispatch(deviceActions.deviceReady());
4247

48+
// Enable fullscreen mode on Android using cordova-plugin-fullscreen
49+
if (isAndroid()) {
50+
window.AndroidFullScreen.isImmersiveModeSupported(() => {
51+
window.AndroidFullScreen.immersiveMode(() => {
52+
// eslint-disable-next-line no-console
53+
console.info('Set app into immersive mode.');
54+
55+
window.addEventListener('keyboardDidHide', () => {
56+
// Describe your logic which will be run each time keyboard is closed.
57+
// eslint-disable-next-line no-console
58+
console.log('keyboard hidden');
59+
window.AndroidFullScreen.immersiveMode();
60+
});
61+
}, () => {
62+
// eslint-disable-next-line no-console
63+
console.warn('Failed to set app into immersive mode!');
64+
});
65+
}, () => {
66+
// eslint-disable-next-line no-console
67+
console.warn('Wanted to set immersive mode, but not supported!');
68+
});
69+
}
70+
4371
ReactDOM.render(
4472
<Provider store={store}>
4573
<Persist persistor={storePersistor}>

0 commit comments

Comments
 (0)