 
 (def listing (atom (sorted-map)))
 
-
-
 (defn sorted-map-array-to-array-task [lst]
   (mapcat identity (map (fn [sorted-map-data]
-                          (into [] (map-indexed (fn [i ele]  (apply ->Task (concat [(first sorted-map-data)] ele [i]))) (second sorted-map-data)))
-                          ) lst)))
+                          (into [] (map-indexed (fn [i ele] (apply ->Task (concat [(first sorted-map-data)] ele [i]))) (second sorted-map-data))))
+                        lst)))
 
-
-(defn make-date-adapter [activity]
+(defn make-date-adapter []
   (adapters/ref-adapter
     (fn [_]
-      [:linear-layout {:id-holder true
+      [:linear-layout {:id-holder   true
                        :orientation :vertical}
        [:text-view {:id ::date-tv}]
-       [:text-view {:id ::event-tv}]
-       ])
+       [:text-view {:id ::event-tv}]])
     (fn [_ view _ task]
       (let [date-view (find-view view ::date-tv)
             event-view (find-view view ::event-tv)]

  (swap! listing update-in [date-key] (fnil conj []) [event-name time-key]))

(defn add-event [activity]
  (let [
      date-key (try
        (read-string (get-elmt activity ::date))
        (catch RuntimeException e "Date string is empty!"))
      time-key (try
        (read-string (get-elmt activity ::time))
        (catch RuntimeException e "Time string is empty!"))]
    (when (number? date-key)
      (add-to-listing (get-elmt activity ::name) date-key time-key)
      (update-ui activity))))

            [clojure.string :refer [join]]
            [neko.find-view :refer [find-view]]
            [neko.threading :refer [on-ui]])
  (:import [android.widget CursorAdapter TextView LinearLayout]
           android.graphics.Color
           java.util.Calendar
           [android.app Activity DialogFragment]
           android.view.View
           [android.app DatePickerDialog DatePickerDialog$OnDateSetListener]
           [android.app TimePickerDialog TimePickerDialog$OnTimeSetListener]))

(declare add-event)
(declare date-picker)
