From 9912c46e356800117aa56cd15bbed1fe37ab1bff Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Thu, 13 Sep 2012 17:39:40 +0200 Subject: [PATCH] Fix chat views --- Classes/ChatRoomViewController.m | 12 ++++++++++++ Classes/en.lproj/ChatViewController.xib | 5 ++--- Classes/fr.lproj/ChatViewController.xib | 4 ++-- linphone.ldb/Contents.plist | 12 ++++++------ .../{1 => 2}/ChatViewController.xib | 5 ++--- 5 files changed, 24 insertions(+), 14 deletions(-) rename linphone.ldb/Resources/Classes/ChatViewController/{1 => 2}/ChatViewController.xib (99%) diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index 399230f5f..b82d0215c 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -300,6 +300,11 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta footerRect.size.height += diff; [footerView setFrame:footerRect]; + // Always stay at bottom + CGPoint contentPt = [tableController.tableView contentOffset]; + contentPt.y += diff; + [tableController.tableView setContentOffset:contentPt animated:FALSE]; + CGRect tableRect = [tableController.view frame]; tableRect.size.height -= diff; [tableController.view setFrame:tableRect]; @@ -371,8 +376,15 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta { CGRect tableFrame = [tableController.view frame]; tableFrame.origin.y = [headerView frame].origin.y + [headerView frame].size.height; + double diff = tableFrame.size.height; tableFrame.size.height = [footerView frame].origin.y - tableFrame.origin.y; + diff = tableFrame.size.height - diff; [tableController.view setFrame:tableFrame]; + + // Always stay at bottom + CGPoint contentPt = [tableController.tableView contentOffset]; + contentPt.y -= diff; + [tableController.tableView setContentOffset:contentPt animated:FALSE]; } [UIView commitAnimations]; diff --git a/Classes/en.lproj/ChatViewController.xib b/Classes/en.lproj/ChatViewController.xib index 5a413935c..69cc378e4 100644 --- a/Classes/en.lproj/ChatViewController.xib +++ b/Classes/en.lproj/ChatViewController.xib @@ -61,7 +61,7 @@ - 292 + 289 {{160, 0}, {160, 44}} @@ -99,7 +99,7 @@ - 289 + 292 {160, 44} @@ -150,7 +150,6 @@ {{0, 74}, {320, 378}} - _NS:9 1 diff --git a/Classes/fr.lproj/ChatViewController.xib b/Classes/fr.lproj/ChatViewController.xib index e9f8e254d..c19606afd 100644 --- a/Classes/fr.lproj/ChatViewController.xib +++ b/Classes/fr.lproj/ChatViewController.xib @@ -60,7 +60,7 @@ - 292 + 289 {{160, 0}, {160, 44}} @@ -97,7 +97,7 @@ - 289 + 292 {160, 44} diff --git a/linphone.ldb/Contents.plist b/linphone.ldb/Contents.plist index f37155e1a..e446bc3c4 100644 --- a/linphone.ldb/Contents.plist +++ b/linphone.ldb/Contents.plist @@ -453,17 +453,17 @@ backup - 1 + 2 class BLWrapperHandle name - Classes/ChatViewController/1/ChatViewController.xib + Classes/ChatViewController/2/ChatViewController.xib change date - 2012-09-10T15:08:28Z + 2012-09-13T15:35:03Z changed values class @@ -473,7 +473,7 @@ flags 0 hash - 5899ee290abaa696222088258d0de490 + d02ecf8f1bacbfa8e5793231b6735940 name ChatViewController.xib @@ -587,9 +587,9 @@ versions en - 1 + 2 fr - 1 + 2 diff --git a/linphone.ldb/Resources/Classes/ChatViewController/1/ChatViewController.xib b/linphone.ldb/Resources/Classes/ChatViewController/2/ChatViewController.xib similarity index 99% rename from linphone.ldb/Resources/Classes/ChatViewController/1/ChatViewController.xib rename to linphone.ldb/Resources/Classes/ChatViewController/2/ChatViewController.xib index 5a413935c..69cc378e4 100644 --- a/linphone.ldb/Resources/Classes/ChatViewController/1/ChatViewController.xib +++ b/linphone.ldb/Resources/Classes/ChatViewController/2/ChatViewController.xib @@ -61,7 +61,7 @@ - 292 + 289 {{160, 0}, {160, 44}} @@ -99,7 +99,7 @@ - 289 + 292 {160, 44} @@ -150,7 +150,6 @@ {{0, 74}, {320, 378}} - _NS:9 1