mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-02 20:16:25 +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 {
|
- (IBAction)onBackClick:(id)event {
|
||||||
|
if([ContactSelection getSelectionMode] == ContactSelectionModeEdit) {
|
||||||
|
[ContactSelection setSelectionMode:ContactSelectionModeNone];
|
||||||
|
}
|
||||||
[[PhoneMainView instance] popCurrentView];
|
[[PhoneMainView instance] popCurrentView];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf
|
||||||
// Go to Contact details view
|
// Go to Contact details view
|
||||||
ContactDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactDetailsViewController compositeViewDescription] push:TRUE], ContactDetailsViewController);
|
ContactDetailsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactDetailsViewController compositeViewDescription] push:TRUE], ContactDetailsViewController);
|
||||||
if(controller != nil) {
|
if(controller != nil) {
|
||||||
if([ContactSelection getAddAddress] == nil) {
|
if([ContactSelection getSelectionMode] != ContactSelectionModeEdit) {
|
||||||
[controller setContact:lPerson];
|
[controller setContact:lPerson];
|
||||||
} else {
|
} else {
|
||||||
[controller editContact:lPerson address:[ContactSelection getAddAddress]];
|
[controller editContact:lPerson address:[ContactSelection getAddAddress]];
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
#import "UICompositeViewController.h"
|
#import "UICompositeViewController.h"
|
||||||
|
|
||||||
@interface UIImageScrollView : UIScrollView<UIScrollViewDelegate>
|
@interface UIImageScrollView : UIScrollView<UIScrollViewDelegate>
|
||||||
|
|
||||||
@property (nonatomic, retain) UIImage *image;
|
@property (nonatomic, retain) UIImage *image;
|
||||||
@property (readonly) IBOutlet UIImageView *imageView;
|
@property (readonly) IBOutlet UIImageView *imageView;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
- (void)initUIImageScrollView {
|
- (void)initUIImageScrollView {
|
||||||
imageView = [[UIImageView alloc] init];
|
imageView = [[UIImageView alloc] init];
|
||||||
self.delegate = self;
|
self.delegate = self;
|
||||||
[self addSubview:imageView];
|
[self addSubview:imageView];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,11 +70,11 @@
|
||||||
|
|
||||||
- (void)layoutSubviews {
|
- (void)layoutSubviews {
|
||||||
[super layoutSubviews];
|
[super layoutSubviews];
|
||||||
|
|
||||||
// center the image as it becomes smaller than the size of the screen
|
// center the image as it becomes smaller than the size of the screen
|
||||||
CGSize boundsSize = self.bounds.size;
|
CGSize boundsSize = self.bounds.size;
|
||||||
CGRect frameToCenter = imageView.frame;
|
CGRect frameToCenter = imageView.frame;
|
||||||
|
|
||||||
|
|
||||||
// center horizontally
|
// center horizontally
|
||||||
if (frameToCenter.size.width < boundsSize.width)
|
if (frameToCenter.size.width < boundsSize.width)
|
||||||
frameToCenter.origin.x = (boundsSize.width - frameToCenter.size.width) / 2;
|
frameToCenter.origin.x = (boundsSize.width - frameToCenter.size.width) / 2;
|
||||||
|
|
@ -87,6 +87,7 @@
|
||||||
else
|
else
|
||||||
frameToCenter.origin.y = 0;
|
frameToCenter.origin.y = 0;
|
||||||
|
|
||||||
|
|
||||||
imageView.frame = frameToCenter;
|
imageView.frame = frameToCenter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -94,10 +95,14 @@
|
||||||
#pragma mark - Property Functions
|
#pragma mark - Property Functions
|
||||||
|
|
||||||
- (void)setImage:(UIImage *)aimage {
|
- (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.image = aimage;
|
||||||
imageView.frame = CGRectMake(0, 0, aimage.size.width, aimage.size.height);
|
imageView.frame = rect;
|
||||||
self.contentSize = aimage.size;
|
self.contentSize = rect.size;
|
||||||
[self zoomToRect:imageView.bounds animated:FALSE];
|
[self zoomToRect:rect animated:FALSE];
|
||||||
self.minimumZoomScale = self.zoomScale;
|
self.minimumZoomScale = self.zoomScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue