This repository was archived by the owner on Apr 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 128
128
(.getName m)))
129
129
(.getDeclaredMethods c))))
130
130
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 6
6
[neko.listeners.text-view :as text-view-listeners]
7
7
[neko.listeners.adapter-view :as adapter-view]
8
8
neko.listeners.search-view
9
- [neko.-utils :refer [memoized int-id]])
9
+ [neko.-utils :refer [memoized int-id closest-android-ancestor ]])
10
10
(:import [android.widget LinearLayout$LayoutParams ListView TextView SearchView
11
11
ImageView RelativeLayout RelativeLayout$LayoutParams AdapterView
12
12
AbsListView$LayoutParams FrameLayout$LayoutParams Gallery$LayoutParams]
@@ -367,7 +367,7 @@ next-level elements."
367
367
use the container type to choose the correct LayoutParams instance."
368
368
{:applies? (constantly true )}
369
369
[wdg _ __]
370
- (let [kw (kw/keyword-by-classname (type wdg))
370
+ (let [kw (kw/keyword-by-classname (closest-android-ancestor ( class wdg) ))
371
371
container-type (-> (kw/get-keyword-mapping ) kw :container-type )]
372
372
{:options-fn #(assoc % :container-type (or container-type kw))}))
373
373
You can’t perform that action at this time.
0 commit comments