Skip to content

Commit

Permalink
design updates #5
Browse files Browse the repository at this point in the history
  • Loading branch information
Emre YANIK committed Jun 15, 2016
1 parent 389d3cc commit 1575f96
Show file tree
Hide file tree
Showing 13 changed files with 344 additions and 336 deletions.
2 changes: 2 additions & 0 deletions Muhit/Classes/UtilityFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,6 @@ typedef enum{
+(NSString*)addQueryStringToUrlString:(NSString *)urlString withDictionary:(NSDictionary *)dictionary;
+(NSString*)getDistrictFromAddress:(NSString *)address;
+(NSString*)getHoodFromAddress:(NSString *)address;

+(CGSize)screenSize;
@end
7 changes: 7 additions & 0 deletions Muhit/Classes/UtilityFunctions.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Muhit/Networking/MuhitServices.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
15 changes: 8 additions & 7 deletions Muhit/Networking/MuhitServices.m
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -206,7 +207,7 @@ +(void)getRequestWithMethod:(NSString*)method backgroundCall:(BOOL)backgroundCal
}
}
}

[SERVICE_HANDLER getRequest: url
backgroundCall: backgroundCall
repeatCall: repeatCall
Expand Down
3 changes: 2 additions & 1 deletion Muhit/Networking/ServiceConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
170 changes: 85 additions & 85 deletions Muhit/Supporting Files/lang-tr.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,121 +2,121 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>add</key>
<string>Ekle</string>
<key>all</key>
<string>Tümü</string>
<key>my-supporteds</key>
<string>Desteklediklerim</string>
<key>my-ideas</key>
<string>Fikirlerim</string>
<key>announcements</key>
<string>Duyurular</string>
<key>my-headman</key>
<string>Muhtarım</string>
<key>anonymus-issue</key>
<string>Anonim olarak başvuru yap</string>
<key>cancel</key>
<string>İptal</string>
<key>change</key>
<string>Değiştir</string>
<key>check-connection</key>
<string>İnternet bağlantınızı kontrol ediniz</string>
<key>choose-hood</key>
<string>Mahalleni seç...</string>
<key>comments</key>
<string>Yorumlar</string>
<key>connect</key>
<string>Bağlan</string>
<key>created-issues</key>
<string>Yarattığı Fikirler</string>
<key>description</key>
<string>Açıklama</string>
<key>edit</key>
<string>Düzenle</string>
<key>edit-profile</key>
<string>Profili Düzenle</string>
<key>email</key>
<string>E-posta adresi</string>
<key>facebook-permission</key>
<string>Facebook ile giriş yapabilmek için ayarlardan BiTaksi uygulamasına izin vermelisiniz.</string>
<key>forgot-pass</key>
<string>Şifremi unuttum</string>
<key>forgot-pass-description</key>
<string>Eğer şifreni unuttuysan aşağıya e-posta adresini yazarak gönderdiğimiz link ile yeni bir şifre oluşturabilirsin.</string>
<key>headman</key>
<string>Muhtar</string>
<key>signup</key>
<string>Kayıt Ol</string>
<key>hood</key>
<string>Mahalle</string>
<key>idea</key>
<string>Fikir</string>
<key>latest</key>
<string>En Son</string>
<key>login</key>
<string>Giriş Yap</string>
<key>login-with-facebook</key>
<string>Facebook ile Bağlan</string>
<key>or</key>
<string>veya</string>
<key>my-profile</key>
<string>Profilim</string>
<key>profile</key>
<string>Profil</string>
<key>logout</key>
<string>Çıkış Yap</string>
<key>connect</key>
<string>Bağlan</string>
<key>popular</key>
<string>Popüler</string>
<key>map</key>
<string>Harita</string>
<key>latest</key>
<string>En Son</string>
<key>forgot-pass</key>
<string>Şifremi unuttum</string>
<key>submit</key>
<string>Gönder</string>
<key>forgot-pass-description</key>
<string>Eğer şifreni unuttuysan aşağıya e-posta adresini yazarak gönderdiğimiz link ile yeni bir şifre oluşturabilirsin.</string>
<key>my-headman</key>
<string>Muhtarım</string>
<key>my-ideas</key>
<string>Fikirlerim</string>
<key>my-profile</key>
<string>Profilim</string>
<key>my-supporteds</key>
<string>Desteklediklerim</string>
<key>name</key>
<string>Ad</string>
<key>ok</key>
<string>Tamam</string>
<key>or</key>
<string>veya</string>
<key>password</key>
<string>Şifre</string>
<key>email</key>
<string>E-posta adresi</string>
<key>photos-max-3</key>
<string>Resimler (max 3)</string>
<key>popular</key>
<string>Popüler</string>
<key>problem</key>
<string>Sorun</string>
<key>profile</key>
<string>Profil</string>
<key>profile-photo</key>
<string>Profil resmi</string>
<key>read-agreement</key>
<string>Kullanım koşullarını kabul ediyorum</string>
<key>name</key>
<string>Ad</string>
<key>surname</key>
<string>Soyad</string>
<key>username</key>
<string>Kullanıcı adı</string>
<key>hood</key>
<string>Mahalle</string>
<key>created-issues</key>
<string>Yarattığı Fikirler</string>
<key>supported-issues</key>
<string>Desteklediği Fikirler</string>
<key>edit-profile</key>
<string>Profili Düzenle</string>
<key>update</key>
<string>Güncelle</string>
<key>status-start</key>
<string>Başvuruldu</string>
<key>save</key>
<string>Kaydet</string>
<key>signup</key>
<string>Kayıt Ol</string>
<key>solution</key>
<string>Çözüm</string>
<key>status-developing</key>
<string>Gelişmekte</string>
<key>status-resolved</key>
<string>Çözüldü</string>
<key>comments</key>
<string>Yorumlar</string>
<key>status-start</key>
<string>Başvuruldu</string>
<key>submit</key>
<string>Gönder</string>
<key>support</key>
<string>Destekle</string>
<key>supported-issues</key>
<string>Desteklediği Fikirler</string>
<key>supporter</key>
<string>Destekçi</string>
<key>edit</key>
<string>Düzenle</string>
<key>add</key>
<string>Ekle</string>
<key>title</key>
<string>Başlık</string>
<key>description</key>
<string>Açıklama</string>
<key>Etiketler (max 3)</key>
<key>surname</key>
<string>Soyad</string>
<key>tags-max-3</key>
<string>Etiketler (max 3)</string>
<key>Resimler (max 3)</key>
<string>Resimler (max 3)</string>
<key>Anonim olarak başvuru yap</key>
<string>Anonim olarak başvuru yap</string>
<key>save</key>
<string>Kaydet</string>
<key>take-photo</key>
<string>Fotoğraf Çek</string>
<key>cancel</key>
<string>İptal</string>
<key>check-connection</key>
<string>İnternet bağlantınızı kontrol ediniz</string>
<key>ok</key>
<string>Tamam</string>
<key>idea</key>
<string>Fikir</string>
<key>change</key>
<string>Değiştir</string>
<key>facebook-permission</key>
<string>Facebook ile giriş yapabilmek için ayarlardan BiTaksi uygulamasına izin vermelisiniz.</string>
<key>title</key>
<string>Başlık</string>
<key>try-again</key>
<string>Yeniden Dene</string>
<key>choose-hood</key>
<string>Mahalleni seç...</string>
<key>profile-photo</key>
<string>Profil resmi</string>
<key>support</key>
<string>Destekle</string>
<key>unsupport</key>
<string>Destekledim</string>
<key>problem</key>
<string>Sorun</string>
<key>solution</key>
<string>Çözüm</string>
<key>update</key>
<string>Güncelle</string>
<key>username</key>
<string>Kullanıcı adı</string>
</dict>
</plist>
53 changes: 21 additions & 32 deletions Muhit/ViewControllers/AddEditIssue/AddEditIssueVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand All @@ -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];
Expand Down Expand Up @@ -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]);
}
Expand Down Expand Up @@ -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
Loading

0 comments on commit 1575f96

Please sign in to comment.