Ver código fonte

Insert avatar on manageAccount

Marino Faggiana 8 anos atrás
pai
commit
16be6851ee

+ 21 - 0
iOSClient/Images.xcassets/avatarBN.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "avatarBN@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/avatarBN.imageset/avatarBN@2x.png


+ 14 - 12
iOSClient/Settings/CCManageAccount.m

@@ -52,6 +52,18 @@
     
     NSArray *listAccount = [CCCoreData getAllAccount];
 
+    // Section : PICKER ACCOUNT -------------------------------------------
+    
+    section = [XLFormSectionDescriptor formSectionWithTitle:@"cloud account"];
+    [form addFormSection:section];
+    form.rowNavigationOptions = XLFormRowNavigationOptionNone;
+    
+    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"pickerAccount" rowType:XLFormRowDescriptorTypePicker];
+    row.height = 90;
+    row.selectorOptions = listAccount;
+    row.value = app.activeAccount;
+    [section addFormRow:row];
+
     // Section : USER INFORMATION -------------------------------------------
     
     section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_user_information_", nil)];
@@ -93,17 +105,6 @@
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"detailTextLabel.font"];
     [section addFormRow:row];
 
-    // Section : PICKER ACCOUNT -------------------------------------------
-    
-    section = [XLFormSectionDescriptor formSectionWithTitle:@"cloud account"];
-    [form addFormSection:section];
-    form.rowNavigationOptions = XLFormRowNavigationOptionNone;
-    
-    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"pickerAccount" rowType:XLFormRowDescriptorTypePicker];
-    row.height = 90;
-    row.selectorOptions = listAccount;
-    row.value = app.activeAccount;
-    [section addFormRow:row];
     
     // Section : MANAGE ACCOUNT -------------------------------------------
     
@@ -141,6 +142,7 @@
     if (listAccount.count == 0) row.disabled = @YES;
     [section addFormRow:row];
     
+    
     return [super initWithForm:form];
 }
 
@@ -375,7 +377,7 @@
     
     UIImage *avatar = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/avatar.png", app.directoryUser]];
     if (!avatar)
-        avatar = [UIImage imageNamed:@"avatar"];
+        avatar = [UIImage imageNamed:@"avatarBN"];
     
     avatar = [self imageWithImage:avatar scaledToSize:CGSizeMake(40, 40) isAspectRation:YES];