From 7e0388211303c4e6c9302a03477bb2f5c96375d5 Mon Sep 17 00:00:00 2001 From: Ryan Peterson Date: Fri, 26 Jul 2019 17:02:36 -0700 Subject: [PATCH 1/6] Created package.json so it will install properly --- package.json | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..4425703 --- /dev/null +++ b/package.json @@ -0,0 +1,33 @@ +{ + "name": "windowSoftManager", + "version": "1.0.0", + "description": "This plugin allows you to edit Android windowSoftInputMode dynamically from Cordova.", + "cordova": { + "id": "com.vertex.windowSoftInputMode", + "platforms": [ + "android" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/denkomanceski/windowSoftInputMode" + }, + "keywords": [ + "Keyboard", + "windowSoftInputMode", + "ecosystem:cordova", + "cordova-android" + ], + "engines": [ + { + "name": "cordova", + "version": ">=3.0.0" + } + ], + "author": "Denko Manceski (https://github.com/denkomanceski)", + "license": "MIT", + "bugs": { + "url": "https://github.com/denkomanceski/windowSoftInputMode/issues" + }, + "homepage": "https://github.com/denkomanceski/windowSoftInputMode#readme" +} \ No newline at end of file From 798081b9a2334dc412a7109a5a88e4478668be7b Mon Sep 17 00:00:00 2001 From: Ryan Peterson Date: Fri, 26 Jul 2019 17:03:36 -0700 Subject: [PATCH 2/6] Added support for soft input mode 'adjustNothing' --- src/android/windowSoftManager.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/android/windowSoftManager.java b/src/android/windowSoftManager.java index ec92b87..d604146 100644 --- a/src/android/windowSoftManager.java +++ b/src/android/windowSoftManager.java @@ -39,6 +39,8 @@ public void run() { cordova.getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); else if(action.equals("adjustResize")) cordova.getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); + else if(action.equals("adjustNothing")) + cordova.getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING); } }); From 70aba1d597a4709abf31604b81d117ab5cab5dcc Mon Sep 17 00:00:00 2001 From: Ryan Peterson Date: Fri, 26 Jul 2019 17:06:08 -0700 Subject: [PATCH 3/6] Added windowSoftManager.prototype.MODES as constants for easier adjustment --- www/windowSoftManager.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/windowSoftManager.js b/www/windowSoftManager.js index 6d08767..5b1af60 100644 --- a/www/windowSoftManager.js +++ b/www/windowSoftManager.js @@ -11,7 +11,13 @@ windowSoftManager.prototype.setMode = function(aString){ function(result){ /*alert("Error" + reply);*/ },"windowSoftManager",aString,[]); -} +}; + +windowSoftManager.prototype.MODES = { + SOFT_INPUT_ADJUST_PAN: "adjustPan", + SOFT_INPUT_ADJUST_RESIZE: "adjustResize", + SOFT_INPUT_ADJUST_NOTHING: "adjustNothing" +}; var windowSoftManager = new windowSoftManager(); module.exports = windowSoftManager; From b04777a0cbd8203823825f69be945838710ace78 Mon Sep 17 00:00:00 2001 From: Ryan Peterson Date: Fri, 26 Jul 2019 17:16:09 -0700 Subject: [PATCH 4/6] Updated README.md for new mode and constants --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 92c4be5..eb2d36c 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,11 @@ Currently the plugin supports setting the soft input to adjustPan (SOFT_INPUT_AD cordova plugin add https://github.com/denkomanceski/windowSoftInputMode.git # Usage -To set the soft input mode to adjustPan: ```windowSoftManager.setMode("adjustPan");``` +To set the soft input mode to adjustPan: ```windowSoftManager.setMode(windowSoftManager.MODES.SOFT_INPUT_ADJUST_PAN);``` -To set the soft input mode to adjustResize: ```windowSoftManager.setMode("adjustResize");``` +To set the soft input mode to adjustResize: ```windowSoftManager.setMode(windowSoftManager.MODES.SOFT_INPUT_ADJUST_RESIZE);``` + +To set the soft input mode to adjustNothing: ```windowSoftManager.setMode(windowSoftManager.MODES.SOFT_INPUT_ADJUST_NOTHING);``` Thats it. Simple and clear From b3b924e467180b786525cc9e1da48a8a4770e6df Mon Sep 17 00:00:00 2001 From: Ryan Peterson Date: Mon, 29 Jul 2019 09:55:15 -0700 Subject: [PATCH 5/6] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eb2d36c..eb91011 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,10 @@ Cordova plugin to dynamically change soft input mode on android devices Currently the plugin supports setting the soft input to adjustPan (SOFT_INPUT_ADJUST_PAN) or adjustResize(SOFT_INPUT_ADJUST_RESIZE). Feel free to extend it and make a pull request # Installation -cordova plugin add https://github.com/denkomanceski/windowSoftInputMode.git +~cordova plugin add https://github.com/denkomanceski/windowSoftInputMode.git~ + +This version no longer works with newer version of Cordova. In case my pull request does not get approved, you can install a working copy from my repo by running this: +`cordova plugin add https://github.com/PetersonRyan/windowSoftInputMode.git` # Usage To set the soft input mode to adjustPan: ```windowSoftManager.setMode(windowSoftManager.MODES.SOFT_INPUT_ADJUST_PAN);``` From 77b94169ddbb64712b15ae1541b4759cc01a6867 Mon Sep 17 00:00:00 2001 From: Ryan Peterson Date: Mon, 29 Jul 2019 09:55:34 -0700 Subject: [PATCH 6/6] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index eb91011..089ecc5 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Currently the plugin supports setting the soft input to adjustPan (SOFT_INPUT_AD ~cordova plugin add https://github.com/denkomanceski/windowSoftInputMode.git~ This version no longer works with newer version of Cordova. In case my pull request does not get approved, you can install a working copy from my repo by running this: + `cordova plugin add https://github.com/PetersonRyan/windowSoftInputMode.git` # Usage