Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 22 | Rev 24 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 22 Rev 23
Línea 8... Línea 8...
8
import SwiftUI
8
import SwiftUI
Línea 9... Línea 9...
9
 
9
 
Línea 10... Línea 10...
10
struct NotificationListItemView: View {
10
struct NotificationListItemView: View {
-
 
11
    
-
 
12
    var notification :  UserNotificationModel
-
 
13
    
11
    
14
 
Línea 12... Línea -...
12
    var notification :  UserNotificationModel
-
 
13
    let onDelete: () -> Void
-
 
14
    
-
 
15
    /*
-
 
16
    init(notification : UserNotificationModel)
-
 
17
    {
-
 
18
        let formatterService = DateFormatter()
15
    
19
        formatterService.dateFormat = Constants.FORMAT_DATETIME_SERVICE
-
 
20
        if let date = formatterService.date(from: notification.addedOn) {
-
 
21
          
-
 
22
        let dateFormatterUser = DateFormatter()
-
 
23
        dateFormatterUser.dateFormat = Constants.FORMAT_DATE_TIME_24
16
    let onDelete: () -> Void
24
        self.addedOnToUser =  dateFormatterUser.string(from: date)
-
 
Línea 25... Línea 17...
25
            
17
    
26
            
18
 
27
    }*/
19
 
28
    
20
    
Línea 49... Línea 41...
49
                            }).padding(.trailing, 10)
41
                            }).padding(.trailing, 10)
50
                            .foregroundColor(Color("color_capsule_list_item_title_foreground"))
42
                            .foregroundColor(Color("color_capsule_list_item_title_foreground"))
Línea 51... Línea 43...
51
                        
43
                        
52
                    }
44
                    }
53
                    HStack {
45
                    HStack {
54
                        Text(notification.description)
46
                        Text(notification.body)
55
                            .font(Font.custom(Config.FONT_NAME_REGULAR, size: 12))
47
                            .font(Font.custom(Config.FONT_NAME_REGULAR, size: 12))
Línea 56... Línea 48...
56
                            .foregroundColor(Color("color_capsule_list_item_description_foreground"))
48
                            .foregroundColor(Color("color_capsule_list_item_description_foreground"))
57
                     
49
                     
58
                        
50
                        
Línea -... Línea 51...
-
 
51
                        Spacer()
-
 
52
                    }.padding(.top, 3)
-
 
53
                    .padding(.bottom, 10)
-
 
54
                    
-
 
55
                    
-
 
56
                    HStack {
-
 
57
 
-
 
58
                        
-
 
59
                        Spacer()
-
 
60
                        
-
 
61
                        Text(notification.timeOn)
Línea -... Línea 62...
-
 
62
                            .font(Font.custom(Config.FONT_NAME_REGULAR, size: 12))
-
 
63
                            .foregroundColor(Color("color_capsule_list_item_description_foreground"))
-
 
64
                            .padding(.trailing, 10)
Línea -... Línea 65...
-
 
65
                        
-
 
66
                       
59
                        Spacer()
67
                    
60
                    }.padding(.top, 3)
68
                   
Línea 61... Línea 69...
61
                    .padding(.bottom, 10)
69
                    }.padding(.top, 10)
Línea 62... Línea 70...
62
                    
70
                .padding(.bottom, 10)
Línea 78... Línea 86...
78
    }
86
    }
79
}
87
}
Línea 80... Línea 88...
80
 
88
 
Línea 81... Línea 89...
81
struct NotificationListItemView_Previews: PreviewProvider {
89
struct NotificationListItemView_Previews: PreviewProvider {
Línea 82... Línea 90...
82
    
90
    
83
    static var  notification  = UserNotificationModel( userUuid: "U123", title: "Titulo Notification #1", description: "Description Notification #1", viewed: 0, url: "https://www.google.co.ve", addedOn: "2022-08-12T10:00:00")
91
    static var  notification  = UserNotificationModel( userUuid: "U123", title: "Titulo Notification #1", body: "Description Notification #1", viewed: 0, url: "https://www.google.co.ve", dateOn: "2022-08-12", timeOn: "10:00:00")
84
    
-
 
85
    static var previews: some View {
-
 
86
        NotificationListItemView(notification: notification) {
92
    
87
            
93
    static var previews: some View {