Skip to content

Commit

Permalink
Backport android min sdk, android keyboard, and networkQuery fixes fr…
Browse files Browse the repository at this point in the history
…om 6.3.2
  • Loading branch information
jthrilly committed Sep 29, 2022
1 parent 6567fae commit 3d9510d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 8 deletions.
6 changes: 3 additions & 3 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget android-versionCode="6183" id="org.codaco.NetworkCanvasInterviewer6" ios-CFBundleIdentifier="org.codaco.networkCanvasInterviewerBusiness" ios-CFBundleVersion="6182" version="6.3.2"
<widget android-versionCode="6199" id="org.codaco.NetworkCanvasInterviewer6" ios-CFBundleIdentifier="org.codaco.networkCanvasInterviewerBusiness" ios-CFBundleVersion="6199" version="6.3.2"
xmlns="http://www.w3.org/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:cdv="http://cordova.apache.org/ns/1.0">
Expand Down Expand Up @@ -75,14 +75,14 @@
<preference name="AndroidPersistentFileLocation" value="Internal"/>
<preference name="iosPersistentFileLocation" value="Library"/>
<preference name="AllowInlineMediaPlayback" value="true"/>
<preference name="android-minSdkVersion" value="27"/>
<preference name="android-minSdkVersion" value="24"/>
<preference name="android-targetSdkVersion" value="30"/>
<plugin name="cordova-plugin-file-transfer" spec="^1.7.1"/>
<plugin name="cordova-plugin-whitelist" spec="^1.3.3"/>
<plugin name="cordova-plugin-device" spec="^2.0.2"/>
<plugin name="cordova-plugin-keyboard" spec="^1.2.0"/>
<plugin name="cordova-plugin-x-socialsharing" spec="^5.6.4"/>
<plugin name="cordova-plugin-zeroconf" spec="^1.4.1"/>
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.2.0"/>
<plugin name="cordova-plugin-inappbrowser" spec="~4.0.0"/>
<plugin name="cordova-plugin-network-information" spec="~2.0.2"/>
<plugin name="cordova-plugin-chooser" spec="~1.3.1"/>
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"cordova-ios": "~5.1.1",
"cordova-plugin-app-version": "~0.1.14",
"cordova-plugin-file": "~5.0.0",
"cordova-plugin-ionic-keyboard": "2.2.0",
"cordova-plugin-network-canvas-client": "github:complexdatacollective/cordova-plugin-network-canvas-client",
"cross-env": "^5.2.0",
"css-loader": "^3.4.2",
Expand Down Expand Up @@ -300,7 +301,9 @@
"cordova-plugin-file-transfer": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-device": {},
"cordova-plugin-keyboard": {},
"cordova-plugin-app-version": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-fullscreen": {},
"cordova-plugin-zeroconf": {},
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+",
Expand All @@ -313,8 +316,7 @@
"cordova-plugin-wkwebview-engine": {},
"cordova-plugin-network-canvas-client": {},
"cordova-sqlite-storage": {},
"cordova-plugin-file": {},
"cordova-plugin-app-version": {}
"cordova-plugin-file": {}
}
}
}
30 changes: 29 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import initMenuActions from './utils/initMenuActions';
import { history, store, persistor as storePersistor } from './ducks/store';
import { actionCreators as deviceActions } from './ducks/modules/deviceSettings';
import App from './containers/App';
import { isCordova, isElectron, getEnv } from './utils/Environment';
import {
isCordova,
isElectron,
getEnv,
isAndroid,
} from './utils/Environment';
import AppRouter from './routes';
import remote from './utils/remote';

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

// Enable fullscreen mode on Android using cordova-plugin-fullscreen
if (isAndroid()) {
window.AndroidFullScreen.isImmersiveModeSupported(() => {
window.AndroidFullScreen.immersiveMode(() => {
// eslint-disable-next-line no-console
console.info('Set app into immersive mode.');

window.addEventListener('keyboardDidHide', () => {
// Describe your logic which will be run each time keyboard is closed.
// eslint-disable-next-line no-console
console.log('keyboard hidden');
window.AndroidFullScreen.immersiveMode();
});
}, () => {
// eslint-disable-next-line no-console
console.warn('Failed to set app into immersive mode!');
});
}, () => {
// eslint-disable-next-line no-console
console.warn('Wanted to set immersive mode, but not supported!');
});
}

ReactDOM.render(
<Provider store={store}>
<Persist persistor={storePersistor}>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/networkQuery

0 comments on commit 3d9510d

Please sign in to comment.