Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Make config handle proxies of android.* classses #70

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

satchit8
Copy link

I found another use of keyword-by-classname, so here are similar modifications as with #68.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 77.944% when pulling e556a75 on satchit8:config-proxy into df40df5 on clojure-android:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 78.044% when pulling 0479ae1 on satchit8:config-proxy into df40df5 on clojure-android:master.

@satchit8
Copy link
Author

After reading more of the existing tests, I see that using multiple let blocks within a single deftest seems to be preferred. So may be the following is more appropraite:

(deftest config
  (let [v (ui/make-ui RuntimeEnvironment/application [:button {:text "hello"}])]
    (is (= View/VISIBLE (.getVisibility v)))
    (is (= "hello" (.getText v)))
    (ui/config v :text "updated" :visibility View/GONE)
    (is (= "updated" (.getText v)))
    (is (= View/GONE (.getVisibility v))))
  
  (let [ll (ui/make-ui RuntimeEnvironment/application
             [:linear-layout {:custom-constructor
                              (fn [ctx]
                                (proxy [LinearLayout] [ctx]))
                              :orientation :vertical}])]
    (is (= LinearLayout/VERTICAL(.getOrientation ll)))
    (ui/config ll :orientation :horizontal)
    (is (= LinearLayout/HORIZONTAL (.getOrientation ll)))))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants