From 1596b61b46bcbc3fa38c912027909d0894627a2f Mon Sep 17 00:00:00 2001 From: alwx Date: Tue, 27 Jun 2017 23:26:46 +0200 Subject: [PATCH] More UI components accessible from API, ability to generate QR codes, small cleanup --- .re-natal | 3 +- .../main/res/drawable-hdpi/icon_qr_gray.png | Bin 2753 -> 0 bytes .../main/res/drawable-mdpi/icon_qr_gray.png | Bin 1928 -> 0 bytes .../main/res/drawable-xhdpi/icon_qr_gray.png | Bin 3559 -> 0 bytes .../main/res/drawable-xxhdpi/icon_qr_gray.png | Bin 5241 -> 0 bytes .../res/drawable-xxxhdpi/icon_qr_gray.png | Bin 917 -> 0 bytes .../icon_qr_gray.imageset/Contents.json | 21 ------ .../icon_qr_gray.imageset/icon_qr_gray.png | Bin 5241 -> 0 bytes package.json | 1 - resources/status.js | 30 +++++++- src/status_im/commands/utils.cljs | 34 +++++---- .../components/image_button/view.cljs | 6 -- src/status_im/components/react.cljs | 6 -- .../components/refreshable_text/view.cljs | 67 ------------------ .../components/selectable_field/styles.cljs | 38 ---------- .../components/selectable_field/view.cljs | 63 ---------------- 16 files changed, 44 insertions(+), 225 deletions(-) delete mode 100644 android/app/src/main/res/drawable-hdpi/icon_qr_gray.png delete mode 100644 android/app/src/main/res/drawable-mdpi/icon_qr_gray.png delete mode 100644 android/app/src/main/res/drawable-xhdpi/icon_qr_gray.png delete mode 100644 android/app/src/main/res/drawable-xxhdpi/icon_qr_gray.png delete mode 100644 android/app/src/main/res/drawable-xxxhdpi/icon_qr_gray.png delete mode 100644 ios/StatusIm/Images.xcassets/icon_qr_gray.imageset/Contents.json delete mode 100644 ios/StatusIm/Images.xcassets/icon_qr_gray.imageset/icon_qr_gray.png delete mode 100644 src/status_im/components/refreshable_text/view.cljs delete mode 100644 src/status_im/components/selectable_field/styles.cljs delete mode 100644 src/status_im/components/selectable_field/view.cljs diff --git a/.re-natal b/.re-natal index ca36c67259..71ee862f9c 100644 --- a/.re-natal +++ b/.re-natal @@ -40,8 +40,7 @@ "react-native-autolink", "instabug-reactnative", "nfc-react-native", - "react-native-http-bridge", - "react-native-autogrow-textinput" + "react-native-http-bridge" ], "imageDirs": [ "images" diff --git a/android/app/src/main/res/drawable-hdpi/icon_qr_gray.png b/android/app/src/main/res/drawable-hdpi/icon_qr_gray.png deleted file mode 100644 index ce7a826d0d9f80ffbf7a7734851555e5ee1c9334..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2753 zcmY*bc|6oxAO5+DX@(+1MAlHu3@sQ-WgRliFxj#V21Ax%Y$I8+ZI z4U%lxC3TCL2$e|Tj_!T$`@ZM%Ip_O5&w0-Ce810RZ4NM(SIzqcnR; zfw86 z01)=iZ^dY_5BB*ZZ36)SBCtC-0BXJn0C3n6ur?$clqtg1&j*Tg^K-#NLw)?&Yyi*- zMX*yJJP9Wm>T}sQ5D}^^{hNVc=esaWTJkrAOGa+S1ayM*oh#>m(7}|Lf!%_)lBx24TA=Fcl~q z_OCYks@5)wFb^Q$+0MKAIx1Sfng56Vu3Bo$|H- z02(sZKaaK9ch~yTWpSg!Z*m{yzYh#vn%p04S1mZn9s31sDiwvs9N!a-ym+pAzAhVx zGeJ$;=O1iqsiBRh3o`DQ$z*8hvuIB_L4s8m%dyq5U8rbo`wl%(LBTBb;KcRm?}#h2 z`HOWCq-mYly7j)rzR0}D?VUouxM=$Q`)H60(Oz*)wV(oy4`?sNTO{s)q=d&x-u6wb zu5!08U(h}<)gJ6N=IlS5Tam^0wQAS>Wt;$ zgk|km+e(dj2eK4<{P0V|_lAP8vuj&*KXU}iqR=0HKA1XEyW&_^;gM4hZ|a}M>)WQe zzn@u{+d67PR}0NI#L`}mpF(L`PDFNOg7zv-L%ydJcb)?)a(gw}*$2s zS4Lx5a5?ORMus>Yk2!YcW|sJRj^dx{se4me@%UV_i3zS!31T5beLrEja%kx;vn7Sw zxqFyE-LHP_8OH!YPrYB)6>yBR4+{L%P4mN{80KoW+l!0&*nW=uLL)IHKEhaMSk=s_ zrF>@Jk2t+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OeyNU5m#kkh8aXNeA~&lVGNn+0UrR zYluPT9qU(Ha)fWVCndqYpDhciZK+LLgzfo!uqRw+{|aBit31001p4%z3fR$BK({f5}7wOana_IjWccY9$o z)agwr25nWwqpr^9baS*oeQEs7A(y&p^GAU{9$iJYa2F)k_6$sm1NS(4L!Lq+`SQ`` zKZ93ERJ*H*%6YVU)?>rzwS_TVRU}R6FL0`=>-QLhNY@3bu`*DwPbq7V_GFUh%eUrF zb)5rA0^mYVovG?dw@@pm-9NGvXAmH^X*PI5MrFY-oTk-VyTAD4K@Z)E|>WN+Ja3*2W9FsZN;H+5>XM1#Aj(u;KJ&Ml z>9p=Uajl%PMy0_qt{=sDss9L${Pm;!JT*%G^pqG*+CjGSK!sTbNDGg`7JgvP5+G~)aUfN zN86%s+JPQ9_PVxAYgH_^yVA>ZCI3w_nxAmLwNhCnA>z>`;GXXQ3#yKFaFgo!1Z zk@b(mD?>UJs1KiIUkZ)UVca3=k9nuBdf~cwflVZL?Kj&^Z~7m1xu;E*H$H4^^cl6% z4v)~CUF=CKDh4vbEEh@@eCuaYTI2r^n+MOA7s{uFroT-dc`%H71rA<%G-%~!e0qGe zu@o%i#Ez3EULcWPqAV7E_l#-z;yWMNAJ(=Nu0rQCXy2}c?fiH4HYdr|B;VwJ0I!Ej A7ytkO diff --git a/android/app/src/main/res/drawable-xhdpi/icon_qr_gray.png b/android/app/src/main/res/drawable-xhdpi/icon_qr_gray.png deleted file mode 100644 index 71c6fd567d0039c60d59bb5354273814f1638f5a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3559 zcmY*ccQ_kd`;OhFwwe_pG0IC4s|2x2ZCb6ZR%q--Y&DA-;k7A>7Hz89qCummy{k2g z5~IT^HBy~VF3>SKxKt7x5QZ*87evZc)=W9e4Nm*ATQrj zHUOX!q;wj3p>dAjATLjEKcyfPh9#I1d!W(#RC7<%30oFDGKDRB0B!{r*J)r*^jWd7(uu5#>21 zww^Vct9%8sMwxU|Z$ArN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Qd`&+Al*UQqsW(UA zm7qY(z}$3xLoKTtpC%}^K1MpUSUTb4YhF`Nh)R6h3Fk?lXUqfT`xQ=Ko4K6}1OLFw z59cx#!$T>zj!T+wB9^R)+|RvxZ*8rjScyxQw*OQJEME2w@B8BK47lVBKY^g9kAYXW zX%<@@(p(a6b%*j?G-7%B;u$mx_SZQtCY$;hxxxa0=Z{rS=H1gAip@wa!gp4$V)?Tm v=Ls_0YB4r%1$LhVd>8qw;KmejdBuYJ9W8ESsqy&lf1v7PEya)W$cTRdmS*DT diff --git a/android/app/src/main/res/drawable-xxxhdpi/icon_qr_gray.png b/android/app/src/main/res/drawable-xxxhdpi/icon_qr_gray.png deleted file mode 100644 index cd5d3df69a678b3152098e801edf266dffc5c586..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 917 zcmV;G18V$0-Byx%_dXVhmeU9J*GzVz2O`wvp5WBTOk>Y6d z^g06&2@+vA?}?w8;ZU<#K+dnO-k+7#X;H3jUE7?MtKaTtozq$!8?V#r_I=C-7FZk? z*Vk{0#p;Js@|0^(M0@gm`97ryhQ@JG-h3z))h`9Z{%)>M-?tda$T-{^`RX2iRyS_f zp1lpZBtzq9M!>kny%?D@vY~No*Rm0&S!nw8ShL}Av>QeZ)tpT|mJD1R-Yrqum6Lbz z6qgAeN9$j9J^XOKy!kx8{Pr$)qw+euF0ZrOSFKKC^}^$5o%qm$Kj+KkYiS?X>x?k+ zHhS4W$I(VNp||mAu!wCtB0>gk5{Sme(G`wLOtaAR>k4z@mkw|oUF*xxc?hZg;c*zz z6Ct{;>sLitow#T3orC_^H2=H%oB!Wbh#nkAj)84<>@MJ}-^~}_-=Gt%f}^j2%?Jn? zw`XK%M2t@ia4xnR}qI5qATJkE~}3WS1Trg!!8Rcd1s-ym_C+rgWaG>xGE8GbwW%ZO99Q^ z2+VrHgXv@WUdI%Orube5Jkcy=yHgm^6ou##o7b@yE2fW*XjJ!(<+9MrQn*}wkqlVG z^s!ujgAc)3E_A{tl~}GQr=~Sim$+Y`;2J7DKB0P>FM`@8hgQO|jg$=>~SwbiZ(IJyc2V|3c ruR}XcnwsO;&&t_lAuX}%Z*uYn>zhW`dCCZ400000NkvXXu0mjfBvH5> diff --git a/ios/StatusIm/Images.xcassets/icon_qr_gray.imageset/Contents.json b/ios/StatusIm/Images.xcassets/icon_qr_gray.imageset/Contents.json deleted file mode 100644 index 1738a7c226..0000000000 --- a/ios/StatusIm/Images.xcassets/icon_qr_gray.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "icon_qr_gray.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ios/StatusIm/Images.xcassets/icon_qr_gray.imageset/icon_qr_gray.png b/ios/StatusIm/Images.xcassets/icon_qr_gray.imageset/icon_qr_gray.png deleted file mode 100644 index 9100f6d22b038786c93bc61fadb05e70c5da8ca9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5241 zcmY*dcUTk7vZaPDNH+!uAP^A<9fAQBkluR<5D11|L+>5L&_tRvK~WJw^%Zrz}tKaR{`29ZciKd1O%FRW{+SbkHiIAU* z`!$+?0PZJq?YcbivIhIPIJ;tG{A9WQLC9SDf74Jd@IMeQCs{5NO&zd;o97d-gpjz9 zFqa%97z~Dc+M;Fj6qWu{ejUkj*?W1p%Rr&NzP>`fVnS}7c2E%*3OO}i4uh4(jzx(uZK>x3jE9O6A zT@MKTdjk~_5{CYl`??hVH!Gv<>G0%Q`7ghm2>c)9|I7VH2M+x!{(qYJ_oV-1uSb=m zghT)PY;u$u?R=&L1oZW)ijNHZ2xk$2Sc@Lhd{|Q8)@&@>YjH;qnDO(ST^Xh{2pvh; zD=pRA5tX_wgnE$mj(dlTwv)rsmfMHi-3goCm0jT5&%@Mss+FFmNjki!Gt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TRdmS*DT diff --git a/package.json b/package.json index 8937e868d0..3043a31a38 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,6 @@ "react-native": "^0.43.4", "react-native-action-button": "^2.0.13", "react-native-android-sms-listener": "github:adrian-tiberius/react-native-android-sms-listener#listener-bugfix", - "react-native-autogrow-textinput": "^3.0.2", "react-native-autolink": "^0.10.0", "react-native-camera": "^0.9.4", "react-native-circle-checkbox": "github:paramoshkinandrew/ReactNativeCircleCheckbox", diff --git a/resources/status.js b/resources/status.js index e71bef51a0..eff089cd46 100644 --- a/resources/status.js +++ b/resources/status.js @@ -103,13 +103,29 @@ function call(pathStr, paramsStr) { return JSON.stringify(result); } +function view(options, elements) { + return ['view', options].concat(elements); +} + function text(options, s) { s = Array.isArray(s) ? s : [s]; return ['text', options].concat(s); } -function view(options, elements) { - return ['view', options].concat(elements); +function textInput(options) { + return ['text-input', options]; +} + +function image(options) { + return ['image', options]; +} + +function qrCode(options) { + return ['qr-code', options]; +} + +function linking(options) { + return ['linking', options]; } function slider(options) { @@ -124,6 +140,10 @@ function touchable(options, element) { return ['touchable', options, element]; } +function activityIndicator(options) { + return ['activity-indicator', options]; +} + function scrollView(options, elements) { return ['scroll-view', options].concat(elements); } @@ -199,9 +219,13 @@ var status = { components: { view: view, text: text, - slider: slider, + textInput: textInput, image: image, + qrCode: qrCode, + linking: linking, + slider: slider, touchable: touchable, + activityIndicator: activityIndicator, scrollView: scrollView, webView: webView, validationMessage: validationMessage, diff --git a/src/status_im/commands/utils.cljs b/src/status_im/commands/utils.cljs index 90bb88a04d..05de9df8a0 100644 --- a/src/status_im/commands/utils.cljs +++ b/src/status_im/commands/utils.cljs @@ -1,31 +1,29 @@ (ns status-im.commands.utils (:require [clojure.set :as set] [clojure.walk :as w] - [status-im.components.react :refer [text - scroll-view - view - slider - web-view - image - touchable-highlight]] + [re-frame.core :refer [dispatch trim-v debug]] + [status-im.components.react :as components] [status-im.chat.views.input.web-view :as chat-web-view] [status-im.chat.views.input.validation-messages :as chat-validation-messages] - [re-frame.core :refer [dispatch trim-v debug]] - [status-im.utils.handlers :refer [register-handler]] - [taoensso.timbre :as log])) + [status-im.components.qr-code :as qr] + [status-im.utils.handlers :refer [register-handler]])) (defn json->clj [json] (when-not (= json "undefined") (js->clj (.parse js/JSON json) :keywordize-keys true))) (def elements - {:text text - :view view - :slider slider - :scroll-view scroll-view - :web-view web-view - :image image - :touchable touchable-highlight + {:view components/view + :text components/text + :text-input components/text-input + :image components/image + :qr-code qr/qr-code + :linking components/linking + :slider components/slider + :scroll-view components/scroll-view + :web-view components/web-view + :touchable components/touchable-highlight + :activity-indicator components/activity-indicator :bridged-web-view chat-web-view/bridged-web-view :validation-message chat-validation-messages/validation-message}) @@ -60,7 +58,7 @@ (update 0 get-element) (update 1 check-events)) - :esle el)) + :else el)) markup))) (defn reg-handler diff --git a/src/status_im/components/image_button/view.cljs b/src/status_im/components/image_button/view.cljs index d95f9a3b17..1d6722acc1 100644 --- a/src/status_im/components/image_button/view.cljs +++ b/src/status_im/components/image_button/view.cljs @@ -22,10 +22,4 @@ :value (if show-label? (label :t/scan-qr)) :style st/scan-button-text - :handler handler}]) - -(defn show-qr-button [{:keys [handler]}] - [image-button {:icon :icon_qr_gray - :value (label :t/show-qr) - :style st/show-qr-button-text :handler handler}]) \ No newline at end of file diff --git a/src/status_im/components/react.cljs b/src/status_im/components/react.cljs index abbc7f311e..4c7de445ed 100644 --- a/src/status_im/components/react.cljs +++ b/src/status_im/components/react.cljs @@ -134,12 +134,6 @@ (def swiper (adapt-class (js/require "react-native-swiper"))) -;; Autogrow text input - -(def autogrow-class (js/require "react-native-autogrow-textinput")) - -(def autogrow-text-input (r/adapt-react-class (.-AutoGrowingTextInput autogrow-class))) - ;; Clipboard (def sharing diff --git a/src/status_im/components/refreshable_text/view.cljs b/src/status_im/components/refreshable_text/view.cljs deleted file mode 100644 index 348b34e94d..0000000000 --- a/src/status_im/components/refreshable_text/view.cljs +++ /dev/null @@ -1,67 +0,0 @@ -(ns status-im.components.refreshable-text.view - (:require [reagent.core :as r] - [reagent.impl.component :as rc] - [status-im.components.react :refer [view - animated-view - text]] - [status-im.components.animation :as anim])) - -(defn start-animation [{:keys [old-value-top - new-value-top - old-value-opacity - new-value-opacity]}] - (anim/start - (anim/timing old-value-top {:toValue 10 - :duration 300})) - (anim/start - (anim/timing new-value-top {:toValue 0 - :duration 300})) - (anim/start - (anim/timing old-value-opacity {:toValue 0 - :duration 300})) - (anim/start - (anim/timing new-value-opacity {:toValue 1.0 - :duration 300}))) - -(defn refreshable-text [{:keys [value]}] - (let [old-value-top (anim/create-value 0) - new-value-top (anim/create-value 0) - old-value-opacity (anim/create-value 0) - new-value-opacity (anim/create-value 1.0) - context {:old-value-top old-value-top - :new-value-top new-value-top - :old-value-opacity old-value-opacity - :new-value-opacity new-value-opacity}] - (r/create-class - {:get-initial-state - (fn [] - {:old-value nil - :value value}) - :component-will-update - (fn [component props] - (let [{new-value :value} (rc/extract-props props) - {old-value :value} (r/props component)] - (r/set-state component {:old-value old-value - :value new-value}) - (anim/set-value old-value-top 0) - (anim/set-value new-value-top -10) - (anim/set-value old-value-opacity 1.0) - (anim/set-value new-value-opacity 0.0) - (start-animation context))) - :reagent-render - (fn [{:keys [style text-style font]}] - (let [component (r/current-component) - {:keys [old-value value]} (r/state component)] - [view style - [animated-view {:style {:position :absolute - :margin-top old-value-top - :opacity old-value-opacity}} - [text {:style text-style - :font font} - old-value]] - [animated-view {:style {:position :absolute - :margin-top new-value-top - :opacity new-value-opacity}} - [text {:style text-style - :font font} - value]]]))}))) diff --git a/src/status_im/components/selectable_field/styles.cljs b/src/status_im/components/selectable_field/styles.cljs deleted file mode 100644 index 2a220942ba..0000000000 --- a/src/status_im/components/selectable_field/styles.cljs +++ /dev/null @@ -1,38 +0,0 @@ -(ns status-im.components.selectable-field.styles - (:require [status-im.utils.platform :refer [platform-specific]] - [status-im.components.styles :refer [text1-disabled-color]])) - - -(def selectable-field-container - {}) - -(def label-container - {:margin-bottom 13}) - -(def label - {:color "#838c93" - :background-color :transparent - :font-size 14}) - -(def text-container - {:padding 0 - :margin-bottom 18 - :margin 0}) - -(def text - {:font-size 16 - :color text1-disabled-color - :margin-right 16 - :text-align-vertical :top}) - -(defn sized-text - [height] - (let [{:keys [additional-height - margin-top]} (get-in platform-specific [:component-styles :sized-text])] - (merge text {:height (+ additional-height height) - :margin-bottom 0 - :margin-top margin-top - :padding-top 0 - :padding-left 0 - :margin-left 0 - :padding-bottom 0}))) diff --git a/src/status_im/components/selectable_field/view.cljs b/src/status_im/components/selectable_field/view.cljs deleted file mode 100644 index cd4ef52494..0000000000 --- a/src/status_im/components/selectable_field/view.cljs +++ /dev/null @@ -1,63 +0,0 @@ -(ns status-im.components.selectable-field.view - (:require [status-im.components.react :refer [view - text-input - text]] - [reagent.core :as r] - [status-im.components.selectable-field.styles :as st] - [status-im.i18n :refer [label]] - [status-im.utils.platform :as p] - [taoensso.timbre :as log])) - -(defn- on-press-default - [event component] - (log/debug "Pressed " event component) - (r/set-state component {:focused? true})) - -(defn- on-selection-change - [event _] - (let [selection (.-selection (.-nativeEvent event)) - start (.-start selection) - end (.-end selection)] - (log/debug "Selection changed: " start end))) - -(defn- on-layout-text - [event component] - (let [height (.-height (.-layout (.-nativeEvent event))) - {:keys [full-height]} (r/state component)] - (when (and (pos? height) (not full-height)) - (r/set-state component {:full-height height - :measured? true})))) - -(defn- reagent-render - [{:keys [label value editable? props on-press] :as data}] - (let [component (r/current-component) - {:keys [focused? measured? full-height]} (r/state component)] - (log/debug "reagent-render: " data focused? measured? full-height) - [view st/selectable-field-container - [view st/label-container - [text {:style st/label - :font :medium} (or label "")]] - [view st/text-container - (if focused? - [text-input {:style (st/sized-text full-height) - :multiline true - :selectTextOnFocus true - :editable (if p/android? true editable?) - :auto-focus true - :on-selection-change #(on-selection-change % component) - :on-focus #(log/debug "Focused" %) - :on-blur #(r/set-state component {:focused? false}) - :value value}] - [text (merge {:style st/text - :on-press (or on-press - #(on-press-default % component)) - :onLayout #(on-layout-text % component) - :font :default - :ellipsizeMode :middle - :number-of-lines (if measured? 1 0)} (or props {})) (or value "")])]])) - -(defn selectable-field [_] - (let [component-data {:display-name "selectable-field" - :reagent-render reagent-render}] - (reagent.core/create-class component-data))) -