               [neko.find-view :refer [find-view]]
               [neko.threading :refer [on-ui]]
               [neko.ui :refer [config]]
-              [clojure.string :refer [join]])
+              [clojure.string :refer [join]]
+              [clojure.java.io :as io])
     (:import (android.widget EditText TextView)
              (java.util Calendar)
+             (java.io File)
              (android.app Activity)
              (android.app DatePickerDialog DatePickerDialog$OnDateSetListener)
              (android.app DialogFragment)))

(defn show-picker [^Activity activity dp]
  (. dp show (. activity getFragmentManager) "datePicker"))

(defn main-layout [activity]
  [:linear-layout {:orientation :vertical}
   [:linear-layout {:orientation :horizontal}

   [:button {:text "Add log",
             :on-click (fn [_]
                         (add-event activity))}]
   [:button {:text "Write file",
             :on-click (fn [_]
                         (write-file activity "arst"))}]
   [:button {:text "Read file",
             :on-click (fn [_]
                         (read-file activity))}]
   [:text-view {:id ::test}]
   [:text-view {:text (format-listing @listing),
                :id ::listing}]])

