             [neko.context :as context]
             [neko.listeners.view :as view-listeners])
   (:use [neko.-utils :only [memoized]])
-  (:import [android.widget LinearLayout$LayoutParams]
+  (:import [android.widget LinearLayout$LayoutParams TextView]
            [android.view View ViewGroup$LayoutParams]
            android.util.TypedValue
            java.util.HashMap))

       (defmethod apply-trait ~name
         [trait# widget# attributes# options#]
         (if (~match-pred attributes#)
           (let [result# (~codegen-body widget# attributes# options#)]
             (if (map? result#)
               [(:attributes-fn result# ~dissoc-fn)
                (:options-fn result# identity)]


  Example: `[:button {:def ok}]` defines a var `ok` which stores the
  button object."
  [wdg {:keys [def]} _]
  (intern (symbol (namespace def)) (symbol (name def)) wdg))

;; ### Basic traits

(deftrait :text
  "Sets widget's text to a string, integer ID or a keyword
  representing the string resource provided to `:text` attribute."
  [^TextView wdg, {:keys [text]} _]
  (if (keyword? text)
    (.setText wdg ^int (res/get-string text))
    (.setText wdg ^CharSequence text)))

;; ### Layout parameters attributes

