diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-04-13 12:08:24 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-04-13 20:59:04 +0300 |
commit | 410ad97b30691e88bbac4d2fa66e2eecf9bfc060 (patch) | |
tree | 1b6dfdc455bcee17a2035808b919971be0a4d71f | |
parent | 2cca07806251c2085661f4639acfdf085c1984fe (diff) |
Listen for keyboard show and hide notifications
Only react to hide notification for now, call lo_keyboard_did_hide()
Change-Id: I2f429039d2a84269783d103ad635ff4c407c4a15
-rw-r--r-- | ios/experimental/LibreOffice/LibreOffice/AppDelegate.m | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m b/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m index 3a70fa3572b4..223ccf56b4ba 100644 --- a/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m +++ b/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m @@ -47,6 +47,9 @@ static UIView *theView; lo_set_view_size(bounds.size.width, bounds.size.height); + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil]; + NSThread* thread = [[NSThread alloc] initWithTarget:self selector:@selector(threadMainMethod:) object:nil]; @@ -90,6 +93,28 @@ static UIView *theView; (void) application; } +- (void)keyboardWillShow:(NSNotification *)note +{ + NSDictionary *info = [note userInfo]; + CGRect frameBegin; + CGRect frameEnd; + + [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] getValue:&frameBegin]; + [[info objectForKey:UIKeyboardFrameEndUserInfoKey] getValue:&frameEnd]; +} + +- (void)keyboardDidHide:(NSNotification *)note +{ + NSDictionary *info = [note userInfo]; + CGRect frameBegin; + CGRect frameEnd; + + [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] getValue:&frameBegin]; + [[info objectForKey:UIKeyboardFrameEndUserInfoKey] getValue:&frameEnd]; + + lo_keyboard_did_hide(); +} + @end void lo_damaged(CGRect rect) |