From e205dbd8caf8a95a9fd803ad9e8f209613b18a7e Mon Sep 17 00:00:00 2001 From: jdat82 Date: Sun, 21 Feb 2016 12:21:38 +0100 Subject: [PATCH] =?UTF-8?q?feature/native-transtions-keyboard=20=E2=80=94?= =?UTF-8?q?=20Hook=20that=20will=20configure=20the=20android=20manifest=20?= =?UTF-8?q?with=20a=20new=20keyboard=20mode=20(adjustPan)=20every=20time?= =?UTF-8?q?=20the=20platform=20is=20added.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.xml | 163 ++++++++++++------------ scripts/android/change_keyboard_mode.js | 14 ++ 2 files changed, 97 insertions(+), 80 deletions(-) create mode 100644 scripts/android/change_keyboard_mode.js diff --git a/config.xml b/config.xml index 0e0f0ca..b55468c 100644 --- a/config.xml +++ b/config.xml @@ -1,83 +1,86 @@ - - learning-ionic - + + learning-ionic + Project to learn ionic - Jean DAT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + Jean DAT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/android/change_keyboard_mode.js b/scripts/android/change_keyboard_mode.js new file mode 100644 index 0000000..361a12a --- /dev/null +++ b/scripts/android/change_keyboard_mode.js @@ -0,0 +1,14 @@ +var fs = require('fs'); + +module.exports = function () { + var manifestPath = 'platforms/android/AndroidManifest.xml'; + var manifest = fs.readFileSync(manifestPath, 'utf8'); + + console.log('Android manifest file found'); + + manifest = manifest.replace(/android:windowSoftInputMode="[^"]+"/, 'android:windowSoftInputMode="adjustPan"'); + + fs.writeFileSync(manifestPath, manifest, 'utf8'); + + console.log('Android manifest updated. Changed windowSoftInputMode to adjustPan'); +};