mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Reset contact selection mode after edit
Fix image zoom
This commit is contained in:
parent
cb9e977bf3
commit
7db406cdb6
4 changed files with 15 additions and 7 deletions
|
|
@ -299,6 +299,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (IBAction)onBackClick:(id)event {
|
||||
if([ContactSelection getSelectionMode] == ContactSelectionModeEdit) {
|
||||
[ContactSelection setSelectionMode:ContactSelectionModeNone];
|
||||
}
|
||||
[[PhoneMainView instance] popCurrentView];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf
|
|||
// Go to Contact details view
|
||||
ContactDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactDetailsViewController compositeViewDescription] push:TRUE], ContactDetailsViewController);
|
||||
if(controller != nil) {
|
||||
if([ContactSelection getAddAddress] == nil) {
|
||||
if([ContactSelection getSelectionMode] != ContactSelectionModeEdit) {
|
||||
[controller setContact:lPerson];
|
||||
} else {
|
||||
[controller editContact:lPerson address:[ContactSelection getAddAddress]];
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
#import "UICompositeViewController.h"
|
||||
|
||||
@interface UIImageScrollView : UIScrollView<UIScrollViewDelegate>
|
||||
|
||||
|
||||
@property (nonatomic, retain) UIImage *image;
|
||||
@property (readonly) IBOutlet UIImageView *imageView;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
- (void)initUIImageScrollView {
|
||||
imageView = [[UIImageView alloc] init];
|
||||
self.delegate = self;
|
||||
self.delegate = self;
|
||||
[self addSubview:imageView];
|
||||
}
|
||||
|
||||
|
|
@ -70,11 +70,11 @@
|
|||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
|
||||
// center the image as it becomes smaller than the size of the screen
|
||||
CGSize boundsSize = self.bounds.size;
|
||||
CGRect frameToCenter = imageView.frame;
|
||||
|
||||
|
||||
// center horizontally
|
||||
if (frameToCenter.size.width < boundsSize.width)
|
||||
frameToCenter.origin.x = (boundsSize.width - frameToCenter.size.width) / 2;
|
||||
|
|
@ -87,6 +87,7 @@
|
|||
else
|
||||
frameToCenter.origin.y = 0;
|
||||
|
||||
|
||||
imageView.frame = frameToCenter;
|
||||
}
|
||||
|
||||
|
|
@ -94,10 +95,14 @@
|
|||
#pragma mark - Property Functions
|
||||
|
||||
- (void)setImage:(UIImage *)aimage {
|
||||
self.minimumZoomScale = 0;
|
||||
self.zoomScale = 1;
|
||||
|
||||
CGRect rect = CGRectMake(0, 0, aimage.size.width, aimage.size.height);
|
||||
imageView.image = aimage;
|
||||
imageView.frame = CGRectMake(0, 0, aimage.size.width, aimage.size.height);
|
||||
self.contentSize = aimage.size;
|
||||
[self zoomToRect:imageView.bounds animated:FALSE];
|
||||
imageView.frame = rect;
|
||||
self.contentSize = rect.size;
|
||||
[self zoomToRect:rect animated:FALSE];
|
||||
self.minimumZoomScale = self.zoomScale;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue