diff options
-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) |