Skip to content

Commit

Permalink
Merge branch 'BartAdv/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-yakushev committed Mar 28, 2014
2 parents 59bcad6 + 11d7f84 commit 4895463
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/clojure/neko/ui/mapping.clj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
:inherits :view
:value-namespaces
{:ellipsize android.text.TextUtils$TruncateAt}
:traits [:text :text-size]}
:traits [:text :text-size :on-editor-action]}
:list-view {:classname android.widget.ListView
:inherits :view-group}
:search-view {:classname android.widget.SearchView
Expand Down
8 changes: 8 additions & 0 deletions src/clojure/neko/ui/traits.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
[neko.resource :as res]
[neko.context :as context]
[neko.listeners.view :as view-listeners]
[neko.listeners.text-view :as text-view-listeners]
neko.listeners.search-view)
(:use [neko.-utils :only [memoized]])
(:import [android.widget LinearLayout$LayoutParams TextView SearchView
Expand Down Expand Up @@ -396,6 +397,13 @@ next-level elements."
(fn [q] (on-query-text-submit q menu-item))
on-query-text-submit))))

(deftrait :on-editor-action
"Takes :on-editor-action attribute, which should be function
of three arguments, and sets it as OnEditorAction for the
TexView widget"
[^TextView wdg, {:keys [on-editor-action]}]
(.setOnEditorActionListener wdg (text-view-listeners/on-editor-action-call on-editor-action)))

;; ### ID storing traits

(deftrait :id-holder
Expand Down

0 comments on commit 4895463

Please sign in to comment.