I am struggling a little bit with this implementation. I\'m building my first Hello World! android(cordova) application that requires a keyboard to show always and avoid hid
Well, I think I came up with a different way, still not sure if this is how it should be handled.
Add an event listener on Taps
myApp.directive('detectGestures', function ($ionicGesture) {
return {
restrict: 'A',
link: function (scope, elem, attrs) {
var gestureType = attrs.gestureType;
switch (gestureType) {
case 'doubletap':
$ionicGesture.on('doubletap', scope.reportEvent, elem);
break;
}}}
});
Then in My Controller, If keyboard is Visible close else Show
$scope.reportEvent = function (event) {
if (event.type == 'doubletap') {
$timeout(function () {
if (window.cordova && window.cordova.plugins.Keyboard) {
if(cordova.plugins.Keyboard.isVisible){
window.cordova.plugins.Keyboard.close();
} else {
window.cordova.plugins.Keyboard.show();
}
}
}, 500);
}
};
Let me know what you think.
Thanks!