 
 (defn value
   "If the value is a keyword then returns the value for it from the
-keyword-mapping. If the value-keyword isn't present in the
-keyword-mapping, form the value as
-`classname-for-element-kw/CAPITALIZED-VALUE-KW`."
+  keyword-mapping. The value is sought in the element itself and all
+  its parents. If the value-keyword isn't present in any element's
+  keyword-mapping, form the value as
+  `classname-for-element-kw/CAPITALIZED-VALUE-KW`."
   [element-kw value]
-  (if-not (keyword? value)
-    value
-    (get-in @keyword-mapping [element-kw :values value]
-            (keyword->static-field (classname element-kw) value))))
+  (let [mapping @keyword-mapping
+        recursive-find (fn [kw]
+                         (when kw
+                           (or (get-in mapping [kw :values value])
+                               (recur (get-in mapping [kw :inherits])))))]
+    (if-not (keyword? value)
+      value
+      (or (recursive-find element-kw)
+          (keyword->static-field (classname element-kw) value)))))
 
 (defn add-default-atribute-value!
   "Adds a default attribute value for the given element."

  "Returns the list of all unique traits for `kw`. The list is built
  recursively."
  [kw]
  (let [first-level-traits (get-in @keyword-mapping [kw :traits])]
    (->> first-level-traits
         (mapcat all-traits)
         (concat first-level-traits)
         distinct)))

(defn set-value!
  "Associate the value keyword with the provided value for the given

(def ^{:private true} keyword-mapping
  (atom
   ;; UI widgets
   {:view {:traits [:def :layout-params :on-click :text]}
    :button {:classname android.widget.Button
             :inherits :view
             :attributes {:text "Default button"}}
    :linear-layout {:classname android.widget.LinearLayout
                    :inherits :view}
    :edit {:classname android.widget.EditText
           :inherits :view}
    :text-view {:classname android.widget.TextView
                :inherits :view}
    :list-view {:classname android.widget.ListView
                :inherits :view}

    ;; Other
    :layout-params {:classname ViewGroup$LayoutParams
