From 1575f96fc21179bd031d93e5dfd34eb920351c11 Mon Sep 17 00:00:00 2001 From: Emre YANIK Date: Wed, 15 Jun 2016 17:52:57 +0300 Subject: [PATCH] design updates #5 --- Muhit/Classes/UtilityFunctions.h | 2 + Muhit/Classes/UtilityFunctions.m | 7 + Muhit/Networking/MuhitServices.h | 2 +- Muhit/Networking/MuhitServices.m | 15 +- Muhit/Networking/ServiceConstants.h | 3 +- Muhit/Supporting Files/lang-tr.plist | 170 +++++++------- .../AddEditIssue/AddEditIssueVC.m | 53 ++--- .../AddEditIssue/AddEditIssueVC.xib | 221 ++++++++++-------- Muhit/ViewControllers/Issue/IssueVC.m | 121 +++++----- Muhit/ViewControllers/Issue/IssueVC.xib | 9 +- Muhit/ViewControllers/Main/MainVC.m | 3 +- Muhit/ViewControllers/Profile/ProfileVC.m | 42 ++-- Muhit/ViewControllers/Profile/ProfileVC.xib | 32 +-- 13 files changed, 344 insertions(+), 336 deletions(-) diff --git a/Muhit/Classes/UtilityFunctions.h b/Muhit/Classes/UtilityFunctions.h index cbfe0a7..c3c3a90 100755 --- a/Muhit/Classes/UtilityFunctions.h +++ b/Muhit/Classes/UtilityFunctions.h @@ -101,4 +101,6 @@ typedef enum{ +(NSString*)addQueryStringToUrlString:(NSString *)urlString withDictionary:(NSDictionary *)dictionary; +(NSString*)getDistrictFromAddress:(NSString *)address; +(NSString*)getHoodFromAddress:(NSString *)address; + ++(CGSize)screenSize; @end diff --git a/Muhit/Classes/UtilityFunctions.m b/Muhit/Classes/UtilityFunctions.m index 300067c..a67bec0 100755 --- a/Muhit/Classes/UtilityFunctions.m +++ b/Muhit/Classes/UtilityFunctions.m @@ -938,4 +938,11 @@ +(NSString*)getHoodFromAddress:(NSString *)address{ } } ++(CGSize)screenSize{ + CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width; + CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height; + + return CGSizeMake(screenWidth, screenHeight); +} + @end diff --git a/Muhit/Networking/MuhitServices.h b/Muhit/Networking/MuhitServices.h index 53ed642..b814c64 100755 --- a/Muhit/Networking/MuhitServices.h +++ b/Muhit/Networking/MuhitServices.h @@ -29,7 +29,7 @@ + (void)getAnnouncements:(int)from handler:(GeneralResponseHandler)handler; -+ (void)addOrUpdateIssue:(NSString*)title description:(NSString*)description location:(NSString*)location tags:(NSArray*)tags images:(NSArray*)images isAnonymous:(BOOL)isAnonymous coordinate:(NSString *)coordinate issueId:(NSString *)issueId handler:(GeneralResponseHandler)handler; ++ (void)addOrUpdateIssue:(NSString*)title problem:(NSString*)problem solution:(NSString*)solution location:(NSString*)location tags:(NSArray*)tags images:(NSArray*)images isAnonymous:(BOOL)isAnonymous coordinate:(NSString *)coordinate issueId:(NSString *)issueId handler:(GeneralResponseHandler)handler; + (void)getTags:(NSString*)query handler:(GeneralResponseHandler)handler; diff --git a/Muhit/Networking/MuhitServices.m b/Muhit/Networking/MuhitServices.m index 5aadc13..1d980b7 100755 --- a/Muhit/Networking/MuhitServices.m +++ b/Muhit/Networking/MuhitServices.m @@ -70,10 +70,11 @@ +(void)getIssues:(int)from handler:(GeneralResponseHandler)handler{ [SERVICES getRequestWithMethod:url backgroundCall:NO repeatCall:NO responseHandler:handler]; } -+ (void)addOrUpdateIssue:(NSString*)title description:(NSString*)description location:(NSString*)location tags:(NSArray*)tags images:(NSArray*)images isAnonymous:(BOOL)isAnonymous coordinate:(NSString *)coordinate issueId:(NSString *)issueId handler:(GeneralResponseHandler)handler{ ++ (void)addOrUpdateIssue:(NSString*)title problem:(NSString*)problem solution:(NSString*)solution location:(NSString*)location tags:(NSArray*)tags images:(NSArray*)images isAnonymous:(BOOL)isAnonymous coordinate:(NSString *)coordinate issueId:(NSString *)issueId handler:(GeneralResponseHandler)handler{ NSDictionary *requestDict = @{ KEY_ISSUE_TITLE : title, - KEY_ISSUE_DESC : description, + KEY_ISSUE_PROBLEM : problem, + KEY_ISSUE_SOLUTION : solution, KEY_ISSUE_LOCATION : location, KEY_ISSUE_TAGS : tags, KEY_ISSUE_IMAGES : images, @@ -124,10 +125,10 @@ +(void)unSupport:(NSString *)issueId handler:(GeneralResponseHandler)handler{ + (BOOL)refreshAccessTokenSync{ NSMutableDictionary *jsonRequest = [NSMutableDictionary dictionaryWithDictionary:@{ - KEY_REFRESH_TOKEN : [UD objectForKey:UD_REFRESH_TOKEN], - KEY_CLIENT_ID : VAL_CLIENT_ID, - KEY_CLIENT_SECRET : VAL_CLIENT_SECRET}]; - + KEY_REFRESH_TOKEN : [UD objectForKey:UD_REFRESH_TOKEN], + KEY_CLIENT_ID : VAL_CLIENT_ID, + KEY_CLIENT_SECRET : VAL_CLIENT_SECRET}]; + NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/api/%@",[MT serviceURL],SERVICE_REFRESH_ACCESS_TOKEN]]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url @@ -206,7 +207,7 @@ +(void)getRequestWithMethod:(NSString*)method backgroundCall:(BOOL)backgroundCal } } } - + [SERVICE_HANDLER getRequest: url backgroundCall: backgroundCall repeatCall: repeatCall diff --git a/Muhit/Networking/ServiceConstants.h b/Muhit/Networking/ServiceConstants.h index 3dc6a26..daafd05 100755 --- a/Muhit/Networking/ServiceConstants.h +++ b/Muhit/Networking/ServiceConstants.h @@ -50,7 +50,8 @@ #define KEY_LASTNAME @"last_name" #define KEY_ACTIVE_HOOD @"active_hood" #define KEY_ISSUE_TITLE @"title" -#define KEY_ISSUE_DESC @"desc" +#define KEY_ISSUE_PROBLEM @"problem" +#define KEY_ISSUE_SOLUTION @"solution" #define KEY_ISSUE_LOCATION @"location" #define KEY_ISSUE_TAGS @"tags" #define KEY_ISSUE_IMAGES @"images" diff --git a/Muhit/Supporting Files/lang-tr.plist b/Muhit/Supporting Files/lang-tr.plist index db5f08d..8595dad 100755 --- a/Muhit/Supporting Files/lang-tr.plist +++ b/Muhit/Supporting Files/lang-tr.plist @@ -2,121 +2,121 @@ + add + Ekle all Tümü - my-supporteds - Desteklediklerim - my-ideas - Fikirlerim announcements Duyurular - my-headman - Muhtarım + anonymus-issue + Anonim olarak başvuru yap + cancel + İptal + change + Değiştir + check-connection + İnternet bağlantınızı kontrol ediniz + choose-hood + Mahalleni seç... + comments + Yorumlar + connect + Bağlan + created-issues + Yarattığı Fikirler + description + Açıklama + edit + Düzenle + edit-profile + Profili Düzenle + email + E-posta adresi + facebook-permission + Facebook ile giriş yapabilmek için ayarlardan BiTaksi uygulamasına izin vermelisiniz. + forgot-pass + Şifremi unuttum + forgot-pass-description + Eğer şifreni unuttuysan aşağıya e-posta adresini yazarak gönderdiğimiz link ile yeni bir şifre oluşturabilirsin. headman Muhtar - signup - Kayıt Ol + hood + Mahalle + idea + Fikir + latest + En Son login Giriş Yap login-with-facebook Facebook ile Bağlan - or - veya - my-profile - Profilim - profile - Profil logout Çıkış Yap - connect - Bağlan - popular - Popüler map Harita - latest - En Son - forgot-pass - Şifremi unuttum - submit - Gönder - forgot-pass-description - Eğer şifreni unuttuysan aşağıya e-posta adresini yazarak gönderdiğimiz link ile yeni bir şifre oluşturabilirsin. + my-headman + Muhtarım + my-ideas + Fikirlerim + my-profile + Profilim + my-supporteds + Desteklediklerim + name + Ad + ok + Tamam + or + veya password Şifre - email - E-posta adresi + photos-max-3 + Resimler (max 3) + popular + Popüler + problem + Sorun + profile + Profil + profile-photo + Profil resmi read-agreement Kullanım koşullarını kabul ediyorum - name - Ad - surname - Soyad - username - Kullanıcı adı - hood - Mahalle - created-issues - Yarattığı Fikirler - supported-issues - Desteklediği Fikirler - edit-profile - Profili Düzenle - update - Güncelle - status-start - Başvuruldu + save + Kaydet + signup + Kayıt Ol + solution + Çözüm status-developing Gelişmekte status-resolved Çözüldü - comments - Yorumlar + status-start + Başvuruldu + submit + Gönder + support + Destekle + supported-issues + Desteklediği Fikirler supporter Destekçi - edit - Düzenle - add - Ekle - title - Başlık - description - Açıklama - Etiketler (max 3) + surname + Soyad + tags-max-3 Etiketler (max 3) - Resimler (max 3) - Resimler (max 3) - Anonim olarak başvuru yap - Anonim olarak başvuru yap - save - Kaydet take-photo Fotoğraf Çek - cancel - İptal - check-connection - İnternet bağlantınızı kontrol ediniz - ok - Tamam - idea - Fikir - change - Değiştir - facebook-permission - Facebook ile giriş yapabilmek için ayarlardan BiTaksi uygulamasına izin vermelisiniz. + title + Başlık try-again Yeniden Dene - choose-hood - Mahalleni seç... - profile-photo - Profil resmi - support - Destekle unsupport Destekledim - problem - Sorun - solution - Çözüm + update + Güncelle + username + Kullanıcı adı diff --git a/Muhit/ViewControllers/AddEditIssue/AddEditIssueVC.m b/Muhit/ViewControllers/AddEditIssue/AddEditIssueVC.m index 4000c7c..dad6251 100755 --- a/Muhit/ViewControllers/AddEditIssue/AddEditIssueVC.m +++ b/Muhit/ViewControllers/AddEditIssue/AddEditIssueVC.m @@ -11,10 +11,10 @@ @interface AddEditIssueVC (){ NSDictionary *issueDict; - IBOutlet UILabel *lblTitle,*lblDescription,*lblHood,*lblTags,*lblPhotos,*lblAnonim,*lblAddTag; + IBOutlet UILabel *lblTitle,*lblProblem,*lblSolution,*lblHood,*lblTags,*lblPhotos,*lblAnonim,*lblAddTag; IBOutlet UITextField *txtTitle; - IBOutlet UITextView *txtDescription; - IBOutlet UIView *viewHood,*viewDescription,*viewTags,*viewPhotos,*viewAddTag,*viewAnonim; + IBOutlet UITextView *txtProblem,*txtSolution; + IBOutlet UIView *viewHood,*viewProblem,*viewSolution,*viewTags,*viewPhotos,*viewAddTag,*viewAnonim; IBOutlet UIButton *btnSave,*btnAnonim,*btnAddTag,*btnAddPhoto,*btnHood; IBOutlet UIImageView *imgDownIconHood,*imgAnonim,*imgLocation,*imgAnonimTick,*imgLocationTick,*imgAddTag; IBOutlet NSLayoutConstraint *constPhotosViewWidth,*constBtnAddImageLeft,*constTagsViewHeight,*constBtnAddTagLeft,*constBtnAddTagTop,*constContainerHeight; @@ -88,30 +88,19 @@ - (void)geoCodePicked:(NSNotification*)notification{ } -(void)adjustUI{ - [[self view] setBackgroundColor:[UIColor whiteColor]]; - - CGFloat borderWidth = 1; + [[self view] setBackgroundColor:[HXColor hx_colorWithHexRGBAString:@"EEEEEE"]]; txtTitle.layer.cornerRadius = cornerRadius; - txtTitle.layer.borderWidth = borderWidth; - txtTitle.layer.borderColor = [CLR_LIGHT_BLUE CGColor]; - viewDescription.layer.cornerRadius = cornerRadius; - viewDescription.layer.borderWidth = borderWidth; - viewDescription.layer.borderColor = [CLR_LIGHT_BLUE CGColor]; + viewProblem.layer.cornerRadius = cornerRadius; + viewSolution.layer.cornerRadius = cornerRadius; viewHood.layer.cornerRadius = cornerRadius; - viewHood.layer.borderWidth = borderWidth; - viewHood.layer.borderColor = [CLR_LIGHT_BLUE CGColor]; btnSave.layer.cornerRadius = cornerRadius; btnAddPhoto.layer.cornerRadius = cornerRadius; viewAddTag.layer.cornerRadius = cornerRadius; - imgAnonimTick.layer.borderWidth = borderWidth; - imgAnonimTick.layer.borderColor = [CLR_LIGHT_BLUE CGColor]; imgAnonimTick.layer.cornerRadius = cornerRadius; imgAnonimTick.layer.masksToBounds = YES; - imgLocationTick.layer.borderWidth = borderWidth; - imgLocationTick.layer.borderColor = [CLR_LIGHT_BLUE CGColor]; imgLocationTick.layer.cornerRadius = cornerRadius; imgLocationTick.layer.masksToBounds = YES; @@ -131,7 +120,8 @@ -(void)setForEdit{ issueGeoCode = nilOrJson(issueDict[@"location"]); [btnHood setTitle:issueDict[@"location"]]; [txtTitle setText:issueDict[@"title"]]; - [txtDescription setText:issueDict[@"desc"]]; + [txtProblem setText:issueDict[@"problem"]]; + [txtSolution setText:issueDict[@"solution"]]; isAnonim = ![issueDict[@"is_anonymous"] boolValue]; [self actAnonim:nil]; @@ -231,7 +221,7 @@ -(IBAction)actSave:(id)sender{ } ADD_HUD - [MuhitServices addOrUpdateIssue:txtTitle.text description:txtDescription.text location:issueGeoCode tags:arrTagIds images:arrBase64Photos isAnonymous:isAnonim coordinate:issueCoordinate issueId:issueId handler:^(NSDictionary *response, NSError *error) { + [MuhitServices addOrUpdateIssue:txtTitle.text problem:txtProblem.text solution:txtSolution.text location:issueGeoCode tags:arrTagIds images:arrBase64Photos isAnonymous:isAnonim coordinate:issueCoordinate issueId:issueId handler:^(NSDictionary *response, NSError *error) { if (error) { SHOW_ALERT(response[KEY_ERROR][KEY_MESSAGE]); } @@ -468,23 +458,22 @@ - (void)didReceiveMemoryWarning { } - (void)setLocalizedStrings{ - - [lblTitle setText:LocalizedString(@"Başlık")]; - [lblDescription setText:LocalizedString(@"Açıklama")]; - [lblHood setText:LocalizedString(@"Mahalle")]; - [lblTags setText:LocalizedString(@"Etiketler (max 3)")]; - [lblPhotos setText:LocalizedString(@"Resimler (max 3)")]; - [lblAnonim setText:LocalizedString(@"Anonim olarak başvuru yap")]; - [lblAddTag setText:[LocalizedString(@"Ekle") toUpper]]; + [lblTitle setText:LocalizedString(@"title")]; + [lblProblem setText:LocalizedString(@"problem")]; + [lblSolution setText:LocalizedString(@"solution")]; + [lblHood setText:LocalizedString(@"hood")]; + [lblTags setText:LocalizedString(@"tags-max-3")]; + [lblPhotos setText:LocalizedString(@"photos-max-3")]; + [lblAnonim setText:LocalizedString(@"anonymus-issue")]; + [lblAddTag setText:[LocalizedString(@"add") toUpper]]; if (issueDict) { - [self setTitle:LocalizedString(@"Düzenle")]; - [btnSave setTitle:LocalizedString(@"Kaydet")]; + [self setTitle:LocalizedString(@"edit")]; + [btnSave setTitle:LocalizedString(@"save")]; } else{ - [self setTitle:LocalizedString(@"Ekle")]; - [btnSave setTitle:LocalizedString(@"Ekle")]; + [self setTitle:LocalizedString(@"add")]; + [btnSave setTitle:LocalizedString(@"add")]; } - } @end diff --git a/Muhit/ViewControllers/AddEditIssue/AddEditIssueVC.xib b/Muhit/ViewControllers/AddEditIssue/AddEditIssueVC.xib index a1febd3..d055a62 100755 --- a/Muhit/ViewControllers/AddEditIssue/AddEditIssueVC.xib +++ b/Muhit/ViewControllers/AddEditIssue/AddEditIssueVC.xib @@ -13,15 +13,17 @@ SourceSansPro-Regular SourceSansPro-Regular SourceSansPro-Regular + SourceSansPro-Regular + SourceSansPro-Regular + SourceSansPro-Regular + SourceSansPro-Regular + SourceSansPro-Regular + SourceSansPro-Regular + SourceSansPro-Regular SourceSansPro-Semibold SourceSansPro-Semibold - SourceSansPro-Semibold - SourceSansPro-Semibold - SourceSansPro-Semibold - SourceSansPro-Semibold - SourceSansPro-Semibold @@ -39,23 +41,24 @@ - - - + + - + + - + + @@ -64,26 +67,26 @@ - - + + - + - + - + @@ -92,20 +95,20 @@ - + + + diff --git a/Muhit/ViewControllers/Issue/IssueVC.m b/Muhit/ViewControllers/Issue/IssueVC.m index e5fd6b7..2e365bc 100755 --- a/Muhit/ViewControllers/Issue/IssueVC.m +++ b/Muhit/ViewControllers/Issue/IssueVC.m @@ -13,7 +13,7 @@ @interface IssueVC (){ IBOutlet UILabel *lblSupportTitle,*lblSupportCount,*lblHood,*lblDistrict,*lblDate,*lblType,*lblIssueTitle,*lblProblemTitle,*lblProblemDescription,*lblSolutionTitle,*lblSolutionDescription,*lblCommentTitle,*lblCreatorName; IBOutlet UIButton *btnBack,*btnSupport,*btnEdit,*btnShare; IBOutlet UIImageView *imgLocationIcon,*imgTypeIcon,*imgCreator; - IBOutlet UIView *viewSupport,*viewType,*viewTagsContainer,*viewCommentsHolder; + IBOutlet UIView *viewSupport,*viewType,*viewTagsContainer,*viewCommentsHolder,*viewProfile; IBOutlet UIScrollView *scrollImages; IBOutlet UITableView *tblComments; IBOutlet UIPageControl *pageControl; @@ -45,18 +45,16 @@ - (void)viewDidLoad { [scrollRoot setHidden:YES]; [self adjustUI]; self.automaticallyAdjustsScrollViewInsets=NO; + [self setDetailsWithDictionary:detail]; } -(void)viewDidLayoutSubviews{ [super viewDidLayoutSubviews]; + [scrollRoot setContentSize:CGSizeMake([UF screenSize].width, viewProfile.bottomPosition + 10)]; + constContainerHeight.constant = viewProfile.bottomPosition + 10; [self.view layoutIfNeeded]; } --(void)viewDidAppear:(BOOL)animated{ - [super viewDidAppear:animated]; - [self setDetailsWithDictionary:detail]; -} - - (void)viewWillAppear:(BOOL)animated { [[MT navCon] setNavigationBarHidden:YES animated:animated]; [super viewWillAppear:animated]; @@ -67,6 +65,21 @@ - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; } +-(void)adjustUI{ + + [self.view setBackgroundColor:[UIColor whiteColor]]; + + viewSupport.layer.cornerRadius = 35; + viewType.layer.cornerRadius = cornerRadius; + imgCreator.layer.cornerRadius = 20; + imgCreator.layer.masksToBounds = YES; + btnSupport.layer.cornerRadius = cornerRadius; + btnEdit.layer.cornerRadius = cornerRadius; + btnShare.layer.cornerRadius = cornerRadius; + [btnShare setImage:[IonIcons imageWithIcon:ion_share size:24 color:[UIColor whiteColor]]]; + [imgLocationIcon setImage:[IonIcons imageWithIcon:ion_location size:24 color:[UIColor whiteColor]]]; +} + -(void)setDetailsWithDictionary:(NSDictionary*)dict{ NSLog(@"issueDetail:%@",dict); @@ -101,79 +114,85 @@ -(void)setDetailsWithDictionary:(NSDictionary*)dict{ [lblIssueTitle setText:dict[@"title"]]; [lblProblemDescription setText:dict[@"problem"]]; [lblSolutionDescription setText:dict[@"solution"]]; + [self.view layoutIfNeeded]; - issueCoordinate = nilOrJson(dict[@"coordinates"]); + if (isNotNull(dict[@"coordinates"]) && [dict[@"coordinates"] length]>0) { + issueCoordinate = dict[@"coordinates"]; + } if ([dict[@"status"] isEqualToString:@"new"]) { + + if ([lblSupportCount.text isEqualToString:@"0"]) { + [viewType setBackgroundColor:CLR_WHITE]; + viewType.layer.borderWidth = 1; + viewType.layer.borderColor = [[HXColor hx_colorWithHexRGBAString:@"CCCCDD"] CGColor]; + [lblType setTextColor:CLR_LIGHT_BLUE]; + [imgTypeIcon setImage:[IonIcons imageWithIcon:ion_lightbulb size:16 color:CLR_LIGHT_BLUE]]; + } + else{ + [viewType setBackgroundColor:CLR_LIGHT_BLUE]; + [imgTypeIcon setImage:[IonIcons imageWithIcon:ion_lightbulb size:16 color:CLR_WHITE]]; + } [lblType setText:LocalizedString(@"status-start")]; - [viewType setBackgroundColor:[HXColor hx_colorWithHexRGBAString:@"44a2e0"]]; - [imgTypeIcon setImage:[IonIcons imageWithIcon:ion_lightbulb size:20 color:CLR_WHITE]]; } else if ([dict[@"status"] isEqualToString:@"status-developing"]){ [lblType setText:LocalizedString(@"Gelişmekte")]; - [viewType setBackgroundColor:[HXColor hx_colorWithHexRGBAString:@"c677ea"]]; - [imgTypeIcon setImage:[IonIcons imageWithIcon:ion_wrench size:20 color:CLR_WHITE]]; + [viewType setBackgroundColor:[HXColor hx_colorWithHexRGBAString:@"C678EA"]]; + [imgTypeIcon setImage:[IonIcons imageWithIcon:ion_wrench size:16 color:CLR_WHITE]]; } else{ [lblType setText:LocalizedString(@"status-resolved")]; - [viewType setBackgroundColor:[HXColor hx_colorWithHexRGBAString:@"27ae61"]]; - [imgTypeIcon setImage:[IonIcons imageWithIcon:ion_checkmark_circled size:20 color:CLR_WHITE]]; + [viewType setBackgroundColor:[HXColor hx_colorWithHexRGBAString:@"27AE60"]]; + [imgTypeIcon setImage:[IonIcons imageWithIcon:ion_checkmark_circled size:16 color:CLR_WHITE]]; } CGSize textSize = [[lblType text] sizeWithAttributes:@{NSFontAttributeName:[lblType font]}]; - constViewTypeWidth.constant = 40 + textSize.width; + constViewTypeWidth.constant = 45 + textSize.width; /************ Images Area ************/ NSArray * arrImages = [NSArray arrayWithArray:dict[@"images"]]; [scrollImages removeSubviews]; [pageControl setNumberOfPages:arrImages.count]; - if (arrImages.count==0) { - UIImageView *img = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; - [img setImage:[UIImage imageNamed:@"issue-placeholder"]]; - [scrollImages addSubview:img]; - [img centerInSuperView]; - } - else{ + if (arrImages.count>0) { for (int i = 0; i < arrImages.count; i++) { - CGRect frame; - frame.origin.x = scrollImages.width * i; - frame.origin.y = 0; - frame.size = scrollImages.frame.size; - + CGRect frame = CGRectMake([UF screenSize].width * i, 0, [UF screenSize].width, scrollImages.height); UIImageView *img = [[UIImageView alloc] initWithFrame:frame]; NSString *imgUrl = [NSString stringWithFormat:@"%@/%dx%d/%@",IMAGE_PROXY,2*(int)frame.size.width,2*(int)frame.size.height,arrImages[i][@"image"]]; - - [UF logFrame:img identifier:@"imageView"]; [img sd_setImageWithURL:[NSURL URLWithString:imgUrl] placeholderImage:[UIImage imageNamed:@"issue-placeholder"]]; + [img setContentMode:UIViewContentModeScaleToFill]; [scrollImages addSubview:img]; } if (issueCoordinate) { [pageControl setNumberOfPages:arrImages.count + 1]; - [scrollImages setContentSize:CGSizeMake(scrollImages.frame.size.width * (arrImages.count+1), scrollImages.frame.size.height)]; + [scrollImages setContentSize:CGSizeMake([UF screenSize].width * (arrImages.count+1), scrollImages.height)]; } else{ [pageControl setNumberOfPages:arrImages.count]; - [scrollImages setContentSize:CGSizeMake(scrollImages.frame.size.width * arrImages.count, scrollImages.frame.size.height)]; + [scrollImages setContentSize:CGSizeMake([UF screenSize].width * arrImages.count, scrollImages.height)]; + } + } + else{ + if (issueCoordinate) { + [pageControl setHidden:YES]; + [scrollImages setContentSize:CGSizeMake([UF screenSize].width, scrollImages.height)]; + } + else{ + [pageControl setHidden:YES]; + [scrollImages setHidden:YES]; } - } /**************************************/ - /************ Map Area ************/ - if (issueCoordinate) { - CGRect frame = scrollImages.frame; - frame.origin.x = scrollImages.contentSize.width - scrollImages.width; - + CGRect mapFrame = CGRectMake(scrollImages.contentSize.width - [UF screenSize].width, 0, [UF screenSize].width, scrollImages.height); NSArray *points = [issueCoordinate componentsSeparatedByString:@", "]; GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:[points[0] floatValue] longitude:[points[1] floatValue] zoom:15]; - - map = [GMSMapView mapWithFrame:frame camera:camera];; + map = [GMSMapView mapWithFrame:mapFrame camera:camera]; map.settings.rotateGestures = NO; map.settings.tiltGestures = NO; @@ -186,12 +205,11 @@ -(void)setDetailsWithDictionary:(NSDictionary*)dict{ [scrollImages addSubview:map]; } - /**************************************/ /************ Tags Area ************/ float totalTagsWidth = 0,lastTagsY = 0; - UIFont *tagFont = [UIFont fontWithName:@"SourceSansPro-Bold" size:16.0]; + UIFont *tagFont = [UIFont fontWithName:FONT_BOLD size:16.0]; [viewTagsContainer removeSubviews]; for (NSDictionary* tag in dict[@"tags"]) { @@ -199,10 +217,11 @@ -(void)setDetailsWithDictionary:(NSDictionary*)dict{ float lblWidth = [[tag[@"name"] toUpper] sizeWithAttributes:@{NSFontAttributeName:tagFont}].width; float viewItemWidth = lblWidth + 10; - if ((totalTagsWidth + viewItemWidth)>viewTagsContainer.width) { + if ((totalTagsWidth + viewItemWidth)>[UF screenSize].width-30) { totalTagsWidth = 0; lastTagsY += 40; constTagsViewHeight.constant = 30 + lastTagsY; + [self.view layoutIfNeeded]; } UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, lblWidth, 30)]; @@ -223,9 +242,8 @@ -(void)setDetailsWithDictionary:(NSDictionary*)dict{ [viewTagsContainer addSubview:viewItem]; } /**************************************/ - [scrollRoot setContentSize:CGSizeMake(scrollRoot.width, viewTagsContainer.bottomPosition + 10)]; - - constContainerHeight.constant = viewTagsContainer.bottomPosition +10; + [scrollRoot setContentSize:CGSizeMake(scrollRoot.width, viewProfile.bottomPosition + 10)]; + constContainerHeight.constant = viewProfile.bottomPosition + 10; [self.view layoutIfNeeded]; //todo comments @@ -233,20 +251,7 @@ -(void)setDetailsWithDictionary:(NSDictionary*)dict{ REMOVE_HUD } --(void)adjustUI{ - - [self.view setBackgroundColor:[UIColor whiteColor]]; - - viewSupport.layer.cornerRadius = 35; - viewType.layer.cornerRadius = cornerRadius; - imgCreator.layer.cornerRadius = 20; - imgCreator.layer.masksToBounds = YES; - btnSupport.layer.cornerRadius = cornerRadius; - btnEdit.layer.cornerRadius = cornerRadius; - btnShare.layer.cornerRadius = cornerRadius; - [btnShare setImage:[IonIcons imageWithIcon:ion_share size:24 color:[UIColor whiteColor]]]; - [imgLocationIcon setImage:[IonIcons imageWithIcon:ion_location size:24 color:[UIColor whiteColor]]]; -} + -(IBAction)actBack:(id)sender{ [self back]; diff --git a/Muhit/ViewControllers/Issue/IssueVC.xib b/Muhit/ViewControllers/Issue/IssueVC.xib index f8bb0b3..b01193f 100755 --- a/Muhit/ViewControllers/Issue/IssueVC.xib +++ b/Muhit/ViewControllers/Issue/IssueVC.xib @@ -58,6 +58,7 @@ + @@ -186,7 +187,7 @@ -