This repository was archived by the owner on Apr 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 128128 (.getName m)))
129129 (.getDeclaredMethods c))))
130130 methods)))
131+
132+ (defn closest-android-ancestor
133+ [^Class c]
134+ (loop [c c]
135+ (when c
136+ (if-let [cand-name
137+ (re-find #"^class (android\. .*)" (str c))]
138+ (Class/forName (second cand-name))
139+ (recur (.getSuperclass c))))))
Original file line number Diff line number Diff line change 66 [neko.listeners.text-view :as text-view-listeners]
77 [neko.listeners.adapter-view :as adapter-view]
88 neko.listeners.search-view
9- [neko.-utils :refer [memoized int-id]])
9+ [neko.-utils :refer [memoized int-id closest-android-ancestor ]])
1010 (:import [android.widget LinearLayout$LayoutParams ListView TextView SearchView
1111 ImageView RelativeLayout RelativeLayout$LayoutParams AdapterView
1212 AbsListView$LayoutParams FrameLayout$LayoutParams Gallery$LayoutParams]
@@ -367,7 +367,7 @@ next-level elements."
367367 use the container type to choose the correct LayoutParams instance."
368368 {:applies? (constantly true )}
369369 [wdg _ __]
370- (let [kw (kw/keyword-by-classname (type wdg))
370+ (let [kw (kw/keyword-by-classname (closest-android-ancestor ( class wdg) ))
371371 container-type (-> (kw/get-keyword-mapping ) kw :container-type )]
372372 {:options-fn #(assoc % :container-type (or container-type kw))}))
373373
You can’t perform that action at this time.
0 commit comments