     (let [context (get-state this :context)
           title (get-state this :title)
           icon-view (get-state this :icon-view)
-          close (get-state this :close)]
+          close (get-state this :close)
+          lp (.getLayoutParams this)]
       (.setTextAppearance title context (if selected (get-resource :style :TabTitleSelected) (get-resource :style :TabTitleUnselected)))
       (.setVisibility icon-view (if selected android.view.View/GONE android.view.View/VISIBLE))
       (.setVisibility close (if selected android.view.View/VISIBLE android.view.View/GONE))
       (.setHorizontalFadingEdgeEnabled this (not selected))
       (.superSetActivated this selected)
-;      (.setLayoutParams this (android.view.ViewGroup$LayoutParams.
-;                               (get-state this :tab-width)
-;                               android.view.ViewGroup$LayoutParams/MATCH_PARENT))
+;      (set! (. lp width) (get-state this :tab-width))
+;      (set! (. lp height) android.view.ViewGroup$LayoutParams/MATCH_PARENT)
+;      (.setLayoutParams this lp)
       (.setFocusable this (not selected))
       (.postInvalidate this)))
   (defn tab-view-setTitle

  )

(do
  (gen-class
    :name "net.nightweb.tabs.TabBar"
    :extends net.nightweb.LinearLayout
    :state "state"
    :init "init"
    :post-init "post-init"
    :prefix "tab-bar-"
    :constructors {[android.content.Context] [android.content.Context]
                   [android.content.Context android.util.AttributeSet] [android.content.Context android.util.AttributeSet]
                   [android.content.Context android.util.AttributeSet int] [android.content.Context android.util.AttributeSet int]}
    :methods []
    :exposes-methods {onMeasure superOnMeasure
                      onConfigurationChanged superOnConfigurationChanged})
  (defn tab-bar-create-state
    [context]
    (let [res (.getResources context)]
      (atom {:context context
             :tab-add-overlap (.getDimension res (get-resource :dimen :tab_addoverlap))
             :tab-width (.getDimension res (get-resource :dimen :tab_width))
             :tab-map {}})))
  (defn tab-bar-init
    ([context] [[context] (tab-bar-create-state context)])

(defn get-state
  [this mkey]
  (get @(.state this) mkey))

(do
  (gen-class
