Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

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

Rev 11 Rev 17
Línea 12... Línea 12...
12
struct CommentAndRatingPostCommentView: View {
12
struct CommentAndRatingPostCommentView: View {
Línea 13... Línea 13...
13
 
13
 
14
    var capsuleModel : CapsuleModel
14
    var capsuleModel : CapsuleModel
15
    @Binding var comment : String
15
    @Binding var comment : String
-
 
16
    @Binding var rating : Double
-
 
17
    
-
 
18
    let onSend: () -> Void
Línea 16... Línea 19...
16
    @Binding var rating : Double
19
 
17
 
20
 
18
    var body: some View {
21
    var body: some View {
19
        VStack(spacing: 0) {
22
        VStack(spacing: 0) {
Línea 68... Línea 71...
68
                .padding(.trailing, 16)
71
                .padding(.trailing, 16)
69
                .padding(.top, 10)
72
                .padding(.top, 10)
Línea 70... Línea 73...
70
                
73
                
71
                HStack {
74
                HStack {
72
                    Spacer() 
75
                    Spacer() 
73
                    Button(action: {
-
 
74
                       
-
 
75
                        send()
-
 
76
                        
-
 
77
                    }, label: {
76
                    Button(action: onSend, label: {
78
                        Text(Config.LANG_COMMON_SEND)
77
                        Text(Config.LANG_COMMON_SEND)
79
                         .font(Font.custom(Config.FONT_NAME_REGULAR, size: 16))
78
                         .font(Font.custom(Config.FONT_NAME_REGULAR, size: 16))
Línea 80... Línea 79...
80
                         .frame(width: UIScreen.main.bounds.width - 32, height: 35)
79
                         .frame(width: UIScreen.main.bounds.width - 32, height: 35)
Línea 93... Línea 92...
93
                Spacer()
92
                Spacer()
94
        }.background(Color("color_picker_background"))
93
        }.background(Color("color_picker_background"))
Línea 95... Línea 94...
95
       
94
       
Línea 96... Línea -...
96
    }
-
 
97
    
-
 
98
    func send()
-
 
99
    {
-
 
100
        if comment.trimingLeadingSpaces().isEmpty {
-
 
Línea 101... Línea -...
101
            return
-
 
102
        }
-
 
103
 
-
 
104
        
-
 
105
       // print("Notification: \(Constants.NOTIFICATION_NAME_COMMAND_POST_COMMENT) ")
-
 
106
        
-
 
107
        NotificationCenter.default.post(
-
 
108
            name:Constants.NOTIFICATION_NAME_COMMAND_POST_COMMENT,
-
 
Línea 109... Línea 95...
109
            object: nil,
95
    }
Línea 121... Línea 107...
121
    @State static var rating : Double = 3.6
107
    @State static var rating : Double = 3.6
122
    static let capsuleModel = CapsuleModel()
108
    static let capsuleModel = CapsuleModel()
Línea 123... Línea 109...
123
 
109
 
124
    
110
    
-
 
111
    static var previews: some View {
-
 
112
        CommentAndRatingPostCommentView(capsuleModel: capsuleModel, comment: self.$comment, rating: self.$rating) {
125
    static var previews: some View {
113
            
126
        CommentAndRatingPostCommentView(capsuleModel: capsuleModel, comment: self.$comment, rating: self.$rating)
114
        }