diff --git a/src/clojure/neko/ui/mapping.clj b/src/clojure/neko/ui/mapping.clj index 671227e..9f5ba53 100644 --- a/src/clojure/neko/ui/mapping.clj +++ b/src/clojure/neko/ui/mapping.clj @@ -98,20 +98,11 @@ (def ^{:private true} reverse-mapping (atom - {android.widget.Button :button - android.widget.LinearLayout :linear-layout - android.widget.RelativeLayout :relative-layout - android.widget.FrameLayout :frame-layout - android.widget.EditText :edit-text - android.widget.TextView :text-view - android.widget.ListView :list-view - android.widget.ImageView :image-view - android.webkit.WebView :web-view - android.widget.ScrollView :scroll-view - android.widget.Gallery :gallery - android.widget.GridView :grid-view - android.widget.ProgressBar :progress-bar - android.app.ProgressDialog :progress-dialog})) + (into {} + (keep (fn [[kw {classname :classname}]] + (when classname + [classname kw])) + (get-keyword-mapping))))) (defn set-classname! "Connects the given keyword to the classname." diff --git a/test/neko/ui/t_mapping.clj b/test/neko/ui/t_mapping.clj new file mode 100644 index 0000000..ea014d6 --- /dev/null +++ b/test/neko/ui/t_mapping.clj @@ -0,0 +1,7 @@ +(ns neko.ui.t-mapping + (:require [clojure.test :refer :all] + [neko.ui.mapping :refer :all :as m]) + (:import android.widget.TextView)) + +(deftest reverse-mapping + (is (= (@@#'m/reverse-mapping android.widget.TextView) :text-view)))