           res (.getResources context)
           tab-width (get-resource :dimen :tab_width)]
       (set-state! this :tab-width (.getDimension res tab-width))
-      (.updateLayout (get-state this :tabs))
-      ))
-  (comment
-  (defn tab-bar-onMeasure
-    [this hspec vspec]
-    (.superOnMeasure this hspec vspec)
-    (.superSetMeasuredDimension this
-                           (- (.getMeasuredWidth this)
-                              (get-state this :tab-add-overlap))
-                           (.getMeasuredHeight this))))
-  (comment
-  (defn tab-bar-onLayout
-    [this changed left top right bottom]
-    (let [new-tab (get-state this :new-tab)
-          tabs (get-state this :tabs)
-          pl (.getPaddingLeft this)
-          pt (.getPaddingTop this)
-          w (- right left pl)
-          tab-add-overlap (get-state this :tab-add-overlap)
-          button-width (- (.getMeasuredWidth new-tab) tab-add-overlap)
-          sw (- w button-width)]
-      (.layout tabs pl pt (+ pl sw) (- bottom top))
-      (.layout new-tab (- (+ pl sw) tab-add-overlap) pt
-               (- (+ pl sw button-width) tab-add-overlap) (- bottom top)))))
+      (.updateLayout (get-state this :tabs))))
+;  (defn tab-bar-onMeasure
+;    [this hspec vspec]
+;    (.superOnMeasure this hspec vspec)
+;    (.superSetMeasuredDimension this
+;                           (- (.getMeasuredWidth this)
+;                              (get-state this :tab-add-overlap))
+;                           (.getMeasuredHeight this)))
+;  (defn tab-bar-onLayout
+;    [this changed left top right bottom]
+;    (let [new-tab (get-state this :new-tab)
+;          tabs (get-state this :tabs)
+;          pl (.getPaddingLeft this)
+;          pt (.getPaddingTop this)
+;          w (- right left pl)
+;          tab-add-overlap (get-state this :tab-add-overlap)
+;          button-width (- (.getMeasuredWidth new-tab) tab-add-overlap)
+;          sw (- w button-width)]
+;      (.layout tabs pl pt (+ pl sw) (- bottom top))
+;      (.layout new-tab (- (+ pl sw) tab-add-overlap) pt
+;               (- (+ pl sw button-width) tab-add-overlap) (- bottom top))))
   )
 
 (defn show-tab-bar

                   [android.content.Context android.util.AttributeSet int] [android.content.Context android.util.AttributeSet int]}
    :methods []
    :exposes-methods {onMeasure superOnMeasure
                      onLayout superOnLayout})
  (defn tab-layout-create-state
    [context]
    (atom {}))
  (defn tab-layout-init
    ([context] [[context] (tab-layout-create-state context)])
    ([context attrs] [[context attrs] (tab-layout-create-state context)])
    ([context attrs def-style] [[context attrs def-style] (tab-layout-create-state context)]))
  (defn tab-layout-post-init
    ([this context]
      ;(.setChildrenDrawingOrderEnabled this true)
      )
    ([this context attrs] (tab-layout-post-init this context))
    ([this context attrs def-style] (tab-layout-post-init this context)))
  (defn tab-layout-onMeasure
    [this hspec vspec]
    (.superOnMeasure this hspec vspec))
  (defn tab-layout-onLayout
    [this changed l t r b]
    (.superOnLayout this changed l t r b))
  )

(do
  (gen-class


(defn set-state!
  [this mkey mval]
  (swap! (.state this) assoc-in [mkey] mval))

(defn get-state
  [this mkey]
